| stack_imputations | R Documentation |
Concatenates a list of imputed data frames into a single stacked data
frame. An imputation-index column (.imp) is added to identify
which imputed dataset each row originated from.
stack_imputations(data_list, imp_col = ".imp")
data_list |
A list of data frames, all with the same dimensions
and column names, representing |
imp_col |
Character string. Name of the imputation-index column
added to the stacked data (default |
A single data frame with M \times n rows, where n is the
number of rows in each imputed dataset. If imp_col is not
NULL, an integer column recording the imputation index is
appended.
Sherlock, P., Mansolf, M., Hofheimer, J., Hockett, C. W., O'Connor, T. G., Roubinov, D., Graff, J. C., Lai, J.-S., Bush, N. R., Wright, R. J., & Chiu, Y.-H. M. (2026). Beyond linear risk: A machine learning approach to understanding perinatal depression in context. Multivariate Behavioral Research, 1–16. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/00273171.2026.2661244")}
Rodgers, J., Khoo, S.-T., & Ludtke, O. (2021). Handling missing data in structural equation models using multiple imputation and stacking. Structural Equation Modeling, 28(6), 915–930.
ctree_stacked, rescale_alpha
df1 <- data.frame(x = 1:5, y = c(2, 4, 6, 8, 10))
df2 <- data.frame(x = 1:5, y = c(2, 3, 6, 9, 10))
df3 <- data.frame(x = 1:5, y = c(1, 4, 5, 8, 11))
stacked <- stack_imputations(list(df1, df2, df3))
nrow(stacked) # 15
table(stacked$.imp) # 5 rows per imputation
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.