pbmseebBHF: Parametric bootstrap mean squared error estimators of EB...

Description Usage Arguments Details Value References See Also Examples

View source: R/pbmseebBHF.R

Description

This function obtains estimators of the mean squared errors of the EB estimators of domain parameters by a parametric bootstrap method. Population values of auxiliary variables are required.

Usage

1
2
pbmseebBHF(formula, dom, selectdom, Xnonsample, B = 100, MC = 100, data, 
           transform = "BoxCox", lambda = 0, constant = 0, indicator)

Arguments

formula

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.

dom

n*1 vector or factor (same size as y in formula) with domain codes.

selectdom

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.

Xnonsample

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.

B

number of bootstrap replicates. Default value is 100.

MC

number of Monte Carlo replicates for the empirical approximation of the EB estimator. Default value is 100.

data

optional data frame containing the variables named in formula and dom. By default the variables are taken from the environment from which pbmseebBHF is called.

transform

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".

lambda

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

constant added to the dependent variable before doing the transformation, to achieve a distribution close to Normal. Default value is 0.

indicator

function of the (untransformed) variable on the left hand side of formula that we want to estimate in each domain.

Details

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 terms specification of the form first + second indicates all the terms in first together with all the terms in second with any 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.

Value

The function returns a list with the following objects:

est

a list with the results of the estimation process: eb and fit. For the description of these objects, see Value of ebBHF function.

mse

data frame with number of rows equal to number of selected domains, containing in its columns the domain codes (domain) and the parametric bootstrap mean squared error estimates of indicator (mse).

Cases with NA values in formula or dom are ignored.

References

- Small Area Methods for Poverty and Living Conditions Estimates (SAMPLE), funded by European Commission, Collaborative Project 217565, Call identifier FP7-SSH-2007-1.

- Molina, I. and Rao, J.N.K. (2010). Small Area Estimation of Poverty Indicators. The Canadian Journal of Statistics 38, 369-385.

See Also

ebBHF

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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 <- c(5)

# Poverty incidence indicator
povertyline <- 0.6*median(incomedata$income)
povertyline                         # 6477.484
povinc <- function(y)    
{
   z <- 6477.484
   result <- mean(y<z)
   return (result)
}

# Compute parametric bootstrap MSE estimators of the EB 
# predictors of poverty incidence. Take constant=3600 to achieve 
# approximately symmetric residuals.
set.seed(123)
result <- pbmseebBHF(income~Xs, dom=prov, selectdom=domains,
                     Xnonsample=Xoutsamp, B=2, MC=2, constant=3600,
                     indicator=povinc)
result$est$eb
result$mse
result$est$fit$refvar

detach(incomedata)

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