Description Usage Arguments Examples
View source: R/tidy_stats.anova.r
tidy_stats.anova
takes an anova object and tidies the output into a
data frame.
1 2 | ## S3 method for class 'anova'
tidy_stats(model, args = NULL)
|
model |
Output of |
args |
Unused. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Regression example
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group <- gl(2, 10, 20, labels = c("Ctl","Trt"))
weight <- c(ctl, trt)
model_0 <- lm(weight ~ 1)
model_1 <- lm(weight ~ group)
tidy_stats(anova(model_0))
tidy_stats(anova(model_1))
tidy_stats(anova(model_0, model_1))
tidy_stats(anova(model_0, model_1, test = "Chisq"))
# Logistic regression example
counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3,1,9)
treatment <- gl(3,3)
glm.D93 <- glm(counts ~ outcome + treatment, family = poisson())
tidy_stats(anova(glm.D93))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.