06.09.2021 Views

Learning Statistics with R - A tutorial for psychology students and other beginners, 2018a

Learning Statistics with R - A tutorial for psychology students and other beginners, 2018a

Learning Statistics with R - A tutorial for psychology students and other beginners, 2018a

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

13.8.2 Cohen’s d from a Student t test<br />

The majority of discussions of Cohen’s d focus on a situation that is analogous to Student’s independent<br />

samples t test, <strong>and</strong> it’s in this context that the story becomes messier, since there are several<br />

different versions of d that you might want to use in this situation, <strong>and</strong> you can use the method argument<br />

to the cohensD() function to pick the one you want. To underst<strong>and</strong> why there are multiple versions of d,<br />

it helps to take the time to write down a <strong>for</strong>mula that corresponds to the true population effect size δ.<br />

It’s pretty straight<strong>for</strong>ward,<br />

δ “ μ 1 ´ μ 2<br />

σ<br />

where, as usual, μ 1 <strong>and</strong> μ 2 are the population means corresponding to group 1 <strong>and</strong> group 2 respectively,<br />

<strong>and</strong> σ is the st<strong>and</strong>ard deviation (the same <strong>for</strong> both populations). The obvious way to estimate δ is to<br />

do exactly the same thing that we did in the t-test itself: use the sample means as the top line, <strong>and</strong> a<br />

pooled st<strong>and</strong>ard deviation estimate <strong>for</strong> the bottom line:<br />

d “ ¯X 1 ´ ¯X 2<br />

ˆσ p<br />

where ˆσ p is the exact same pooled st<strong>and</strong>ard deviation measure that appears in the t-test. This is the most<br />

commonly used version of Cohen’s d when applied to the outcome of a Student t-test ,<strong>and</strong> is sometimes<br />

referred to as Hedges’ g statistic (Hedges, 1981). It corresponds to method = "pooled" in the cohensD()<br />

function, <strong>and</strong> it’s the default.<br />

However, there are <strong>other</strong> possibilities, which I’ll briefly describe. Firstly, you may have reason to<br />

want to use only one of the two groups as the basis <strong>for</strong> calculating the st<strong>and</strong>ard deviation. This approach<br />

(often called Glass’ Δ) only makes most sense when you have good reason to treat one of the two groups<br />

as a purer reflection of “natural variation” than the <strong>other</strong>. This can happen if, <strong>for</strong> instance, one of the<br />

two groups is a control group. If that’s what you want, then use method = "x.sd" or method = "y.sd"<br />

when using cohensD(). Secondly, recall that in the usual calculation of the pooled st<strong>and</strong>ard deviation we<br />

divide by N ´ 2 to correct <strong>for</strong> the bias in the sample variance; in one version of Cohen’s d this correction<br />

is omitted. Instead, we divide by N. This version (method = "raw") makes sense primarily when you’re<br />

trying to calculate the effect size in the sample; rather than estimating an effect size in the population.<br />

Finally, there is a version based on Hedges <strong>and</strong> Olkin (1985), who point out there is a small bias in the<br />

usual (pooled) estimation <strong>for</strong> Cohen’s d. Thus they introduce a small correction (method = "corrected"),<br />

by multiplying the usual value of d by pN ´ 3q{pN ´ 2.25q.<br />

In any case, ignoring all those variations that you could make use of if you wanted, let’s have a look<br />

at how to calculate the default version. In particular, suppose we look at the data from Dr Harpo’s<br />

class (the harpo data frame). The comm<strong>and</strong> that we want to use is very similar to the relevant t.test()<br />

comm<strong>and</strong>, but also specifies a method<br />

> cohensD( <strong>for</strong>mula = grade ~ tutor, # outcome ~ group<br />

+ data = harpo, # data frame<br />

+ method = "pooled" # which version to calculate?<br />

+ )<br />

[1] 0.7395614<br />

This is the version of Cohen’s d that gets reported by the independentSamplesTTest() function whenever<br />

it runs a Student t-test.<br />

13.8.3 Cohen’s d from a Welch test<br />

Suppose the situation you’re in is more like the Welch test: you still have two independent samples,<br />

- 414 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!