Fits by REML method the unit level model of Battese, Harter and Fuller (1988) to a transformation of the specified dependent variable by a Box-Cox family or power family and obtains Monte Carlo approximations of EB estimators of the specified small area indicators, when the values of auxiliary variables for out-of-sample units are available.
ebBHF(formula, dom, selectdom, Xnonsample, MC = 100, data,
transform = "BoxCox", lambda = 0, constant = 0, indicator)The function returns a list with the following objects:
data frame with number of rows equal to number of selected domains,
containing in its columns the domain codes (domain), the EB
estimators of indicator (eb) and the sample sizes (sampsize).
For domains with zero sample size, the EB estimators are based on the synthetic regression. For domains in selectdom not included in Xnonsample the EB estimators are NA.
a list containing the following objects:
summarysummary of the unit level model fitting.
fixedvector with the estimated values of the fixed regression coefficient.
randomvector with the predicted random effects.
errorvarestimated model error variance.
refvarestimated random effects variance.
loglikelog-likelihood.
residualsvector with raw residuals from the model fit.
Cases with NA values in formula or dom are ignored.
an object of class formula (or one that can be coerced to that class):
a symbolic description of the model to be fitted. The details of model
specification are given under Details.
n*1 vector or factor (same size as y in formula) with domain codes.
I*1 optional vector or factor with the domain codes for which we
want to estimate the indicators. It must be a subset of the domain codes in dom.
If this parameter is not included, the unique domain codes included in dom
are considered.
matrix or data frame containing in the first column the domain codes and in the rest of columns the values of each of p auxiliary variables for the out-of-sample units in each selected domain. The domains considered in Xnonsample must contain at least those specified in selectdom.
number of Monte Carlo replicates for the empirical approximation of the EB estimator. Default value is MC=100.
optional data frame containing the variables named in formula and dom. By default the variables are taken from the environment from which ebBHF is called.
type of transformation for the dependent variable to be chosen between the "BoxCox" and "power" families so that the dependent variable in formula follows approximately a Normal distribution. Default value is "BoxCox".
value for the parameter of the family of transformations specified in transform. Default value is 0, which gives the log transformation for the two possible families.
constant added to the dependent variable before doing the transformation, to achieve a distribution close to Normal. Default value is 0.
function of the (untransformed) variable on the left hand side of formula that we want to estimate in each domain.
This function uses random number generation. To fix the seed, use set.seed.
A typical model has the form response ~ terms where response is the (numeric) response vector and terms is a series of terms which specifies a linear predictor for response. A terms specification of the form first + second indicates all the terms in first together with all the terms in second with duplicates removed.
A formula has an implied intercept term. To remove this use either y ~ x - 1 or y ~ 0 + x. See formula
for more details of allowed formulae.
- Molina, I. and Rao, J.N.K. (2010). Small Area Estimation of Poverty Indicators. The Canadian Journal of Statistics 38, 369-385.
pbmseebBHF
data(incomedata) # Load data set
attach(incomedata)
# Construct design matrix for sample elements
Xs <- cbind(age2, age3, age4, age5, nat1, educ1, educ3, labor1, labor2)
# Select the domains to compute EB estimators.
data(Xoutsamp)
domains <- unique(Xoutsamp[,"domain"])
# Poverty gap indicator
povertyline <- 0.6*median(income)
povertyline # 6477.484
povgap <- function(y)
{
z <- 6477.484
result <- mean((yRun the code above in your browser using DataLab