saemodel {rsae} | R Documentation |
Setting Up a SAE Model
Description
Function saemodel()
is used to specify a model. Once a model
has been specified, it can be fitted using
fitsaemodel()
by different estimation methods.
Usage
saemodel(formula, area, data, type = "b", na.omit = FALSE)
## S3 method for class 'saemodel'
print(x, ...)
## S3 method for class 'saemodel'
summary(object, ...)
## S3 method for class 'saemodel'
as.matrix(x, ...)
Arguments
formula |
a |
area |
a one-sided |
data |
data.frame. |
type |
|
na.omit |
|
x |
an object of class |
object |
an object of the class |
... |
additional arguments (not used). |
Details
Function saemodel()
is used to specify a model.
-
model
is a symbolic description (formula
of the fixed-effects model to be fitted.A typical model has the form
response ~ terms
whereresponse
is the (numeric) response vector andterms
is a series of terms which specifies a linear predictor for response (explanatory variables); seeformula
.A
formula
has an implied intercept term. To remove this use eithery ~ x - 1
ory ~ 0 + x
; seeformula
for more details of allowed formulae. -
area
is a symbolic description (formula
) of the random effects (nested error structure). It must be right-hand side only formula consisting of one term, e.g.,~ areaDefinition
.
The data must no contain missing values.
The design matrix (i.e., matrix of the explanatory variables
defined the right-hand side of model
) must have full column
rank; otherwise execution is terminated by an error.
Once a model has been specified, it can be fitted by
fitsaemodel()
.
Value
An instance of the S3 class "saemodel"
References
Rao, J.N.K. (2003). Small Area Estimation, New York: John Wiley and Sons.
See Also
Examples
# use the landsat data
head(landsat)
# set up the model
model <- saemodel(formula = HACorn ~ PixelsCorn + PixelsSoybeans,
area = ~CountyName,
data = subset(landsat, subset = (outlier == FALSE)))
# summar of the model
summary(model)