Description Usage Arguments Value References See Also Examples
Calculates post-stratified synthetic estimators of domain means using the categories of a cualitative variable as post-strata.
1 |
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 |
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.
- Rao, J.N.K. (2003). "Small Area Estimation". Wiley, London.
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.