- data
a data.frame or a model to be analyzed.
- formula
a formula specifying the ANOVA model similar to
aov. Can be of the form y ~ group where y is a
numeric variable giving the data values and group is a factor with
one or multiple levels giving the corresponding groups. For example,
formula = TP53 ~ cancer_group.
Examples of supported formula include:
Between-Ss ANOVA
(independent measures ANOVA): y ~ b1*b2
Within-Ss ANOVA
(repeated measures ANOVA): y ~ w1*w2 + Error(id/(w1*w2))
Mixed
ANOVA: y ~ b1*b2*w1 + Error(id/w1)
If the formula doesn't contain any within vars, a linear model is directly
fitted and passed to the ANOVA function. For repeated designs, the ANOVA
variables are parsed from the formula.
- dv
(numeric) dependent variable name.
- wid
(factor) column name containing individuals/subjects identifier.
Should be unique per individual.
- between
(optional) between-subject factor variables.
- within
(optional) within-subjects factor variables
- covariate
(optional) covariate names (for ANCOVA)
- type
the type of sums of squares for ANOVA. Allowed values are either
1, 2 or 3. type = 2 is the recommended default because it yields
identical ANOVA results to type = 1 when data are balanced, while also
producing various assumption tests where appropriate. When the data are
unbalanced, type = 3 is the choice used by popular commercial
softwares including SPSS.
Default when type is not specified: the chosen default
depends on the interface (see Note), so for unbalanced designs the two
interfaces can differ. To get reproducible, interface-independent results,
set type explicitly (e.g. type = 3 for an unbalanced
factorial design with interactions).
- effect.size
the effect size to compute and to show in the ANOVA
results. Allowed values can be either "ges" (generalized eta squared) or
"pes" (partial eta squared) or both. Default is "ges".
- error
(optional) for a linear model, an lm model object from which the
overall error sum of squares and degrees of freedom are to be calculated.
Read more in Anova() documentation.
- white.adjust
Default is FALSE. If TRUE, heteroscedasticity correction
is applied to the coefficient of covariance matrix. Used only for
independent measures ANOVA.
- observed
Variables that are observed (i.e, measured) as compared to
experimentally manipulated. The default effect size reported (generalized
eta-squared) requires correct specification of the observed variables.
- detailed
If TRUE, returns extra information (sums of squares columns,
intercept row, etc.) in the ANOVA table.
- ci
confidence level for a confidence interval on the effect size. If a
number between 0 and 1 (e.g. 0.95), two columns conf.low and
conf.high are added giving the confidence interval for partial
eta squared (effect.size must include "pes"). The interval is
computed from the noncentral F distribution (Steiger, 2004) in base R. The
interval is two-sided, and matches
effectsize::eta_squared(partial = TRUE, ci = , alternative = "two.sided");
that function defaults to a one-sided interval, whose upper bound is 1. No
interval is provided for generalized eta squared ("ges"), which has no
standard closed-form interval. Default is NULL (no interval; output
unchanged).
- x
an object of class anova_test
- correction
character. Used only in repeated measures ANOVA test to
specify which correction of the degrees of freedom should be reported for
the within-subject factors. Possible values are:
"GG":
applies Greenhouse-Geisser correction to all within-subjects factors even if
the assumption of sphericity is met (i.e., Mauchly's test is not
significant, p > 0.05).
"HF": applies Hyunh-Feldt correction to all
within-subjects factors even if the assumption of sphericity is met,
"none": returns the ANOVA table without any correction and
"auto": apply automatically GG correction to only within-subjects
factors violating the sphericity assumption (i.e., Mauchly's test p-value is
significant, p <= 0.05).
- ...
additional arguments