amelia_impute: Missing imputation with Amelia.

amelia_imputeR Documentation

Missing imputation with Amelia.

Description

Conduct missing imputation using Amelia algorithms.

Usage

amelia_impute(data, ID, m, imputed.vars, indep.vars, ...)

Arguments

data

Input data to be imputed.

ID

ID variable in the data.

m

Number of times for imputation. Default value: 5. Can be 1.

rounded

Logical. If the final imputed values are rounded to the nearest integer or not. Default value: TRUE.

parallel

Logical. When TRUE, Amelia runs in a parallel way. Default FALSE.

verbose

Logical. Default TRUE.

imputed.vars

Variables to be imputed.

indep.vars

Independent variables which will be used for missing imputation. If NULL, function will use all the variables except ID in the data for the missing imputattion.

indep.vars2

Additional independent variables used for missing imputation. When imputation with indep.vars fails, additional independent variables will be used for second round imputation. Can be NULL.

by.var

A grouping variable. If not NULL, the data will be segmented into many groups, and the missing imputations are done in each group, then the imputed data are combined. If NULL, the data will not be segmented before missing imputation.

Value

A synthetic data frame with the imputed values. All the imputed values are the average of m imputed datasets.

Examples

data.im <- amelia_impute(data = data,
                         ID = "BOOK_ID",
                         imputed.vars = paste0("AT",1:33), 
                         indep.vars   = c(paste0("d",4:16)) 
                         indep.vars2  = c(paste0("d",4:6)),
                         m = 5)


yangx227/SimmonsResearchR documentation built on April 24, 2022, 6:44 a.m.