pivotImp | R Documentation |
This function takes a 'mids' object, generated by package 'mice', and creates a data frame with one long column for all imputed values, a column indicating the corresponding value of the predictor variable, and a column indicating to which of the 'm' imputed datasets it belongs. This function is useful for time-series data, where predictor variable (time) is complete and response variable values are missing.
pivotImp(mids, data, xVarName, yVarName)
mids |
A 'mids' object generated by 'mice' |
data |
Original dataset with missing values |
xVarName |
A character string with the name of the predictor variable in the original dataset |
yVarName |
A character string with the name of the response variable in the 'mids' object |
A data frame with three columns
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.