Section author: Ravi Selker, Jonathon Love, Damian Dropmann
One-Way ANOVA (anovaOneW)
Description
The Analysis of Variance (ANOVA) is used to explore the relationship between a continuous dependent variable, and one or more categorical explanatory variables. This ‘One-Way ANOVA’ is a simplified version of the ‘normal’ ANOVA, allowing only a single explanatory factor, however also providing a Welch’s ANOVA. The Welch’s ANOVA has the advantage that it need not assume that the variances of all groups are equal.
Usage
anovaOneW(
data,
deps,
group,
welchs = TRUE,
fishers = FALSE,
miss = "perAnalysis",
desc = FALSE,
descPlot = FALSE,
norm = FALSE,
qq = FALSE,
eqv = FALSE,
phMethod = "none",
phMeanDif = TRUE,
phSig = TRUE,
phTest = FALSE,
phFlag = FALSE,
formula
)
Arguments
|
the data as a data frame |
|
a string naming the dependent variables in |
|
a string naming the grouping or independent variable in |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(optional) the formula to use, see the examples |
Details
For convenience, this method allows specifying multiple dependent variables, resulting in multiple independent tests.
Note that the Welch’s ANOVA is the same procedure as the Welch’s independent samples t-test.
Output
A results object containing:
|
a table of the test results |
|
a table containing the group descriptives |
|
a table containing the normality tests |
|
a table of homogeneity of variances tests |
|
an array of groups of plots |
|
an array of post-hoc tables |
Tables can be converted to data frames with asDF or
as.data.frame(). For example:
results$anova$asDF
as.data.frame(results$anova)
Examples
data('ToothGrowth')
dat <- ToothGrowth
dat$dose <- factor(dat$dose)
anovaOneW(formula = len ~ dose, data = dat)
#
# ONE-WAY ANOVA
#
# One-Way ANOVA (Welch's)
# ----------------------------------------
# F df1 df2 p
# ----------------------------------------
# len 68.4 2 37.7 < .001
# ----------------------------------------
#