mice.impute.2l.contextual.norm: Imputation by Normal Linear Regression with Contextual...

Description Usage Arguments Value Author(s) See Also

View source: R/mice.impute.2l.contextual.norm.R

Description

This imputation method imputes a variable using linear regression with normally distributed residuals. Including a contextual effects means that an aggregated variable at a cluster level is included as a further covariate.

Usage

1
2
mice.impute.2l.contextual.norm(y, ry, x, type, ridge = 10^(-5), 
   imputationWeights = NULL, interactions = NULL, quadratics = NULL, ...)

Arguments

y

Incomplete data vector of length n

ry

Vector of missing data pattern (FALSE – missing, TRUE – observed)

x

Matrix (n x p) of complete covariates.

type

Type of predictor variables. type=-2 refers to the cluster variable, type=2 denotes a variable for which also a contextual effect is included and type=1 denotes all other variables which are included as 'ordinary' predictors.

ridge

Ridge parameter in the diagonal of \bold{X}'\bold{X}

imputationWeights

Optional vector of sample weights

interactions

Vector of variable names used for creating interactions

quadratics

Vector of variable names used for creating quadratic terms

...

Further arguments to be passed

Value

A vector of length nmis=sum(!ry) with imputed values.

Author(s)

Alexander Robitzsch

See Also

For examples see mice.impute.2l.contextual.pmm.


miceadds documentation built on Aug. 9, 2017, 5:04 p.m.