impute_dataframe: Impute missing values in a data.frame using EM imputation

View source: R/impute_dataframe.r

impute_dataframeR Documentation

Impute missing values in a data.frame using EM imputation

Description

This function uses the Amelia package to impute a given data frame and return the imputed values.

Usage

impute_dataframe(df, measurements_per_day, repetitions = 30)

Arguments

df

a data frame

measurements_per_day

The number of measurements per day in the diary study

repetitions

The amount of times the Amelia call should be averaged over. Defaults to 30. The actual number of imputations is five times the value for repetitions, since Amelia's values are already averaged over five runs.

Value

This function returns the modified data frame.

Examples

data <- generate_numerical_test_data(40)
data
impute_dataframe(data,measurements_per_day=1)

roqua/autovar documentation built on Jan. 21, 2023, 7:37 p.m.