getVarCov {saeTrafo}R Documentation

Extract variance-covariance matrix from an saeTrafo object

Description

Method getVarCov.NER extracts the variance-covariance matrix from a fitted model of class "NER".

Usage

## S3 method for class 'NER'
getVarCov(obj, individuals = 1, type = "random.effects", ...)

Arguments

obj

an object of type "NER".

individuals

vector of levels of the in-sample domains can be specified for the types "conditional" or "marginal".

type

a character that determines the type of variance-covariance matrix. Types that can be chosen (i) random-effects variance-covariance matrix ("random.effects"), (ii) conditional variance-covariance matrix ("conditional"), (iii) marginal variance-covariance matrix ("marginal"). Defaults to "random.effects".

...

additional arguments that are not used in this method.

Details

The generic function getVarCov is imported from package nlme and re-exported to make the S3-methods available, even though the nlme package itself is not loaded or attached. For default documentation, see getVarCov.

Value

A variance-covariance matrix or a list of variance-covariance matrices, if more than one individual is selected. For method getVarCov.NER, the dimensions of the matrices are 1 x 1 for type "random.effects" and number of in-sample domains x number of in-sample domains for types "conditional" and "marginal".

See Also

NER_Trafo, getVarCov

Examples

# Example to extract variance-covariance matrix

# Load Data
data("eusilcA_smp")
data("pop_area_size")
data("pop_mean")
data("pop_cov")

# Nested error regression model
NER_model <- NER_Trafo(fixed = eqIncome ~ gender + eqsize + cash +
                       self_empl + unempl_ben + age_ben + surv_ben +
                       sick_ben + dis_ben + rent + fam_allow + house_allow +
                       cap_inv + tax_adj,
                       smp_domains = "district",
                       pop_area_size = pop_area_size,
                       pop_mean = pop_mean, pop_cov = pop_cov,
                       smp_data = eusilcA_smp)

getVarCov(NER_model)

[Package saeTrafo version 1.0.2 Index]