# \donttest{
Results_with_pmm <- flexImputeModel(data = logdata,
id_col = "ID",
time_col = "Days",
y_col = "y_val",
x_col = "x_val",
age_col = "Age",
gender_col = "Gender",
columns_to_impute = c("x_val","y_val"),
methods = c("pmm"),
univariate_vars = c("x_val","Age"),
multivariate_vars = c("x_val", "Gender", "trt1"),
max_multivariate_vars = 3)
Results_with_pmm$model #summary of Univariate and Multivariate LM and LME model
Results_with_kNN <- flexImputeModel(data = logdata,
id_col = "ID",
time_col = "Days",
y_col = "y_val",
x_col = "x_val",
age_col = "Age",
gender_col = "Gender",
columns_to_impute = c("x_val","y_val"),
methods = c("kNN"),
k = 5,
univariate_vars = c("x_val","Age"),
multivariate_vars = c("x_val", "Gender", "trt1"),
max_multivariate_vars = 3)
Results_with_kNN$model #summary of Univariate and Multivariate LM and LME model
Results_with_norm <- flexImputeModel(data = logdata,
id_col = "ID",
time_col = "Days",
y_col = "y_val",
x_col = "x_val",
age_col = "Age",
gender_col = "Gender",
columns_to_impute = c("x_val","y_val"),
methods = c("norm"),
univariate_vars = c("x_val","Age"),
multivariate_vars = c("x_val", "Gender", "trt1"),
max_multivariate_vars = 3)
Results_with_norm$model #summary of Univariate and Multivariate LM and LME model
Results_with_rf <- flexImputeModel(data = logdata,
id_col = "ID",
time_col = "Days",
y_col = "y_val",
x_col = "x_val",
age_col = "Age",
gender_col = "Gender",
columns_to_impute = c("x_val","y_val"),
methods = c("rf"),
univariate_vars = c("x_val","Age"),
multivariate_vars = c("x_val", "Gender", "trt1"),
max_multivariate_vars = 3)
Results_with_rf$model #summary of Univariate and Multivariate LM and LME model
Results_with_norm.nob <- flexImputeModel(data = logdata,
id_col = "ID",
time_col = "Days",
y_col = "y_val",
x_col = "x_val",
age_col = "Age",
gender_col = "Gender",
columns_to_impute = c("x_val","y_val"),
methods = c("norm.nob"),
univariate_vars = c("x_val","Age"),
multivariate_vars = c("x_val", "Gender", "trt1"),
max_multivariate_vars = 3)
Results_with_norm.nob$model #summary of Univariate and Multivariate LM and LME model
Results_with_sample <- flexImputeModel(data = logdata,
id_col = "ID",
time_col = "Days",
y_col = "y_val",
x_col = "x_val",
age_col = "Age",
gender_col = "Gender",
columns_to_impute = c("x_val","y_val"),
methods = c("sample"),
univariate_vars = c("x_val","Age"),
multivariate_vars = c("x_val", "Gender", "trt1"),
max_multivariate_vars = 3)
Results_with_sample$model
# } #summary of Univariate and Multivariate LM and LME model
Run the code above in your browser using DataLab