怎样才能得到每行的p-value?程序只保存了最后一行的值。谢谢!
>
asthma.data<-read.csv("d:/ca/rprog/data/hrasthma.csv",header=T,sep=',')<br />
> <br />
> # get information from binom distribution<br />
> for(i in 1:2){<br />
+ theBin<-binom.test(asthma.data$case[i],asthma.data$pop[i],p=0.083)<br />
+ # if((theBin$p.value<0.05) and(theBin$<br />
+ asthma.result<-data.frame(hr=asthma.data$hr[i],ss=theBin$p.value,sep=',');<br />
+ <br />
+ }<br />
>
>
>
>
> asthma.data
hr case pop
1 3555 14739 113857
2 3533 12570 138479
> asthma.result
hr ss sep
1 3533 4.581646e-25 ,