nProp2sam: Simple random sample size for difference in proportions

View source: R/nProp2sam.R

nProp2samR Documentation

Simple random sample size for difference in proportions

Description

Compute a simple random sample size for estimating the difference in proportions when samples overlap

Usage

nProp2sam(px, py, pxy, g, r, alt, sig.level=0.05, pow=0.80)

Arguments

px

proportion in group 1

py

proportion in group 2

pxy

proportion in the overlap has the characteristic in both samples

g

proportion of sample 1 that is in the overlap with sample 2

r

ratio of the size of sample 1 to that of sample 2

alt

should the test be 1-sided or 2-sided; allowable values are alt="one.sided" or alt="two.sided".

sig.level

significance level of the hypothesis test

pow

desired power of the test

Details

nProp2sam computes sample sizes in two groups that are required for testing whether the difference in group proportions is significant. The power of the test is one of the input parameters. The samples have a specified proportion of units in common.

Value

List with values:

n1

sample size in group 1

n2

sample size in group 2

px.py.pxy

input values of the px, py, pxy parameters

gamma

proportion of sample 1 that is in the overlap with sample 2

r

ratio of the size of sample 1 to that of sample 2

alt

type of test: one-sided or two-sided

sig.level

significance level of test

power

power of the test

Author(s)

Richard Valliant, Jill A. Dever, Frauke Kreuter

References

Valliant, R., Dever, J., Kreuter, F. (2018, chap. 4). Practical Tools for Designing and Weighting Survey Samples, 2nd edition. New York: Springer.

Woodward, M. (1992). Formulas for Sample Size, Power, and Minimum Detectable Relative Risk in Medical Studies. The Statistician, 41, 185-196.

See Also

nDep2sam

Examples

nProp2sam(px=0.5, py=0.55, pxy=0.45, g=0.5, r=1, alt="two.sided")

PracTools documentation built on Nov. 9, 2023, 9:06 a.m.