pssynt: Post-stratified synthetic estimators of domain means.

Description Usage Arguments Value References See Also Examples

View source: R/pssynt.R

Description

Calculates post-stratified synthetic estimators of domain means using the categories of a cualitative variable as post-strata.

Usage

1
pssynt(y, sweight, ps, domsizebyps, data)

Arguments

y

vector specifying the individual values of the variable for which we want to estimate the domain means.

sweight

vector (same size as y) with the sampling weights of the units.

ps

vector (same size as y) of factor with post-strata codes.

domsizebyps

data frame with domain codes in the first column. Each remaining column contains the domain population sizes for each post-strata. Names of these columns must be the post-strata identifiers specified in ps.

data

optional data frame containing the variables named in y, sweight and ps. By default the variables are taken from the environment from which pssynt is called.

Value

The function returns a data frame of size D*2 with the following columns:

Domain

domain codes in ascending order.

PsSynthetic

post-stratified synthetic estimators of domain means of variable y.

Cases with NA values in y, sweight or ps are ignored.

References

- Rao, J.N.K. (2003). "Small Area Estimation". Wiley, London.

See Also

direct, ssd

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Compute post-stratified synthetic estimators of mean income 
# for provinces considering the education levels codes 
# (variable educ) as post-strata.

# Load data set
data(incomedata)   

# Load province sizes by education levels
data(sizeprovedu)

# Compute post-stratified synthetic estimators with province labels 
# as domain codes
colnames(sizeprovedu) <- c("provlab", "prov", "0", "1", "2", "3")
result1 <- pssynt(y=income, sweight=weight, ps=educ,
                  domsizebyps=sizeprovedu[,-2], data=incomedata)
result1

# Now with province codes as domain codes
colnames(sizeprovedu) <- c("provlab", "prov", "0", "1", "2", "3")
result2 <- pssynt(y=income, sweight=weight, ps=educ,
                  domsizebyps=sizeprovedu[,-1], data=incomedata)
result2

sae documentation built on March 26, 2020, 7:52 p.m.