Learn R Programming

statpsych (version 2.0.0)

test.prop2: Hypothesis test for a 2-group proportion difference

Description

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).

For more details, see Section 2.4 of Bonett (2021, Volume 3)

Usage

test.prop2(f1, f2, n1, n2)

Value

Returns a 1-row matrix. The columns are:

  • Estimate - ML estimate of proportion difference

  • z - z test statistic

  • p - two-sided p-value

Arguments

f1

number of group 1 participants who have the attribute

f2

number of group 2 participants who have the attribute

n1

sample size for group 1

n2

sample size for group 2

References

Snedecor1980statpsych

Bonett2021statpsych

Examples

Run this code
test.prop2(39, 24, 50, 50)

# Should return:
# Estimate      z       p
#      0.3 2.8997 0.00373


Run the code above in your browser using DataLab