Learn R Programming

FastImputation (version 2.2.1)

TrainFastImputation: Learn from the training data so that later you can fill in missing data

Description

Like Amelia, FastImputation assumes that the columns of the data are multivariate normal or can be transformed into approximately multivariate normal.

Usage

TrainFastImputation(x, constraints = list(), idvars, categorical)

Value

An object of class 'FastImputationPatterns' that contains information needed later to impute on a single row.

Arguments

x

Dataframe containing training data. Can have incomplete rows.

constraints

A list of constraints. See the examples below for formatting details.

idvars

A vector of column numbers or column names to be ignored in the imputation process.

categorical

A vector of column numbers or column names of varaibles with a (small) set of possible values.

Author

Stephen R. Haptonstahl srh@haptonstahl.org

References

https://gking.harvard.edu/amelia

See Also

FastImputation

Examples

Run this code

data(FI_train)   # provides FI_train dataset

patterns_with_constraints <- TrainFastImputation(
  FI_train,
  constraints=list(list("bounded_below_2", list(lower=0)),
                   list("bounded_above_5", list(upper=0)),
                   list("bounded_above_and_below_6", list(lower=0, upper=1))
                   ),
  idvars="user_id_1",
  categorical="categorical_9")
  

Run the code above in your browser using DataLab