Learn R Programming

miceadds (version 1.5-0)

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

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

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'
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.

See Also

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