Description Usage Arguments Details Value Author(s) References See Also Examples
Computes the Horvitz-Thompson estimator of the population total according to an SI sampling design
1 | E.SI(N, n, y)
|
N |
Population size |
n |
Sample size |
y |
Vector, matrix or data frame containing the recollected information of the variables of interest for every unit in the selected sample |
Returns the estimation of the population total of every single variable of interest, its estimated standard error and its estimated coefficient of variation under an SI sampling design
The function returns a data matrix whose columns correspond to the estimated parameters of the variables of interest
Hugo Andres Gutierrez Rojas hagutierrezro@gmail.com
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | ############
## Example 1
############
# Uses the Lucy data to draw a random sample of units according to a SI design
data(Lucy)
attach(Lucy)
N <- dim(Lucy)[1]
n <- 400
sam <- S.SI(N,n)
# The information about the units in the sample is stored in an object called data
data <- Lucy[sam,]
attach(data)
names(data)
# The variables of interest are: Income, Employees and Taxes
# This information is stored in a data frame called estima
estima <- data.frame(Income, Employees, Taxes)
E.SI(N,n,estima)
############
## Example 2
############
# Following with Example 1. The variable SPAM is a domain of interest
Doma <- Domains(SPAM)
# This function allows to estimate the size of each domain in SPAM
estima <- data.frame(Doma)
E.SI(N,n,Doma)
############
## Example 3
############
# Following with Example 1. The variable SPAM is a domain of interest
Doma <- Domains(SPAM)
# This function allows to estimate the parameters of the variables of interest
# for every category in the domain SPAM
estima <- data.frame(Income, Employees, Taxes)
SPAM.no <- cbind(Doma[,1], estima*Doma[,1])
SPAM.yes <- cbind(Doma[,1], estima*Doma[,2])
# Before running the following lines, notice that:
# The first column always indicates the population size
# The second column is an estimate of the size of the category in the domain SPAM
# The remaining columns estimates the parameters of interest
# within the corresponding category in the domain SPAM
E.SI(N,n,SPAM.no)
E.SI(N,n,SPAM.yes)
############
## Example 4
############
# Following with Example 1. The variable SPAM is a domain of interest
# and the variable ISO is a populational subgroup of interest
Doma <- Domains(SPAM)
estima <- Domains(Zone)
# Before running the following lines, notice that:
# The first column indicates wheter the unit
# belongs to the first category of SPAM or not
# The remaining columns indicates wheter the unit
# belogns to the categories of Zone
SPAM.no <- data.frame(SpamNO=Doma[,1], Zones=estima*Doma[,1])
# Before running the following lines, notice that:
# The first column indicates wheter the unit
# belongs to the second category of SPAM or not
# The remaining columns indicates wheter the unit
# belogns to the categories of Zone
SPAM.yes <- data.frame(SpamYES=Doma[,2], Zones=estima*Doma[,2])
# Before running the following lines, notice that:
# The first column always indicates the population size
# The second column is an estimate of the size of the
# first category in the domain SPAM
# The remaining columns estimates the size of the categories
# of Zone within the corresponding category of SPAM
# Finnaly, note that the sum of the point estimates of the last
# two columns gives exactly the point estimate in the second column
E.SI(N,n,SPAM.no)
# Before running the following lines, notice that:
# The first column always indicates the population size
# The second column is an estimate of the size of the
# second category in the domain SPAM
# The remaining columns estimates the size of the categories
# of Zone within the corresponding category of SPAM
# Finnaly, note that the sum of the point estimates of the last two
# columns gives exactly the point estimate in the second column
E.SI(N,n,SPAM.yes)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.