cbing Tracker
https://communities.sas.com/kntur85557/tracker
cbing TrackerMon, 20 May 2024 15:16:44 GMT2024-05-20T15:16:44ZRe: OLS regression with mean differences
https://communities.sas.com/t5/Statistical-Procedures/OLS-regression-with-mean-differences/m-p/462921#M24131
<P>I believe the attached image is exactly what I need, however, the replication I am doing had used OLS regression so I'm not sure if the GLIMMIX is acceptable. I will try the genmod code suggested, but I was told that is not the same as OLS. </P><P> </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2018-05-16 at 10.04.03 PM.png" style="width: 600px;"><img src="https://communities.sas.com/t5/image/serverpage/image-id/20590i997A91D855A9CE99/image-size/large?v=v2&px=999" role="button" title="Screen Shot 2018-05-16 at 10.04.03 PM.png" alt="Screen Shot 2018-05-16 at 10.04.03 PM.png" /></span></P>Thu, 17 May 2018 02:06:13 GMThttps://communities.sas.com/t5/Statistical-Procedures/OLS-regression-with-mean-differences/m-p/462921#M24131cbing2018-05-17T02:06:13ZRe: Dummy variables for very large data set
https://communities.sas.com/t5/SAS-Procedures/Dummy-variables-for-very-large-data-set/m-p/462916#M70418
<P>I am doing a replication, and quite frankly, I don't know why the dummy variable is being used. I used the product type as an example, but I realize that was a bad choice. It is actually a numeric variable with product types being depicted as numbers (e.g., product type 33 which actually means "food," but the 33 is in numeric form in the data set; I apologize for the vagueness in this example, I thought it'd be clearer using the character values instead of saying I need 33=1, 39=2, and so forth since the values are not continuous 33, 34, 35, etc.). In the study I'm trying to replicate, they used dummy variables for the product type (though I'm unsure why, but I assume there's a reason that would affect my results?). The product type is meant to be a control variable, but from what I understand it functions just like any other independent variable. I can run a regular OLS regression with the variable as-is, without the dummy variables, but I'm not getting the correct results - they are actually way off, not just a little bit. So I was trying to figure out another way.</P><P> </P><P>From my regression I ultimately need the interaction term coefficients for the two groups (part of the interaction term in the equation below), and then their mean differences for each year.</P><P> </P><P>model: DV = Year Year*Group ProductType</P><P> </P><P>The previous codes I used to try and do the dummy variables include proc glmmod, and I also tried a macro code, but I no longer have the code because it was a mess and not what I needed. </P>Thu, 17 May 2018 01:02:38 GMThttps://communities.sas.com/t5/SAS-Procedures/Dummy-variables-for-very-large-data-set/m-p/462916#M70418cbing2018-05-17T01:02:38ZRe: OLS regression with mean differences
https://communities.sas.com/t5/Statistical-Procedures/OLS-regression-with-mean-differences/m-p/462915#M24129
<P>I don't believe this is giving me what I need. I'm doing a replication with not a lot of instruction. I need to produce the interaction term coefficients for the two groups for each year. I then need the "mean difference." I'm a little unclear of what that means. But I need the mean difference and standard error of the interaction term for each year. Something like this:</P><P> </P><P>1990 3.2</P><P> (.05)</P><P> </P><P>1991 2.8</P><P> (.031)</P><P> </P><P>1992 1.19</P><P> (.28)</P><P> </P><P>Even if it doesn't look quite like this layout, I just need the information. I hope this makes sense. </P>Thu, 17 May 2018 00:46:04 GMThttps://communities.sas.com/t5/Statistical-Procedures/OLS-regression-with-mean-differences/m-p/462915#M24129cbing2018-05-17T00:46:04ZDummy variables for very large data set
https://communities.sas.com/t5/SAS-Procedures/Dummy-variables-for-very-large-data-set/m-p/462547#M70401
<P>I have a large data set (thousands of observations) and I have a variable with 200 different values. I need to create a dummy variable where each value takes a number (e.g., the variable is Product Type and I need a new dummy variable where Product Type "food" is classified as 1, Type "linens" is 2, etc.). So the dummy variable would have numbers from 1 - 200 representing each product type. The problem is, because the data set is so large, every procedure I try to use causes SAS to completely freeze after running forever. </P><P> </P><P>What might be the best (and easiest) way to accomplish this? </P>Wed, 16 May 2018 03:01:15 GMThttps://communities.sas.com/t5/SAS-Procedures/Dummy-variables-for-very-large-data-set/m-p/462547#M70401cbing2018-05-16T03:01:15ZOLS regression with mean differences
https://communities.sas.com/t5/Statistical-Procedures/OLS-regression-with-mean-differences/m-p/462545#M24116
<P>I have a very large data set that I am trying to run an OLS regression on. I have two IV's and an interaction term regressing on one DV. I know how to do a basic proc reg; the problem is that I also need a table of mean differences (I believe this may be the Diff in Diff equation). </P><P> </P><P>I have one IV that is binary, identifying two different "groups" within my data set, and I need to compare the mean coefficient differences between the groups for various years using an interaction term yearXgroup with a control variable.</P><P> </P><P>IThe structure of the regression equation looks something like: DV = Sum(Year + Year*Group) + Sum IV3(Control)</P><P>I need to compare the coefficient mean differences for the two groups. I hope that makes sense.</P><P> </P><P>I was unable to do the diff estimate in proc reg, so I was trying with proc genmod; this allowed me to get difference estimates but the coefficient mean differences don't seem right. I'm also confused what exactly proc genmod is doing, if it is an OLS regression or something else. Any help is greatly appreciated. My current code is:</P><P> </P><P>proc genmod data=have;<BR />class year group IV3;<BR />model DV = year year*group IV3; <------ I'm not sure this set-up is accurate per the equation above<BR />estimate "Diff in Diff" <SPAN>year*group</SPAN> 1 -1 -1 1;<BR />lsmeans <SPAN>year*group</SPAN> / diff; <-------- This is the difference table I am in need of<BR />lsmestimate year "Diff in Diff" 1 -1 -1 1;<BR />run;<BR />quit;</P>Wed, 16 May 2018 02:55:39 GMThttps://communities.sas.com/t5/Statistical-Procedures/OLS-regression-with-mean-differences/m-p/462545#M24116cbing2018-05-16T02:55:39Z