sae-class: S3 class for the fitted model and SAE outcomes.

sae-classR Documentation

S3 class for the fitted model and SAE outcomes.

Description

Functions fSAE, fSurvReg, fSAE.Area and fSAE.Unit return an object of class sae. It contains information on the model fit as well as the small area estimates, error estimates and a few model selection measures. The functions listed below extract the main components from an object of class sae.

EST(x, type="sae", tot=FALSE)

return the vector of small area estimates of sae object x. Alternatively, with type "coef" or "raneff" fixed or random effect estimates are returned. If 'tot=TRUE' and 'type="sae"' estimates for area population totals instead of means are returned.

MSE(x, type="sae", tot=FALSE)

return the vector of mean squared errors of sae object x. Alternatively, with type "coef" or "raneff" MSEs of fixed or random effects are returned. If 'tot=TRUE' and 'type="sae"' MSEs for area population totals instead of means are returned.

SE(x, type="sae", tot=FALSE)

extract standard errors, i.e. square roots of MSEs.

RMSE(x, type="sae", tot=FALSE)

alias for SE(x, type="sae", tot=FALSE)

relSE(x, type="sae")

extract relative standard errors.

COV(x)

extract the covariance matrix for the small area estimates.

COR(x)

extract the correlation matrix for the small area estimates.

coef(x)

coef method for sae objects; returns vector of fixed effects.

vcov(x)

vcov method for sae objects; returns covariance matrix for fixed effects.

raneff(x, pop)

return vector of random effects. If pop=TRUE returns a vector for predicted areas (zero for out-of-sample areas), otherwise a vector for in-sample areas.

raneff.se(x, pop)

return vector of standard errors for random effects.

residuals(x)

residuals method for sae objects; returns a vector of residuals.

fitted(x)

fitted method for sae objects; returns a vector of fitted values.

se2(x)

extracts within-area variance estimate.

sv2(x)

extracts between-area variance estimate.

wDirect(x, pop)

extract vector of weights of the survey regression components in the small area estimates. If pop=TRUE returns a vector for predicted areas (zero for out-of-sample areas), otherwise a vector for in-sample areas.

synthetic(x)

extract vector of synthetic estimates.

CV(x)

extract leave-one-out cross-validation measure.

cAIC(x)

extract conditional AIC measure.

R2(x)

extract unit-level R-squared goodness-of-fit measure.

Other components include

relErrM,relErrV

relative numerical integration errors in estimates and MSEs, for method "HB".

Examples

d <- generateFakeData()

# compute small area estimates
sae <- fSAE(y0 ~ x + area2, data=d$sam, area="area", popdata=d$Xpop)

coef(sae)  # fixed effects
raneff(sae)  # random effects
sv2(sae)  # between-area variance
se2(sae)  # within-area variance
cAIC(sae)  # conditional AIC

hbsae documentation built on March 18, 2022, 6:34 p.m.