Learn R Programming

mi (version 0.10-2)

mi.fixed: Elementary function: imputation of constant variable.

Description

Imputes univariate constant missing data.

Usage

mi.fixed( formula, data = NULL, missing.index = NULL, ... )
 mi.copy(Y, X, missing.index = NULL, ...)

Arguments

formula
an object of class '"formula"' (or one that can be coerced to that class): a symbolic description of the model to be fitted. See bayesglm 'formula' for details.
data
A data frame containing the incomplete data and the matrix of the complete predictors.
missing.index
The index of missing units of the outcome variable
Y
A variable that is collinear with X
X
A variable that is colliear with Y
...
Currently not used

Value

  • modelA summary of the fitted model.
  • expectedThe expected values estimated by the model.
  • randomVector of length n.mis of random predicted values predicted by using the normal distribution.

References

Andrew Gelman and Jennifer Hill, Data Analysis Using Regression and Multilevel/Hierarchical Models, Cambridge University Press, 2006.

See Also

mi.info, mi.method, mi

Examples

Run this code
# fake data
n <- 100
x1 <- rbinom(n, 1, .45)
x2 <- 2*x1
x1[c(1, 3, 5, 20, 26)] <- NA

# impute data
mi.copy(x1, x2)

Run the code above in your browser using DataLab