You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Appropriate to use t_to_d() on estimated marginal mean contrasts from ANOVA? #616
I'm running some factorial anova analyses, and would like to use t_to_d() with emmeans to retrieve cohen's d effect sizes for my pairwise contrasts. I'm just wondering whether this is statistically sound? I see the degrees of freedom are the same all across the contrasts, and am not sure whether these large df values might lead to some inflated and inaccurate estimates of cohen's d.
Reprex:
library(palmerpenguins) # dataset#> Warning: package 'palmerpenguins' was built under R version 4.1.3
library(car) # anova functions#> Warning: package 'car' was built under R version 4.1.3#> Loading required package: carData#> Warning: package 'carData' was built under R version 4.1.3
library(effectsize) # effect sizes
library(dplyr)
#> Warning: package 'dplyr' was built under R version 4.1.3#> #> Attaching package: 'dplyr'#> The following object is masked from 'package:car':#> #> recode#> The following objects are masked from 'package:stats':#> #> filter, lag#> The following objects are masked from 'package:base':#> #> intersect, setdiff, setequal, union# assigns data to a dataframe we call "df"df<-palmerpenguins::penguins# drop rows with missing valuesdf<-df[complete.cases(df)==TRUE, ]
df %>%
group_by(species, sex) %>% # Group by the specified variablesdplyr::summarise(n()) %>%
knitr::kable()
#> `summarise()` has grouped output by 'species'. You can override using the#> `.groups` argument.
species
sex
n()
Adelie
female
73
Adelie
male
73
Chinstrap
female
34
Chinstrap
male
34
Gentoo
female
58
Gentoo
male
61
# Fit dataflipper_fit<-stats::aov(flipper_length_mm~species, data=df)
# Run anovaflipper_anova<-car::Anova(flipper_fit)
# Extract estimated marginal meansflipper_emmeans<-emmeans::emmeans(flipper_fit, specs=pairwise~species)
# convert estimated marginal mean contrasts to dataframeflipper_emmeans_contrasts<-data.frame(flipper_emmeans$contrasts)
knitr::kable(flipper_emmeans_contrasts)
Activity