Description Usage Arguments Details Value
cleanData
will clean and organize a data frame such that it is ready to be discretized into person-time. Its primary purpose is to make sure there are no inconsistencies with the data and to impute missing values.
1 2 |
data |
A |
time |
Name or index of time variable (e.g. calendar date) for longitudinal data in long form. If |
locf |
If |
impute |
If |
baseline |
A vector of baseline variable names or indicies. |
ignore |
Vector of covariates ignoring in the imputations |
This function can take data with both time-varying and baseline covariates. If locf=TRUE
, then missing values will be imputed in a 'last observation carried forward' approach. Furthermore, if impute=TRUE
, then remaining observations that have no value to carry forward will be imputed with the median (if continuous) or mode (if character or factor). If the data includes only baseline covariates, then only the
clean
returns an object of class "data.frame" with the data ordered by ID, time, and ordered column wise alphabetically.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.