turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Calculating Cohen's d using PROC MIXED

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-25-2016 10:29 AM

Hi All,

I came across a problem in which I need to calculate Cohen's d (standardized effect size) for any of the two groups. I used PROC MIXED to fit the model and the outputs provided LSMEANS for the differences between a treatment and a reference (control). The outputs also included the standard error and degree of freedom (I used dfm=kr in the MODEL statement). My question is, can I use the LSMEANS of difference, standard error and DF to calculate Cohen's d?

Here is the sample code:

PROC MIXED data=test;

class PTNO TREAT HOUR;

model Score = PTNO TREAT TREAT*HOUR /dfm=kr residual;

repeated HOUR / subject=PTNO type=CS; *** Each PTNO was measured 2 times;

LSMEANS Treat /pdiff=control('Control') adjust=Dunnett cl;

RUN;

Your comments and ideas are much appreciated!

Accepted Solutions

Solution

07-07-2017
08:35 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-29-2016 05:33 PM

Cohen's *d* is defined as the difference between two means divided by a standard deviation or pool standard deviation for the data. However, the LSMEANS statement in PROC MIXED only computes standard error not standard deviation from the data, the value of standard error may or may not be consistent with the value of standard deviation. Simply because the LS-means is a linear combination of parameter estimates in the model and also known as adjusted means, not the "arithmetic mean" calculation.

Use the PROC MEANS to extract the mean for effect Treat groups, and then use the PROC TTEST to obtain the mean difference and the pooled standard deviation. This might be more straighforward for calculating Cohen'd.

XC

All Replies

Solution

07-07-2017
08:35 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-29-2016 05:33 PM

Cohen's *d* is defined as the difference between two means divided by a standard deviation or pool standard deviation for the data. However, the LSMEANS statement in PROC MIXED only computes standard error not standard deviation from the data, the value of standard error may or may not be consistent with the value of standard deviation. Simply because the LS-means is a linear combination of parameter estimates in the model and also known as adjusted means, not the "arithmetic mean" calculation.

Use the PROC MEANS to extract the mean for effect Treat groups, and then use the PROC TTEST to obtain the mean difference and the pooled standard deviation. This might be more straighforward for calculating Cohen'd.

XC

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-29-2016 06:35 PM

Thanks so much cici0017. I understand that the best way to calculate Cohen's d is the way you suggested. But can I use the standard error (SE) and DF provided by the PROC MIXED to roughly "approximate" standard deviation (SD)?

There is a post that has suggested that we might be able to calculate **SD as SE*SQRT(DF+1).**

The reasons that I would like to calculate Cohen's d using PROC MIXED are two folds:

1. We have repeated measurements. Each subject was measured twice (or more). This actually "inflate" the sample size if we calculate SD using PROC MEANS and PROC TTEST.

2. We have many treatment arms (groups). It is a lot of work if I do the pairwise calculations.

Thanks in advance for any thoughts or suggestions.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-29-2016 06:44 PM

The approximate standard errors for the LS-mean is computed as the square root of L*(X'*(V_hat)^-1*X)^-1*L'. See the documentation here -

I am not sure how close this formular (**SE*SQRT(DF+1))** to the provided formula of STDERR of LSMEANS in MIXED procedure. You might have to run some testing for comparisons.

XC

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-29-2016 07:03 PM

Thanks cici0017!