Parameters from ANOVAs
Usage
# S3 method for aov
model_parameters(
model,
omega_squared = NULL,
eta_squared = NULL,
epsilon_squared = NULL,
df_error = NULL,
type = NULL,
ci = NULL,
alternative = NULL,
test = NULL,
power = FALSE,
keep = NULL,
drop = NULL,
parameters = keep,
table_wide = FALSE,
verbose = TRUE,
...
)
# S3 method for anova
model_parameters(
model,
omega_squared = NULL,
eta_squared = NULL,
epsilon_squared = NULL,
df_error = NULL,
type = NULL,
ci = NULL,
alternative = NULL,
test = NULL,
power = FALSE,
keep = NULL,
drop = NULL,
parameters = keep,
table_wide = FALSE,
verbose = TRUE,
...
)
# S3 method for aovlist
model_parameters(
model,
omega_squared = NULL,
eta_squared = NULL,
epsilon_squared = NULL,
df_error = NULL,
type = NULL,
ci = NULL,
alternative = NULL,
test = NULL,
power = FALSE,
keep = NULL,
drop = NULL,
parameters = keep,
table_wide = FALSE,
verbose = TRUE,
...
)
# S3 method for afex_aov
model_parameters(
model,
omega_squared = NULL,
eta_squared = NULL,
epsilon_squared = NULL,
df_error = NULL,
type = NULL,
keep = NULL,
drop = NULL,
parameters = keep,
verbose = TRUE,
...
)
# S3 method for anova.rms
model_parameters(
model,
omega_squared = NULL,
eta_squared = NULL,
epsilon_squared = NULL,
df_error = NULL,
type = NULL,
ci = NULL,
alternative = NULL,
test = NULL,
power = FALSE,
keep = NULL,
drop = NULL,
parameters = keep,
table_wide = FALSE,
verbose = TRUE,
...
)
# S3 method for Anova.mlm
model_parameters(
model,
omega_squared = NULL,
eta_squared = NULL,
epsilon_squared = NULL,
df_error = NULL,
type = NULL,
ci = NULL,
alternative = NULL,
test = NULL,
power = FALSE,
keep = NULL,
drop = NULL,
parameters = keep,
table_wide = FALSE,
verbose = TRUE,
...
)
# S3 method for maov
model_parameters(
model,
omega_squared = NULL,
eta_squared = NULL,
epsilon_squared = NULL,
df_error = NULL,
type = NULL,
ci = NULL,
alternative = NULL,
test = NULL,
power = FALSE,
keep = NULL,
drop = NULL,
parameters = keep,
table_wide = FALSE,
verbose = TRUE,
...
)
Arguments
- model
Object of class
aov()
,anova()
,aovlist
,Gam
,manova()
,Anova.mlm
,afex_aov
ormaov
.- omega_squared
Compute omega squared as index of effect size. Can be
"partial"
(the default, adjusted for effect size) or"raw"
.- eta_squared
Compute eta squared as index of effect size. Can be
"partial"
(the default, adjusted for effect size),"raw"
or"adjusted"
(the latter option only for ANOVA-tables from mixed models).- epsilon_squared
Compute epsilon squared as index of effect size. Can be
"partial"
(the default, adjusted for effect size) or"raw"
.- df_error
Denominator degrees of freedom (or degrees of freedom of the error estimate, i.e., the residuals). This is used to compute effect sizes for ANOVA-tables from mixed models. See 'Examples'. (Ignored for
afex_aov
.)- type
Numeric, type of sums of squares. May be 1, 2 or 3. If 2 or 3, ANOVA-tables using
car::Anova()
will be returned. (Ignored forafex_aov
.)- ci
Confidence Interval (CI) level for effect sizes
omega_squared
,eta_squared
etc. The default,NULL
, will compute no confidence intervals.ci
should be a scalar between 0 and 1.- alternative
A character string specifying the alternative hypothesis; Controls the type of CI returned:
"two.sided"
(default, two-sided CI),"greater"
or"less"
(one-sided CI). Partial matching is allowed (e.g.,"g"
,"l"
,"two"
...). See section One-Sided CIs in the effectsize_CIs vignette.- test
String, indicating the type of test for
Anova.mlm
to be returned. If"multivariate"
(orNULL
), returns the summary of the multivariate test (that is also given by theprint
-method). Iftest = "univariate"
, returns the summary of the univariate test.- power
Logical, if
TRUE
, adds a column with power for each parameter.- keep
Character containing a regular expression pattern that describes the parameters that should be included (for
keep
) or excluded (fordrop
) in the returned data frame.keep
may also be a named list of regular expressions. All non-matching parameters will be removed from the output. Ifkeep
is a character vector, every parameter name in the "Parameter" column that matches the regular expression inkeep
will be selected from the returned data frame (and vice versa, all parameter names matchingdrop
will be excluded). Furthermore, ifkeep
has more than one element, these will be merged with anOR
operator into a regular expression pattern like this:"(one|two|three)"
. Ifkeep
is a named list of regular expression patterns, the names of the list-element should equal the column name where selection should be applied. This is useful for model objects wheremodel_parameters()
returns multiple columns with parameter components, like inmodel_parameters.lavaan()
. Note that the regular expression pattern should match the parameter names as they are stored in the returned data frame, which can be different from how they are printed. Inspect the$Parameter
column of the parameters table to get the exact parameter names.- drop
See
keep
.- parameters
Deprecated, alias for
keep
.- table_wide
Logical that decides whether the ANOVA table should be in wide format, i.e. should the numerator and denominator degrees of freedom be in the same row. Default:
FALSE
.- verbose
Toggle warnings and messages.
- ...
Arguments passed to or from other methods.
Note
For ANOVA-tables from mixed models (i.e. anova(lmer())
), only
partial or adjusted effect sizes can be computed. Note that type 3 ANOVAs
with interactions involved only give sensible and informative results when
covariates are mean-centred and factors are coded with orthogonal contrasts
(such as those produced by contr.sum
, contr.poly
, or
contr.helmert
, but not by the default contr.treatment
).
Examples
if (requireNamespace("effectsize", quietly = TRUE)) {
df <- iris
df$Sepal.Big <- ifelse(df$Sepal.Width >= 3, "Yes", "No")
model <- aov(Sepal.Length ~ Sepal.Big, data = df)
model_parameters(
model,
omega_squared = "partial",
eta_squared = "partial",
epsilon_squared = "partial"
)
model_parameters(
model,
omega_squared = "partial",
eta_squared = "partial",
ci = .9
)
model <- anova(lm(Sepal.Length ~ Sepal.Big, data = df))
model_parameters(model)
model_parameters(
model,
omega_squared = "partial",
eta_squared = "partial",
epsilon_squared = "partial"
)
model <- aov(Sepal.Length ~ Sepal.Big + Error(Species), data = df)
model_parameters(model)
if (FALSE) {
if (require("lme4")) {
mm <- lmer(Sepal.Length ~ Sepal.Big + Petal.Width + (1 | Species),
data = df
)
model <- anova(mm)
# simple parameters table
model_parameters(model)
# parameters table including effect sizes
model_parameters(
model,
eta_squared = "partial",
ci = .9,
df_error = dof_satterthwaite(mm)[2:3]
)
}
}
}