pssynt {sae} | R Documentation |
Post-stratified synthetic estimators of domain means.
Description
Calculates post-stratified synthetic estimators of domain means using the categories of a cualitative variable as post-strata.
Usage
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 |
ps |
vector (same size as |
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 |
data |
optional data frame containing the variables named in |
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 |
Cases with NA values in y
, sweight
or ps
are ignored.
References
- Rao, J.N.K. (2003). "Small Area Estimation". Wiley, London.
See Also
Examples
# 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