Computes a continuity-corrected z-test for a difference of population proportions in a 2-group design. A confidence interval for a difference in population proportions is a recommended supplement to the z-test (see ci.prop2).
test.prop2(f1, f2, n1, n2)
number of group 1 participants who have the attribute
number of group 2 participants who have the attribute
sample size for group 1
sample size for group 2
Returns a 1-row matrix. The columns are:
Estimate - ML estimate of proportion difference
z - z test statistic
p - two-sided p-value
Snedecor GW, Cochran WG (1989). Statistical Methods, 8th edition. ISU University Pres, Ames, Iowa.
test.prop2(11, 26, 50, 50)
#> Estimate z p
#> -0.3 2.899726 0.003734895
# Should return:
# Estimate z p
# -0.3 2.899726 0.003734895