wmlmm {pwlmm}R Documentation

Fit Weighted Multivariate Linear Multilevel Model to Longitudinal Data.

Description

Fit a two-level probability-weighted multivariate linear model with a linear error covariance matrix structure, via IGLS algorithm.

Usage

wmlmm(formula, data = NULL, ID3, ID2, ID1, wj, wij, type, rot = NULL)

Arguments

formula

a linear formula object with the response on the left of a ~ operator and the terms, separated by + operators, on the right.

data

an optional data frame containing the variables in formula. If not found in data, the variables are taken from the environment of formula (if specified as a formula) or from the parent frame (if specified as a character vector).

ID3

vector of indexes for level two units

ID2

vector of indexes for level one units.

ID1

vector of successive measurements within the same level one unit, for all units.

wj

a vector of sampling weights for level two units. Level two units are selected with inclusion probabilities. Then, sampling weights for the level two units are defined as the inverse of these probabilities.

wij

a vector of sampling weights for level one units. After selecting a level two unit, level one units belonging to them are selected with inclusion probabilities. Then, sampling weights for the level one units are defined as the inverse of these probabilities.

type

type of structure imposed in the error covariance matrix; "toep" refers to the toeplitz, "uns" refers to the unestructured and "genlin" refers to the general linear.

rot

vector of 0's and 1's related to the measurements in time when "genlin" is passed to the type argument. Use 1 if the data were collected in that specific time unit, and 0 otherwise.

Details

Follows estimation process described in Veiga et al. (2014). Uses probability-weighted IGLS with scaled weights.

Value

Estimated list of estimators

References

A. Veiga, P. W. F. Smith and J. J. Brown (2014), The use of sample weights in multivariate multilevel models with an application to income data collected by using a rotating panel survey Journal of the Royal Statistical Society. Series C (Applied Statistics) Vol. 63, No. 1 (JANUARY 2014), pp. 65-84 (20 pages)

Examples

data(datamultv)
 wmlmm ( Y ~ X1 + X2, data = datamultv, PSU, idd, wave, wj, wi_j, "toep")


[Package pwlmm version 1.1.1 Index]