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 formula object of describing the fixed-effects part of the model, with the response on the RHS of the ~ operator and the terms or regressors, separated by + operators, on the LHS of the formula.

area

a one-sided formula object. A ~ operator followed by only one single term defining the area-specific random-effect part.

data

data.frame.

type

[character] "a" or "b" refering to J.N.K. Rao's definition of model type A (area-level model) or B (unit-level model); default is "b".

na.omit

[logical] indicating whether NA values should be removed before the computation proceeds. Note that none of the algorithms can cope with missing values.

x

an object of class "saemodel".

object

an object of the class "saemodel".

...

additional arguments (not used).

Details

Function saemodel() is used to specify a model.

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

makedata(), fitsaemodel()

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)

[Package rsae version 0.3 Index]