#Two-Sample Test of Proportions prop.test(x=c(56,16), n=c(900,411), correct=F) #OR #Chisquare Test x=c(56,16) # No. of "successes" n=c(900,411) # No. of trials n-x # No. of "failures" tab = matrix(c(x,n-x), nrow=2, byrow=TRUE) tab rownames(tab) = c("Yes" , "No") #Name rows and colnames(tab) = c("Prevast", "Placebo") #cols (optional) tab chisq.test(tab, correct=FALSE) #Alternative test of proportions chisq.test(tab, correct=FALSE)$observed chisq.test(tab, correct=FALSE)$expected o1 = 278; o2 = 122 e1 = 300; e2 = 100 x2.s = (o1-e1)^2/e1 + (o2-e2)^2/e2 pchisq(x2.s, 1) 1-pchisq(x2.s, 1)