Learn R Programming

statpsych (version 1.7.0)

size.test.prop.ps: Sample size for a test of a paired-samples proportion difference

Description

Computes the sample size required to test a difference in population proportions with desired power in a paired-samples design. This function requires planning values for both proportions and a phi coefficient that describes the correlation between the two dichotomous measurements. The proportion planning values can be set to .5 for a conservatively large sample size. The planning value for the effect size (proportion difference) could be set equal to the difference of the two proportion planning values or it could be set equal to a minimally interesting effect size. Set the phi correlation planning value to the smallest value within a plausible range for a conservatively large sample size.

Usage

size.test.prop.ps(alpha, pow, p1, p2, phi, es)

Value

Returns the required sample size

Arguments

alpha

alpha level for hypothesis test

pow

desired power

p1

planning value of proportion for measurement 1

p2

planning value of proportion for measurement 2

phi

planning value of phi correlation

es

planning value of proportion difference

Examples

Run this code
size.test.prop.ps(.05, .80, .4, .3, .5, .1)

# Should return:
# Sample size
#         177


Run the code above in your browser using DataLab