BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jj02148
Obsidian | Level 7

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
cici0017
SAS Employee

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

View solution in original post

4 REPLIES 4
cici0017
SAS Employee

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

jj02148
Obsidian | Level 7

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.

cici0017
SAS Employee

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 -

http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_mixed_syntax...

 

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

jj02148
Obsidian | Level 7
Thanks cici0017!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Discussion stats
  • 4 replies
  • 15803 views
  • 4 likes
  • 2 in conversation