<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Difference in the result of regressing when using Stata and  SAS ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Difference-in-the-result-of-regressing-when-using-Stata-and-SAS/m-p/739174#M230678</link>
    <description>&lt;P&gt;YR1991 is in the SAS output, but not in the STATA output. That may be a different parameterization of the model, which of course would result in different coefficients. Or maybe it's something different.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;The F-test in SAS has 44781 degrees of freedom in the numerator, but STATA shows only 33 degrees of freedom in the numerator of the F-test.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, these are not fitting the same model.&lt;/P&gt;</description>
    <pubDate>Wed, 05 May 2021 10:43:18 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-05-05T10:43:18Z</dc:date>
    <item>
      <title>Difference in the result of regressing when using Stata and  SAS ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Difference-in-the-result-of-regressing-when-using-Stata-and-SAS/m-p/739142#M230660</link>
      <description>&lt;P&gt;Hi all SAS Users,&lt;/P&gt;
&lt;P&gt;I am in a critical issue that when I use Stata and SAS, I have different results&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I want is that I want to run a Difference-in-Difference regression by using OLS with fixed effects (firms (TYPE) and years(yr)).&lt;/P&gt;
&lt;P&gt;My code in STATA is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;encode TYPE, generate(TYPE2)


areg wROE pt wTOT_ASS_TUR wFIRM_SIZE LNGDP UNEMPLOYMENT INFLATION wLEVERAGE pri_ove_ern i.yr, a(TYPE2)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My result by running in STATA is:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Phil_NZ_0-1620193874268.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59042i556761C84C39F852/image-size/large?v=v2&amp;amp;px=999" role="button" title="Phil_NZ_0-1620193874268.png" alt="Phil_NZ_0-1620193874268.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;As can be seen from the picture above,&lt;STRONG&gt; the coefficient of pt is 0.0026, positive&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;However, I replicate this regression in SAS by using the code below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glm data=merge_treat_con;
    ABSORB TYPE;
    class yr;
    model wROE= pt TOT_ASS_TUR wFIRM_SIZE LNGDP UNEMPLOYMENT INFLATION 
		 wLEVERAGE pri_ove_ear yr/solution ss3;
run;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It generates a WARNING but I hope it is not a critical mistake&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;WARNING: Formatted ABSORB values not sorted in ascending sequence.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And the result is as below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Phil_NZ_1-1620193990419.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59043i48D7F713BB456632/image-size/large?v=v2&amp;amp;px=999" role="button" title="Phil_NZ_1-1620193990419.png" alt="Phil_NZ_1-1620193990419.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Boom, the coefficient of pt now is &lt;STRONG&gt;-0.016&lt;/STRONG&gt;, negative.&lt;/P&gt;
&lt;P&gt;I am wondering which cause these difference and what is the way to get out of this situation?&lt;/P&gt;
&lt;P&gt;I highly appreciate any comment and suggestion. Thank you for spending time with me in advance.&lt;/P&gt;
&lt;P&gt;Warm regards.&lt;/P&gt;
&lt;P&gt;Phil.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 06:01:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Difference-in-the-result-of-regressing-when-using-Stata-and-SAS/m-p/739142#M230660</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-05-05T06:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in the result of regressing when using Stata and  SAS ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Difference-in-the-result-of-regressing-when-using-Stata-and-SAS/m-p/739174#M230678</link>
      <description>&lt;P&gt;YR1991 is in the SAS output, but not in the STATA output. That may be a different parameterization of the model, which of course would result in different coefficients. Or maybe it's something different.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;The F-test in SAS has 44781 degrees of freedom in the numerator, but STATA shows only 33 degrees of freedom in the numerator of the F-test.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, these are not fitting the same model.&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2021 10:43:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Difference-in-the-result-of-regressing-when-using-Stata-and-SAS/m-p/739174#M230678</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-05-05T10:43:18Z</dc:date>
    </item>
  </channel>
</rss>

