submean: Sub-sample Mean Estimation

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/submean.R

Description

The function submean estimates the population mean out of sub-samples (two-stage samples) either with or without consideration of finite population correction in both stages.

Usage

1
submean(y, PSU, N, M, Nl, m.weight, n.weight, method = 'simple', level = 0.95)

Arguments

y

vector of target variable.

PSU

vector of grouping variable which indicates the primary unit for each sample element.

N

positive integer specifying population size

M

positive integer specifying the number of primary units in the population.

Nl

vector of sample sizes in each primary unit, which has to be specified in alphabetical or numerical order of the categories of l.

m.weight

vector of primary sample unit weights, which has to be specified in alphabetical or numerical order of the categories of l.

n.weight

vector of secondary sample unit weights in each primary sample unit, which has to be specified in alphabetical or numerical order of the categories of l.

method

estimation method. Default is "simple", alternative is "ratio".

level

coverage probability for confidence intervals. Default is level=0.95.

Details

If the absolute sizes M and Nl are given, the variances are calculated with finite population correction. Otherwise, if the weights m.weight and n.weight are given, the variances are calculated without finite population correction.

Value

The function submean returns a value, which is a list consisting of the components

call

is a list of call components: y target variable in sample data, PSU gouping variable in sample data, N population size, M number of primary population units, fpc finite population correction, method estimation method, level coverage probability for confidence intervals

mean

mean estimate for population

se

standard error of the mean estimate for population

ci

vector of confidence interval boundaries for population

Author(s)

Shuai Shao and Juliane Manitz

References

Kauermann, Goeran/Kuechenhoff, Helmut (2011): Stichproben. Methoden und praktische Umsetzung mit R. Springer.

See Also

Smean, stratamean

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
y <- c(23,33,24,25,72,74,71,37,42)
psu <- as.factor(c(1,1,1,1,2,2,2,3,3))
# with finite population correction
submean(y, PSU=psu, N=700, M=23, Nl=c(100,50,75), method='ratio')
# without finite population correction
submean(y, PSU=psu, N=700, m.weight=3/23, n.weight=c(4/100,3/50,2/75), method='ratio')

# Chinese wage data
data(wage)
summary(wage)
submean(wage$Wage,PSU=wage$Region, N=990, M=33, Nl=rep(30,14))

jmanitz/samplingbook documentation built on April 10, 2021, 4:44 p.m.