samplingbook (version 1.2.2)

Smean: Sampling Mean Estimation

Description

The function Smean estimates the population mean out of simple samples either with or without consideration of finite population correction.

Usage

Smean(y, N = Inf, level = 0.95)

Arguments

y

vector of sample data

N

positive integer specifying population size. Default is N=Inf, which means that calculations are carried out without finite population correction.

level

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

Value

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

call

is a list of call components: y vector with sample data, n sample size, N population size, level coverage probability for confidence intervals

mean

mean estimate

se

standard error of the mean estimate

ci

vector of confidence interval boundaries

References

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

See Also

Sprop, sample.size.mean

Examples

Run this code
# NOT RUN {
data(pop)
Y <- pop$Y
Y
# Draw a random sample of size=3
set.seed(93456)
y <- sample(x = Y, size = 3)
sort(y)
# Estimation with infiniteness correction
est <- Smean(y = y, N = length(pop$Y))
est
# }

Run the code above in your browser using DataLab