| sae-class {hbsae} | R 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
saeobject x. Alternatively, withtype"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
saeobject x. Alternatively, withtype"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)coefmethod forsaeobjects; returns vector of fixed effects.vcov(x)vcovmethod forsaeobjects; returns covariance matrix for fixed effects.raneff(x, pop)return vector of random effects. If
pop=TRUEreturns 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)residualsmethod forsaeobjects; returns a vector of residuals.fitted(x)fittedmethod forsaeobjects; 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=TRUEreturns 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,relErrVrelative 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