eblupBHF {sae} | R Documentation |
EBLUPs of domain means based on a nested error linear regression model.
Description
This function calculates, for selected domains, EBLUPs of domain means based on the nested error linear regression model of Battese, Harter and Fuller (1988).
Usage
eblupBHF(formula, dom, selectdom, meanxpop, popnsize, method = "REML", data)
Arguments
formula |
an object of class |
dom |
|
selectdom |
|
meanxpop |
|
popnsize |
|
method |
a character string. If |
data |
optional data frame containing the variables named in |
Details
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:
eblup |
data frame with number of rows equal to number of selected domains ( |
fit |
a list containing the following objects:
|
Cases with NA values in formula
or dom
are ignored.
References
- Battese, G.E., Harter, R.M. and Fuller, W.A. (1988). An Error-Components Model for Prediction of County Crop Areas Using Survey and Satellite Data, Journal of the American Statistical Association 83, 28-36.
- Rao, J.N.K. (2003). Small Area Estimation. New York: John Wiley and Sons.
See Also
Examples
# 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 EBLUPs of county means of corn crop areas for all counties
resultCorn <- eblupBHF(CornHec ~ CornPix + SoyBeansPix, dom=County,
meanxpop=Xmean, popnsize=Popn, data=cornsoybean)
resultCorn$eblup
# Compute EBLUPs of county means of soy beans crop areas for
# a subset of counties using ML method
domains <- c(10,1,5)
resultBean <- eblupBHF(SoyBeansHec ~ CornPix + SoyBeansPix, dom=County,
selectdom=domains, meanxpop=Xmean, popnsize=Popn,
method="ML", data=cornsoybean)
resultBean$eblup
resultBean$fit
detach(cornsoybeanmeans)