knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(expdean)
lm_list() functionmt_trial <- mtcars %>% rownames_to_column("vehicle_name") %>% as_tibble() %>% mutate_at(c("vehicle_name", "vs", "am"), as.factor) lm_model_list1 <- lm_list(mt_trial, c("mpg", "drat", "qsec"), c("am", "vs", "am:vs", "hp"))
model_mean_differences() functionLinear mixed model can be fitted using lme package. Marginal and conditional means of continuous response variables can be extracted from this model class or lmer objects using estimated marginal means available in emmeans package.
# pairwise comparison between treatment levels pairs(emmeans::emmeans(lm_model_list1, "am")) # p-value comparison emmeans::pwpp(emmeans::emmeans(lm_model_list1, "am"))
Model contrasts and contrast coefficients can be assessed.
# contrasts emmeans::contrast(emmeans::emmeans(lm_model_list1, "am")) coef(emmeans_contrast) # contrast coefficients can be assessed
Pairwise comparison of estimated marginal means:
multcomp::cld(emmeans::emmeans(lm_model_list1, "am")) # compact display
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.