I wish to compare proportions between two small groups.
In group 1, 2 of 18 students received honours. In group 2, 9 of 21 received honours.
This is a small sample, so if I use the t-test:
x1 <- c(rep(1,2),rep(0,16)) x2 <- c(rep(1,9),rep(0,12)) t.test(x1,x2, alternative="two.sided", conf.level = 0.95)
I obtain a p-value of .0239 and CI of (-0.590, -0.0445):
If I had used the z-test (a.k.a. chi-squared test with 1 degree of freedom):
prop.test(x=c(2,9), n= c(18,21), alternative="two.sided", conf.level=0.95)
I get a p-value of .0659 and a CI of (-0.626, -0.00921)
I had always thought that for small samples one must use a t-test since the normal approximation is not valid for small samples, causing exaggerated significance under z-test. So why is the difference significant under the t-test, but not under the z-test? And in the t-test, why does the CI not include zero when the p-value is less than alpha?