Turn on suggestions

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

Showing results for

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

Options

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

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 03-25-2016 10:29 AM
(15930 views)

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!

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

4 REPLIES 4

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thanks cici0017!

**Available on demand!**

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.