Description Usage Arguments Value Author(s) Examples
View source: R/tidy_lm_add_r_squared.R
add r.squared and adj.r.squared to tidy
table of lm
results.
1 | tidy_lm_add_r_squared(tidy_df, n)
|
tidy_df |
a |
n |
the number of participants analyzed. Using nrow(data), where data is the dataframe used in |
column of r.squared and adj.r.squared added a tidy
table of a lm
Ekarin Eric Pongpipat
1 2 3 4 5 6 7 8 9 10 11 12 13 | packages <- c("broom", "broomExtra", "dplyr", "modelr", "tibble")
xfun::pkg_attach2(packages, message = F)
data <- tibble(
a = scale(sample.int(100), scale = F),
b = scale(sample.int(100), scale = F),
c = b^2,
d = scale(sample.int(100), scale = F)
)
lm(a ~ b, data) %>%
tidy() %>%
tidy_lm_add_r_squared(., n = nrow(data))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.