E.1SI {TeachingSampling}R Documentation

Estimation of the Population Total under Single Stage Simple Random Sampling Without Replacement

Description

This function computes the Horvitz-Thompson estimator of the population total according to a single stage sampling design.

Usage

E.1SI(NI, nI, y, PSU)

Arguments

NI

Population size of Primary Sampling Units.

nI

Sample size of Primary Sampling Units.

y

Vector, matrix or data frame containig the recollected information of the variables of interest for every unit in the selected sample.

PSU

Vector identifying the membership to the strata of each unit in the population.

Details

The function returns a data matrix whose columns correspond to the estimated parameters of the variables of interest.

Value

This function returns the estimation of the population total of every single variable of interest, its estimated standard error and its estimated coefficient of variation.

Author(s)

Hugo Andres Gutierrez Rojas <hugogutierrez at gmail.com>

References

Sarndal, C-E. and Swensson, B. and Wretman, J. (1992), Model Assisted Survey Sampling. Springer.
Gutierrez, H. A. (2009), Estrategias de muestreo: Diseno de encuestas y estimacion de parametros. Editorial Universidad Santo Tomas

See Also

E.2SI

Examples


data('BigCity')
Households <- BigCity %>% group_by(HHID) %>%
summarise(Stratum = unique(Stratum),
            PSU = unique(PSU),
            Persons = n(),
            Income = sum(Income),
            Expenditure = sum(Expenditure))
            
attach(Households)
UI <- levels(as.factor(Households$PSU))
NI <- length(UI)
nI <- 100 

samI <- S.SI(NI, nI)
sampleI <- UI[samI]

CityI <- Households[which(Households$PSU %in% sampleI), ]
attach(CityI)
area <- as.factor(CityI$PSU)
estima <- data.frame(CityI$Persons, CityI$Income, CityI$Expenditure)

E.1SI(NI, nI, estima, area)

[Package TeachingSampling version 4.1.1 Index]