Post-stratified synthetic estimators of domain means.
Post-stratified synthetic estimators of domain means.
Calculates post-stratified synthetic estimators of domain means using the categories of a cualitative variable as post-strata.
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.
Returns
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
# Compute post-stratified synthetic estimators of mean income # for provinces considering the education levels codes # (variable educ) as post-strata.# Load data setdata(incomedata)# Load province sizes by education levelsdata(sizeprovedu)# Compute post-stratified synthetic estimators with province labels # as domain codescolnames(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 codescolnames(sizeprovedu)<- c("provlab","prov","0","1","2","3")result2 <- pssynt(y=income, sweight=weight, ps=educ, domsizebyps=sizeprovedu[,-1], data=incomedata)result2