ebLBH: EB estimator of area means and associated MSE estimator

Description Usage Arguments Details Value See Also Examples

View source: R/ebLBH.r

Description

Obtains numerical approximations of EB estimators of area means under the unit level model of Lyu, Berg and Hofmann when the values of auxiliary variables for population units and the model parameter estimates are available.

Usage

1
ebLBH(Xaux, f_q = ~1, data_2p, fit, fullpop = FALSE)

Arguments

Xaux

matrix or data frame containing covariates, the area code and the variables named in f_q for population units.

f_q

an object of class formula: a symbolic description of the number of population units with the same covariates. Default value is ~1.

data_2p

a two-part data object returned by as.2pdata.

fit

a list of model parameter estimates containing at least fixed effects coefficients and variance components (named as the return value of mleLBH).

fullpop

a boolean variable indicating whether Xaux contains covariates information for the full population (TRUE) or just the out-of-sample units (FALSE). Default value is FALSE. The details of this indicator are given under Details.

Details

When Xaux contains only the covariates of the out-of-sample units (fullpop = FALSE), observed response is used for the sampled units when calculating the EB estimator. When Xaux contains the covariates of the full population (fullpop = TRUE), unit-level EB prediction is used for the sampled units. This is reasonable when the sampling fraction is extremely small in each area (e.g., Battese, Harter and Fuller (1988)).

Value

A data frame with the number of rows equal to the number of unique areas in Xaux:

See Also

as.2pdata, mleLBH

Examples

1
2
3
4
5
  erosion_2p <- as.2pdata(f_pos = RUSLE2~logR+logK+logS,
                          f_zero = ~logR+logS+crop2+crop3,
                          f_area = ~cty, data = erosion)
  fit <- mleLBH(erosion_2p)
  predictions <- ebLBH(Xaux, f_q = ~cnt, erosion_2p, fit, fullpop = TRUE)

XiaodanLyu/saezero documentation built on Sept. 20, 2020, 5:59 a.m.