E.STSI: Estimation of the Population Total under Stratified Simple...

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

View source: R/E.STSI.r

Description

Computes the Horvitz-Thompson estimator of the population total according to a STSI sampling design

Usage

1
E.STSI(S, Nh, nh, y)

Arguments

S

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

Nh

Vector of stratum sizes

nh

Vector of sample sizes in each stratum

y

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

Details

Returns the estimation of the population total of every single variable of interest, its estimated standard error and its estimated coefficient of variation in all of the strata and finally in the entire population

Value

The function returns an array composed by several matrices representing each variable of interest. The columns of each matrix correspond to the estimated parameters of the variables of interest in each stratum and in the entire population

Author(s)

Hugo Andres Gutierrez Rojas hagutierrezro@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

S.STSI

Examples

 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
############
## Example 1
############
# Uses the Lucy data to draw a stratified random sample 
# according to a SI design in each stratum

data(Lucy)
attach(Lucy)
# Level is the stratifying variable
summary(Level)
# Defines the size of each stratum
N1<-summary(Level)[[1]]
N2<-summary(Level)[[2]]
N3<-summary(Level)[[3]]
N1;N2;N3
Nh <- c(N1,N2,N3)
# Defines the sample size at each stratum
n1<-N1
n2<-100
n3<-200
nh<-c(n1,n2,n3)
# Draws a stratified sample
sam <- S.STSI(Level, Nh, nh)
# 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.STSI(Level,Nh,nh,estima)

############
## Example 2
############
# 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
SPAM.no <- estima*Doma[,1]
SPAM.yes <- estima*Doma[,2]
E.STSI(Level, Nh, nh, Doma)
E.STSI(Level, Nh, nh, SPAM.no)
E.STSI(Level, Nh, nh, SPAM.yes)

Example output

   Big Medium  Small 
    83    737   1576 
[1] 83
[1] 737
[1] 1576
The following objects are masked from Lucy:

    Employees, ID, Income, Level, SPAM, Taxes, Ubication, Zone

[1] "ID"        "Ubication" "Level"     "Zone"      "Income"    "Employees"
[7] "Taxes"     "SPAM"     
, , N

               Big Medium Small Population
Estimation      83    737  1576       2396
Standard Error   0      0     0          0
CVE              0      0     0          0
DEFF           NaN    NaN   NaN        NaN

, , Income

                  Big       Medium        Small   Population
Estimation     103706 4.819611e+05 4.340540e+05 1.019721e+06
Standard Error      0 8.417831e+03 1.272482e+04 1.525716e+04
CVE                 0 1.746579e+00 2.931622e+00 1.496209e+00
DEFF              NaN 1.000000e+00 1.000000e+00 1.069284e-01

, , Employees

                 Big       Medium        Small   Population
Estimation     11461 61347.880000 80998.520000 1.538074e+05
Standard Error     0  1658.872647  2712.824459 3.179823e+03
CVE                0     2.704042     3.349227 2.067406e+00
DEFF             NaN     1.000000     1.000000 3.949300e-01

, , Taxes

                Big     Medium       Small   Population
Estimation     6251 15889.7200 5839.080000 2.797980e+04
Standard Error    0   607.9724  329.210403 6.913827e+02
CVE               0     3.8262    5.638053 2.471006e+00
DEFF            NaN     1.0000    1.000000 3.291117e-02

, , N

               Big Medium Small Population
Estimation      83    737  1576       2396
Standard Error   0      0     0          0
CVE              0      0     0          0
DEFF           NaN    NaN   NaN        NaN

, , no

               Big    Medium      Small  Population
Estimation      26 309.54000 669.800000 1005.340000
Standard Error   0  33.98791  51.604690   61.791766
CVE              0  10.98014   7.704492    6.146355
DEFF           NaN   1.00000   1.000000    1.260585

, , yes

               Big     Medium      Small  Population
Estimation      57 427.460000 906.200000 1390.660000
Standard Error   0  33.987914  51.604690   61.791766
CVE              0   7.951133   5.694625    4.443341
DEFF           NaN   1.000000   1.000000    1.260585

, , N

               Big Medium Small Population
Estimation      83    737  1576       2396
Standard Error   0      0     0          0
CVE              0      0     0          0
DEFF           NaN    NaN   NaN        NaN

, , Income

                 Big       Medium        Small   Population
Estimation     31914 202704.48000 1.776861e+05 4.123046e+05
Standard Error     0  22818.54867 1.603565e+04 2.788957e+04
CVE                0     11.25705 9.024707e+00 6.764313e+00
DEFF             NaN      1.00000 1.000000e+00 4.881024e-01

, , Employees

                Big      Medium        Small   Population
Estimation     3587 27556.43000 32111.000000 6.325443e+04
Standard Error    0  3220.03354  3045.938095 4.432421e+03
CVE               0    11.68523     9.485653 7.007289e+00
DEFF            NaN     1.00000     1.000000 7.433862e-01

, , Taxes

                Big     Medium      Small   Population
Estimation     1844 6669.85000 2320.66000 10834.510000
Standard Error    0  816.09904  279.14432   862.519103
CVE               0   12.23564   12.02866     7.960850
DEFF            NaN    1.00000    1.00000     0.154529

, , N

               Big Medium Small Population
Estimation      83    737  1576       2396
Standard Error   0      0     0          0
CVE              0      0     0          0
DEFF           NaN    NaN   NaN        NaN

, , Income

                 Big       Medium        Small   Population
Estimation     71792 279256.67000 256367.92000 6.074166e+05
Standard Error     0  23207.23582  17449.91309 2.903576e+04
CVE                0      8.31036      6.80659 4.780205e+00
DEFF             NaN      1.00000      1.00000 3.254941e-01

, , Employees

                Big       Medium        Small   Population
Estimation     7874 33791.450000 48887.520000 90552.970000
Standard Error    0  2939.786282  3443.349776  4527.582253
CVE               0     8.699793     7.043413     4.999927
DEFF            NaN     1.000000     1.000000     0.572543

, , Taxes

                Big      Medium       Small   Population
Estimation     4407 9219.870000 3518.420000 1.714529e+04
Standard Error    0  881.688040  319.538714 9.378053e+02
CVE               0    9.562912    9.081881 5.469755e+00
DEFF            NaN    1.000000    1.000000 6.813259e-02

TeachingSampling documentation built on April 22, 2020, 1:05 a.m.