
This function calculates effect sizes in terms of Cohen's d, also
called the uncorrected effect size. See hedg_g
for the sample
size corrected version. Also see
Lakens (2013)
for a discussion on different types of effect sizes and their
interpretation. Note that missing data are removed from the calculations of
the means and standard deviations.
coh_d(data, formula, ref_group = NULL, se = TRUE)
The data frame used for estimation - ideally structured in a tidy format.
A formula of the type out ~ group
where out
is
the outcome variable and group
is the grouping variable. Note this
variable can include any arbitrary number of groups. Additional variables
can be included with +
to produce separate estimates by the secondary
or tertiary variables of interest (e.g., out ~ group + characteristic1
+ characteristic2
).
Optional. A character vector or forumla listing the
reference group levels for each variable on the right hand side of the
formula, supplied in the same order as the formula. Note that if using the
formula version, levels that are numbers, or include hyphens, spaces, etc.,
should be wrapped in back ticks (e.g.,
ref_group = ~ Active + `Non-FRL`
, or ref_group = ~`8`
). When
in doubt, it is safest to use the back ticks, as they will not interfere
with anything if they are not needed. See examples below for more details.
Logical. Should the standard error of the effect size be
estimated and returned in the resulting data frame? Defaults to
TRUE
.
By default the Cohen's d for all possible pairings of the grouping factor(s) are returned.
# NOT RUN {
# Calculate Cohen's d for all pairwise comparisons
coh_d(star, reading ~ condition)
# Report only relative to regular-sized classrooms
coh_d(star,
reading ~ condition,
ref_group = "reg")
# Report by ELL and FRL groups for each season, compare to non-ELL students
# who were not eligible for free or reduced price lunch in the fall (using
# the formula interface for reference group referencing).
coh_d(benchmarks,
math ~ ell + frl + season,
ref_group = ~`Non-ELL` + `Non-FRL` + Fall)
# Same thing but with character vector supplied, rather than a formula
coh_d(benchmarks,
math ~ ell + frl + season,
ref_group = c("Non-ELL", "Non-FRL", "Fall"))
# }
Run the code above in your browser using DataLab