pbmseBHF: Parametric bootstrap mean squared error estimators of the...

Description Usage Arguments Details Value References See Also Examples

View source: R/pbmseBHF.R

Description

Calculates, for selected domains, parametric bootstrap mean squared error estimators of the EBLUPs of means, when EBLUPs are obtained from a nested error linear regression model.

Usage

1
2
pbmseBHF(formula, dom, selectdom, meanxpop, popnsize, B = 200, method = "REML", 
         data)

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 means. It must be a subset of the domain codes in dom. If this parameter is not included all the domain codes included in dom are considered.

meanxpop

D*(p+1) data frame with domain codes in the first column. Each remaining column contains the population means of each of the p auxiliary variables for the D domains. The domains considered in meanxpop must contain those specified in selectdom (D>=I).

popnsize

D*2 data frame with domain codes in the first column and the corresponding domain population sizes in the second column. The domains considered in popnsize must contain those specified in selectdom (D>=I).

B

number of bootstrap replicates. Default is 50.

method

a character string. If "REML" the model is fitted by maximizing the restricted log-likelihood. If "ML" the log-likelihood is maximized. Defaults to "REML".

data

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

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 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: eblup and fit. For the description of these objects, see Value of eblupBHF 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 estimators (mse).

Cases with NA values in formula or dom are ignored.

References

- Gonzalez-Manteiga, W., Lombardia, M., Molina, I., Morales, D. and Santamaria, L. (2008). Analytic and bootstrap approximations of prediction errors under a multivariate Fay-Herriot model. Computational Statistics and Data Analysis 52, 5242-5252.

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

See Also

eblupBHF

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# Load data set for segments (units within domains)
data(cornsoybean)

# Load data set for counties
data(cornsoybeanmeans)
attach(cornsoybeanmeans)

# Construct data frame with county means of auxiliary variables for 
# domains. First column must include the county code
Xmean <- data.frame(CountyIndex, MeanCornPixPerSeg, MeanSoyBeansPixPerSeg)
Popn  <- data.frame(CountyIndex, PopnSegments)

# Compute parametric bootstrap MSEs of the EBLUPs of means of crop areas 
# for each county.
set.seed(123) 
result <- pbmseBHF(CornHec ~ CornPix + SoyBeansPix, dom=County,
                   selectdom=c(10,1,5), meanxpop=Xmean, popnsize=Popn,
                   B=50, data=cornsoybean)
result

detach(cornsoybeanmeans)

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