Created
December 20, 2017 22:46
-
-
Save seabbs/13dfd542fa68183cf2d81129ce139c2e to your computer and use it in GitHub Desktop.
Compare nested multiply imputed models
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Likelihood test p values for categorical variables | |
model_uni <- outcomes %>% map(function(.) model_outcome_uni(., variable = 'ageatvac', LRT = TRUE)) | |
model_adj <- outcomes %>% map(function(.) model_outcome_adj(., variable = 'ageatvac', LRT = TRUE)) | |
ageatvac_lrt_uni <- map2(model_ageatvac_uni, model_uni, function(x, y) pool.compare(x, y, data = imp_df, method = "likelihood")) %>% | |
map(function(x) ifelse(x < 0.001, "0.001", pretty_round(x, digits = 3))) | |
ageatvac_lrt_adj <- map2(model_ageatvac_adj, model_adj, function(x, y) pool.compare(x, y, data = imp_df, method = "likelihood")$pvalue) %>% | |
map(function(x) ifelse(x < 0.001, "0.001", pretty_round(x, digits = 3))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment