E.1SI: Estimation of the Population Total under Single Stage Simple...

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

View source: R/E.1SI.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
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)

psirusteam/TeachingSampling documentation built on April 23, 2020, 8:31 p.m.