#四个表卡方检验
ns <-c(46,18) #成功数或阳性数
nt<-c(52,26) #试验次数(n)
prop.test(ns,nt)
2-sample test for equality of proportions with continuity correction
data: ns out of nt
X-squared = 3.1448, df = 1, p-value = 0.07617
alternative hypothesis: two.sided
95 percent confidence interval:
-0.03405669 0.41867207
sample estimates:
prop 1 prop 2
0.8846154 0.6923077