Description Usage Arguments Value Examples
View source: R/model_mean_differences.R
This package tidies up regression output to give mean summary table, using various other packages in cohert linear model and mean separation using DMRT/LSD or alike tests, from 'agricolae' package this function works best in conjuction with 'lm_list'
1 | mean_differences_lm(model_list, treatment_factor_list)
|
model_list |
A list of linear model ( |
treatment_factor_list |
A list of single treatment factor or multiple treatment factors or interaction between two treatment factors. In any way the terms fitted to the all response must all be same. |
A tbl
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
# model marginal mean
mt_trial <- mtcars
rownames_to_column("vehicle_name")
as_tibble()
mutate_at(c("vehicle_name", "vs", "am"), as.factor)
mt_lm1 <- lm(`mpg`~`am`*`vs` + `hp`, data = mt_trial)
mt_lm2 <- lm(`drat`~`am`*`vs` + `hp` + `disp`, data = mt_trial)
mt_lm3 <- lm(`qsec`~`am`*`vs` + `hp`, data = mt_trial)
mt_named_list <- list(mt_lm1, mt_lm2, mt_lm3)
set_names(c("response_1st", "response_2nd", "response_3rd"))
mt_treatment_factor_list <- list("am", "vs", c("am", "vs"))
# main effects and interaction effects means for two factors using lm tidier
mean_differences_lm(model_list = mt_named_list, treatment_factor_list = mt_treatment_factor_list)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.