Description Usage Arguments Value See Also Examples
Running linear model (lm
) across multiple grouping variables.
1 2 3 4 5 6 7 8 |
data |
Dataframe (or tibble) from which variables are to be taken. |
grouping.vars |
Grouping variables. |
... |
Additional arguments to |
output |
A character describing what output is expected. Two possible
options: |
tidy.args |
A list of arguments to be used in the relevant |
augment.args |
A list of arguments to be used in the relevant |
A tibble dataframe with tidy results from linear model.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # loading needed libraries
library(ggplot2)
# getting tidy output of results
grouped_lm(
data = mtcars,
grouping.vars = cyl,
formula = mpg ~ am * wt,
output = "tidy"
)
# getting model summaries
# diamonds dataset from ggplot2
grouped_lm(
data = diamonds,
grouping.vars = c(cut, color),
formula = price ~ carat * clarity,
output = "glance"
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.