Imputes NIAID OS data using a Markov model.
impute(
wide,
m,
by = NULL,
days = paste0("D", 1:28),
bin = rep(1, length(days) - 1),
Em = get_emission(wide, days),
listFormatOut = FALSE,
tol = 1e-06,
maxiter = 200,
silent = FALSE
)Data in wide format (i.e., each day is a column).
Number of imputations.
Character vector with column names. Data will be broken up and imputed separately for every combination of values for specified columns in the data.
Names of the columns that contain the score for each day. Columns should be in sequential order.
The assigned bin for pooling together information across transitions. Must be a numeric vector of length=(length(days)-1). By default all transitions are pooled together.
Emission probabilities. Generally the default should not be changed.
Return each imputed dataset in a list or combine into a single dataset.
Tolerance for relative reduction the log-likelihood to determine convergence of the Baum-Welch algorithm.
Maximum iterations before stopping the EM algorithm.
Allows silencing some messages.
If listFormatOut = TRUE, then a list will be returned with each element being an imputed data set. If listFormatOut = FALSE, then a single data.frame will be returned where IMP_ID column is created.
States for each patient/day in 'wide' may be the following:
Not missing:An integer from 1 to 8.
Missing:NA
Partially Missing: Range which may be code as a characters string such as '[1,7]' or '[1,2]'. Such a character string indicates that while the actual value is unknown, it is known that the value falls within the specified range.
# NOT RUN {
test <- sim_data(100)
bs <- impute(wide=test,m=2, by="strata", silent=TRUE)
# }
Run the code above in your browser using DataLab