powered by
Tidies the result of an analysis of variance into an ANOVA table. Only a tidy method is provided, not an augment or glance method.
tidy
augment
glance
# S3 method for anova tidy(x, ...)# S3 method for aov tidy(x, ...)# S3 method for aovlist tidy(x, ...)
# S3 method for aov tidy(x, ...)
# S3 method for aovlist tidy(x, ...)
An object of class "anova", "aov", or "aovlist"
extra arguments (not used)
A data.frame with columns
Term within the model, or "Residuals"
Degrees of freedom used by this term in the model
Sum of squares explained by this term
Mean of sum of squares among degrees of freedom
F statistic
P-value from F test
In the case of an "aovlist" object, there is also a stratum column describing the error stratum
Note that the "term" column of an ANOVA table can come with leading or trailing whitespace, which this tidying method trims.
# NOT RUN { a <- anova(lm(mpg ~ wt + qsec + disp, mtcars)) tidy(a) a <- aov(mpg ~ wt + qsec + disp, mtcars) tidy(a) al <- aov(mpg ~ wt + qsec + Error(disp / am), mtcars) tidy(al) # }
Run the code above in your browser using DataLab