vis_anova_assumptions {visStatistics} | R Documentation |
Visualisation of the normality distribution of the standardised residuals of the ANOVA
Description
vis_anova_assumptions
checks for normality of the standardised
residuals of the ANOVA. Both the Shapiro-Wilk test shapiro.test()
and
the Anderson-Darling test ad.test()
check the null that the
standardised residuals are normally distributed. It generates a scatter plot
of the standardised residuals versus the fitted mean values of the linear
models for each level of fact
. Furthermore a normal QQ plot of the
standardised residuals is generated. The null of homogeneity of variances of
each factor level is tested with the bartlett.test()
.
Usage
vis_anova_assumptions(
samples,
fact,
conf.level = 0.95,
samplename = "",
factorname = "",
cex = 1
)
Arguments
samples |
vector containing dependent variable, datatype numeric |
fact |
vector containing independent variable, datatype factor |
conf.level |
confidence level, 0.95=default |
samplename |
name of sample used in graphical output, datatype character , ”=default |
factorname |
name of sample used in graphical output, datatypecharacter, ”=default |
cex |
number indicating the amount by which plotting text and symbols should be scaled relative to the default. 1=default, 1.5 is 50% larger, 0.5 is 50% smaller, etc. |
Value
list
containing the test statistics of the anova, the p values
generated by the Shapiro-Wilk test shapiro.test()
, the
Anderson-Darling test ad.test()
and the bartlett.test()
.
Examples
ToothGrowth$dose <- as.factor(ToothGrowth$dose)
vis_anova_assumptions(ToothGrowth$len, ToothGrowth$dose)
vis_anova_assumptions(ToothGrowth$len, ToothGrowth$supp)
vis_anova_assumptions(iris$Petal.Width, iris$Species)