Description Usage Arguments Value Examples
: Given a list of OLS regressions, *performed using lm()* format, return and optionally, write the results side-by-side in a csv.
1 2 | multiformat_lm(lm_list, output_file = NA, formula_list = NA,
title_list = NA, ndigit = 5)
|
lm_list |
a list() of lm model objects (list of lm objects) |
output_file |
the file path (with ".csv" extension) to write the results to, if no value provided, no output file will be created (character) |
formula_list |
optional list of custom formulae to provide to print in results (code pulls regression formula call by default) (list of character) |
title_list |
optional list of titles for each regression in the list to write atop output file (blank by default) (list of character) |
ndigit |
level of precision in output, 5 by default (integer) |
matrix containing formatted results from the provided regression list (matrix)
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
dem_dia <- merge(x = dem, y = dia, by = "empi", all.y = TRUE)
dem_dia[, pt_dia_count := .N, by = "empi"]
pt_dem_dia <- unique(dem_dia, by = "empi")
lm_dia_count_age <- lm(pt_dia_count ~ age, data = pt_dem_dia)
lm_dia_count_age_gender <- lm(pt_dia_count ~ age + gender, data = pt_dem_dia)
lm_dia_count_age_gender_race <- lm(pt_dia_count ~ age + gender + race, data = pt_dem_dia)
lm_list <- list(lm_dia_count_age, lm_dia_count_age_gender, lm_dia_count_age_gender_race)
multiformat_lm(lm_list = lm_list, output_file = "dia_count_lm_variation.csv")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.