View source: R/illustrative-analysis-helpers.R
pool_morisot | R Documentation |
Method described in paper of morisot and colleagues
pool_morisot(preds_list, by_vars)
preds_list |
A list of length equal to number of imputed datasets, containing the imputation-specific predictions. Each element should be a dataframe containing columns "prob" (probability), "se" (standard error of probability) and any other variables which identify groups of predictions (to be used in by_vars) |
by_vars |
Vector of variable names to pool across |
set.seed(1234) # This represents a prediction for patients A and B made # across 20 imputed datasets preds_list <- replicate( n = 20, simplify = FALSE, expr = { cbind.data.frame( "prob" = runif(2, min = 0.25, max = 0.5), "se" = runif(2, min = 0.01, max = 0.05), "patient" = c("A", "B") ) } ) preds_list[c(1, 2)] # Pool the probabilities pool_morisot(preds_list, by_vars = "patient")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.