View source: R/vis_lm_assumptions.R
| vis_lm_assumptions | R Documentation |
Checks for normality of the standardised residuals in the general linear model Student's t-test (t.test,var=EQUAL) Fisher oneway ANOVA (aov) or simple linear regression. Performs the Shapiro-Wilk test and Anderson-Darling test for normality and, if not a regression, also the Levene-Brown-Forsythe and the Bartlett's test for homogeneity of variances. It produces a histogram with normal overlay, a residuals vs fitted plot, and a normal Q-Q plot.
vis_lm_assumptions(samples, fact, cex = 1, regression = FALSE)
vis_anova_assumptions(...)
samples |
Numeric vector; the dependent variable. |
fact |
Factor; the independent variable. |
cex |
Numeric; scaling factor for plot text and symbols (default: 1). |
regression |
Logical; if TRUE, skips Bartlett's test (for regression diagnostics). Default is FALSE. |
... |
Arguments passed to |
A list with elements:
Summary of the ANOVA model.
Result from shapiro.test().
Result from nortest::ad.test() or a character message if n < 7.
Result from levene.test() (only if regression = FALSE).
Result from bartlett.test() (only if regression = FALSE).
Result from bp.test() (only if regression = TRUE).
ToothGrowth$dose <- as.factor(ToothGrowth$dose)
vis_lm_assumptions(ToothGrowth$len, ToothGrowth$dose)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.