nicebread / BFDA

An R package for Bayes Factor Design Analysis
28 stars 9 forks source link

Effect size calculation t-tests #12

Open astefan1 opened 4 years ago

astefan1 commented 4 years ago

Why do we calculate the effect size as 2*t1$statistic / sqrt(2*nrow(SAMP)-2) for the independent samples t-test? The independent samples t-value is defined as (M1-M2)/(SDpool*sqrt(2/n)). Cohen's d is defined as (M1-M2)/SDpool. Then Cohen's d based on the t-value should be: t*sqrt(2/n). Or is the effect size calculation in the BFDA package based on a different definition of Cohen's d? Then we should probably mention this in the vignette.

nicebread commented 4 years ago

Rosenthal and Rosnow, 1991, provide this formula: d = 2t / √(df)

This is an approximation for the case where both groups have the same n (see, e.g., http://www.bwgriffin.com/gsu/courses/edur9131/content/Effect_Sizes_pdf5.pdf).

But given that we have the exact numbers, we probably should use the exact formula.

astefan1 commented 4 years ago

I just looked up the Rosenthal and Rosnow paper and their SD_pooled formula seems to be wrong. This is how they define SD_pooled:

image

However, the denominator should be: n_t + n_c -2. This is also what is used in R's t.test function and what Wikipedia says (see here). The formula that Rosenthal and Rosnow provide recovers their Cohen's d (based on their pooled standard deviation). What I wrote above, recovers Cohen's d following the R logic. I wrote an R script (see attached) where this is explained in detail. Personally, I would change the definition of Cohen's d to be based on R's built-in definition of the pooled standard deviation, but maybe we can discuss this in person.

CohensDConfusion.R.zip

astefan1 commented 4 years ago

I just realized that I didn't mean the Rosenthal and Rosnow paper but the Thalheimer & Cook article that you linked to.

nicebread commented 4 years ago

I'd suggest to use the plain (M1-M2)/SDpool formula on the raw data - seems the most straightforward way.