jowolfe79 Tracker
https://communities.sas.com/kntur85557/tracker
jowolfe79 TrackerMon, 16 Sep 2024 02:19:24 GMT2024-09-16T02:19:24ZCohen's d in GLM
https://communities.sas.com/t5/Statistical-Procedures/Cohen-s-d-in-GLM/m-p/801883#M39417
<P>I have used the following to calculate Cohen's d with PROC TTEST and I am wondering if there is a way to do something similar with PROC GLM so that I can calculate Cohen's d from the LSMeans.</P><PRE>proc ttest DATA=surveydata plots=none;
class X;
var A B C
ods select ConfLimits;
ods output ConfLimits=CL;
run;
data CohenD;
set Cl(where=(method="Pooled") rename=(Mean=MeanDiff));
CohenD = MeanDiff / StdDev;
run;
proc print data=CohenD noobs;
var Variable Class Method MeanDiff StdDev CohenD;
run;</PRE><P>Here is my CURRENT PROC GLM STATEMENT. I want to be able to use the same data statement as above to calculate Cohen's d.</P><P> </P><PRE>PROC GLM DATA=surveydata PLOTS=none;
CLASS X;
MODEL A B C = X;
LSMEANS X /adjust=bon;
RUN;</PRE><P>Is there a way to do this? Thank you for any help!!</P><P> </P>Sun, 13 Mar 2022 22:44:53 GMThttps://communities.sas.com/t5/Statistical-Procedures/Cohen-s-d-in-GLM/m-p/801883#M39417jowolfe792022-03-13T22:44:53ZRe: Easy way to calculate Cohen's d
https://communities.sas.com/t5/Statistical-Procedures/Easy-way-to-calculate-Cohen-s-d/m-p/801157#M39390
Thank you so much!!! This is exactly what I needed.Wed, 09 Mar 2022 18:06:40 GMThttps://communities.sas.com/t5/Statistical-Procedures/Easy-way-to-calculate-Cohen-s-d/m-p/801157#M39390jowolfe792022-03-09T18:06:40ZRe: Easy way to calculate Cohen's d
https://communities.sas.com/t5/Statistical-Procedures/Easy-way-to-calculate-Cohen-s-d/m-p/801155#M39388
<P>I see that you asked for my data in a data step. I am really not familiar with the syntax since I upload Excel spreadsheets, but here's my best guess at a simplified version of my data</P><P> </P><P>data surveydata;</P><P>input ResponseID SResponse Comp OriginalSocial Abrasive GetRequest SpeakerGender;</P><P>datalines;</P><P>01 PFF 3.2 5.6 5.0 4 F</P><P>02 ISTATE 4.8 2.1 1.0 6 F</P><P>03 PFF 3.8 5.9 5.1 4 M</P><P> </P><P>Is that close enough?</P><P>Is there a way that SAS can spit out this simple calculation: Cohen's <I>d</I> = (<I>M</I><SPAN>2</SPAN> - <I>M</I><SPAN>1</SPAN>) <SPAN>⁄ </SPAN><I>SD</I><SPAN>pooled</SPAN></P><P><SPAN>Here's <A href="https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&ved=2ahUKEwjn6pLiy7n2AhVNneAKHYOhAhcQFnoECAcQAQ&url=https%3A%2F%2Fcommunities.sas.com%2Fkntur85557%2Fattachments%2Fkntur85557%2Fnew-users%2F122%2F1%2FSAS%2520macro.pdf&usg=AOvVaw2ZNPrlmAWS1us5v1r8NtmH" target="_self">a macro</A> for doing it, but I am having trouble figuring out how to run the macro.</SPAN></P><P> </P>Wed, 09 Mar 2022 17:52:39 GMThttps://communities.sas.com/t5/Statistical-Procedures/Easy-way-to-calculate-Cohen-s-d/m-p/801155#M39388jowolfe792022-03-09T17:52:39ZRe: Easy way to calculate Cohen's d
https://communities.sas.com/t5/Statistical-Procedures/Easy-way-to-calculate-Cohen-s-d/m-p/801152#M39387
<P>The thread uses Proc Mixed and I simply do not understand it. Why is this not part of t-test or GLM? PROC GLM has an effectsize option, but it doesn't report Cohen's d.</P><P> </P><P>I have a dataset with two independent groups. I want an easy way to do this calculation. </P><P>Cohen's <I>d</I> = (<I>M</I><SPAN>2</SPAN> - <I>M</I><SPAN>1</SPAN>) <SPAN>⁄ </SPAN><I>SD</I><SPAN>pooled</SPAN></P><P><SPAN><I>SD</I>pooled = √((<I>SD</I>12 + <I>SD</I>22) ⁄ 2) </SPAN></P><P> </P><P><SPAN>Can this be done as part of a t-test, means, or GLM PROC? </SPAN></P><P> </P><P><SPAN>Here's my means statement which gets me all of the calculations I need to do the procedure by hand. I am fine having to run it separately for each dependent variable:</SPAN></P><P><SPAN>PROC MEANS DATA=surveydata(where=(Scenario="S1" AND SpeakerGender="F")) ;<BR />CLASS SResponse;<BR />Var Comp OriginalSocial Abrasive GetRequest;<BR />RUN;<BR /></SPAN></P><P> </P>Wed, 09 Mar 2022 17:37:55 GMThttps://communities.sas.com/t5/Statistical-Procedures/Easy-way-to-calculate-Cohen-s-d/m-p/801152#M39387jowolfe792022-03-09T17:37:55ZEasy way to calculate Cohen's d
https://communities.sas.com/t5/Statistical-Procedures/Easy-way-to-calculate-Cohen-s-d/m-p/801120#M39385
<P>I am trying to calculate Cohen's d in SAS. This is such a common statistic, I do not understand why it is not available in SAS. I can calculate it by hand or using an online calculator like <A href="https://www.socscistatistics.com/effectsize/default3.aspx" target="_blank">https://www.socscistatistics.com/effectsize/default3.aspx</A></P><P> </P><P>But I will need to do it 100 times and am certain to make an error copying and pasting data.</P><P> </P><P>I found a macro for calculating effect size but I cannot get it to run.</P><P> </P><P>There must be simple code I can use to do the calculation in the above website within SAS. Any help is appreciated. Thank you!</P>Wed, 09 Mar 2022 16:32:18 GMThttps://communities.sas.com/t5/Statistical-Procedures/Easy-way-to-calculate-Cohen-s-d/m-p/801120#M39385jowolfe792022-03-09T16:32:18Z