nPPS {PracTools} | R Documentation |
Calculate the sample size for a probability proportional to size (PPS) sample
Description
Calculate the sample size for a probability proportional to size (PPS) sample, assuming the sample is selected with replacement.
Usage
nPPS(X = NULL, Y = NULL, CV0 = NULL, V0 = NULL, N = NULL, V1 = NULL, ybarU = NULL)
Arguments
X |
variable used for computing 1-draw probabilities; length is |
Y |
variable used for variance calculation; length is |
CV0 |
target value of the coefficient of variation of the estimated total of |
V0 |
target value of the variance of the estimated total of |
N |
population size; required if |
V1 |
unit variance for PPS calculation |
ybarU |
population mean of |
Details
nPPS
computes the sample size needed for a probability proportional to size sample or, more generally, a sample selected with varying probabilities, assuming the sample is selected with replacement (WR). Although these samples are rarely selected WR, the variance formula for WR samples is simple and convenient for sample size calculations. Population vectors can be input of X
, a measure of size for selecting the sample, and Y
, an analysis variable. Alternatively, the population size, N
, the unit variance, V1
, and the population mean of Y
, ybarU
can be inputs.
Value
A list with four components:
N |
Size of the population |
V1 |
Population variance of |
ybarU |
Population mean of |
n |
Calculated sample size |
Author(s)
George Zipf, Richard Valliant
References
Valliant, R., Dever, J., Kreuter, F. (2018, chap. 3). Practical Tools for Designing and Weighting Survey Samples, 2nd edition. New York: Springer.
See Also
nCont
, nContMoe
, nContOpt
, unitVar
Examples
library(PracTools)
data("smho.N874")
y <- smho.N874[,"EXPTOTAL"]
x <- smho.N874[, "BEDS"]
y <- y[x>0]
x <- x[x>0]
nPPS(X = x, Y = y, CV0 = 0.15)
nPPS(X = x, Y = y, V0 = 2000000^2)
nPPS(CV0 = 0.15, N = length(y), V1 = (10^21), ybarU = mean(y))