<?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: SAS and Stata return unacceptably different regression results in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/SAS-and-Stata-return-unacceptably-different-regression-results/m-p/789547#M4311</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The two way fixed effects model parameter estimates can be replicated by running a regression with dummy variables on both cross sections and time periods. You can verify the results from PROC PANEL by specifying the two way fixed effects model using PROC MIXED or PROC GLM. An example is given at the end of this message.&amp;nbsp; I do not have knowledge about STATA command to comment on whether you are specifying the same two way fixed effects model in STATA, but one thing you may want to check first is whether your STATA command is fitting a one way fixed effects model or a two way fixed effects model. In PROC PANEL, you can&amp;nbsp;use PRINTFIXED option in the MODEL statement to print out the fixed effects estimates on the cross sections and time periods dummies. Two way fixed effects model should produce fixed effects estimates for both cross sections and time periods. If you can do the same in STATA and print out the fixed effects estimates as well, that may be helpful for you to verify your model specified in STATA, and how they compare with the fixed effects estimates in PROC PANEL.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In any case, the following is an example replicating two way fixed effects model estimates from PROC PANEL using PROC MIXED and PROC GLM.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data a ;&lt;BR /&gt;&amp;nbsp; do cs = 1 to 5 ; &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;do ts = 1 to 15 ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x = normal(1) ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;y = 2+3*x + 2*cs + 0.5*ts + rannor(32);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;output;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end;&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods graphics off;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc panel data =a ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;id cs ts;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;model y = x /fixtwo printfixed ;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc mixed data = a ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; class cs ts ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; model y = x cs ts /solution;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc glm data = a ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; class cs ts ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; model y = x cs ts /solution;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jan 2022 17:43:49 GMT</pubDate>
    <dc:creator>SASCom1</dc:creator>
    <dc:date>2022-01-11T17:43:49Z</dc:date>
    <item>
      <title>SAS and Stata return unacceptably different regression results</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/SAS-and-Stata-return-unacceptably-different-regression-results/m-p/789003#M4306</link>
      <description>&lt;P&gt;I compare the results of a &lt;STRONG&gt;two-way fixed effects panel data regression&lt;/STRONG&gt; returned by &lt;STRONG&gt;SAS&lt;/STRONG&gt; and &lt;STRONG&gt;Stata&lt;/STRONG&gt; and find the they are completely different.&lt;/P&gt;&lt;P&gt;Here below are my SAS code and result screen shot, where &lt;STRONG&gt;bHHIs&lt;/STRONG&gt; is my variable of interest.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc panel data=ASSD.province_quarter_2015_12;
id Province TimeID;
model LoanNum = bHHIs population GDP deltaFIL_GDP / fixtwo;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="e7a8a7961d6e3b4f362a0dd95d77414.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67214i05A46A98D8F42A8C/image-size/large?v=v2&amp;amp;px=999" role="button" title="e7a8a7961d6e3b4f362a0dd95d77414.png" alt="e7a8a7961d6e3b4f362a0dd95d77414.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here below are screen shots of my stata settings and results, as currently I have not learned any codes of stata.&lt;/P&gt;&lt;P&gt;I choose Statistics -&amp;gt; Longitudinal/panel data -&amp;gt; Linear models -&amp;gt; Linear regression(FE, RE, PA, BE).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="屏幕截图 2022-01-08 100547.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67215i3AFBFB6993BA3116/image-size/large?v=v2&amp;amp;px=999" role="button" title="屏幕截图 2022-01-08 100547.png" alt="屏幕截图 2022-01-08 100547.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Regression settings:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="屏幕截图 2022-01-08 100306.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67216i24534A031E204657/image-size/large?v=v2&amp;amp;px=999" role="button" title="屏幕截图 2022-01-08 100306.png" alt="屏幕截图 2022-01-08 100306.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Panel settings:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="屏幕截图 2022-01-08 100353.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67217i9D2769048363B67A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="屏幕截图 2022-01-08 100353.png" alt="屏幕截图 2022-01-08 100353.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Automatically generated codes after submission:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="屏幕截图 2022-01-08 100626.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67218i49BCF6AEDEB94251/image-size/large?v=v2&amp;amp;px=999" role="button" title="屏幕截图 2022-01-08 100626.png" alt="屏幕截图 2022-01-08 100626.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And results:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="屏幕截图 2022-01-08 100645.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67219i4BBD54D75889D895/image-size/large?v=v2&amp;amp;px=999" role="button" title="屏幕截图 2022-01-08 100645.png" alt="屏幕截图 2022-01-08 100645.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As you can see, the coefficient of &lt;STRONG&gt;bHHIs&amp;nbsp;&lt;/STRONG&gt;flips the sign. Coefficients of other variables also change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Note: in SAS I use "province_quarter_2015_12" whereas in Stata&amp;nbsp; I use "province_quarter_2015_14". It's just because Stata does not accept string Panel ID so I change it into numbers.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jan 2022 23:52:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/SAS-and-Stata-return-unacceptably-different-regression-results/m-p/789003#M4306</guid>
      <dc:creator>applemonster</dc:creator>
      <dc:date>2022-01-07T23:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS and Stata return unacceptably different regression results</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/SAS-and-Stata-return-unacceptably-different-regression-results/m-p/789008#M4308</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have moved your question to this "Econometrics" board.&lt;/P&gt;
&lt;P&gt;Over here you have a better chance for an appropriate answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Calling for help by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/82879"&gt;@SASCom1&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jan 2022 01:06:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/SAS-and-Stata-return-unacceptably-different-regression-results/m-p/789008#M4308</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2022-01-08T01:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS and Stata return unacceptably different regression results</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/SAS-and-Stata-return-unacceptably-different-regression-results/m-p/789547#M4311</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The two way fixed effects model parameter estimates can be replicated by running a regression with dummy variables on both cross sections and time periods. You can verify the results from PROC PANEL by specifying the two way fixed effects model using PROC MIXED or PROC GLM. An example is given at the end of this message.&amp;nbsp; I do not have knowledge about STATA command to comment on whether you are specifying the same two way fixed effects model in STATA, but one thing you may want to check first is whether your STATA command is fitting a one way fixed effects model or a two way fixed effects model. In PROC PANEL, you can&amp;nbsp;use PRINTFIXED option in the MODEL statement to print out the fixed effects estimates on the cross sections and time periods dummies. Two way fixed effects model should produce fixed effects estimates for both cross sections and time periods. If you can do the same in STATA and print out the fixed effects estimates as well, that may be helpful for you to verify your model specified in STATA, and how they compare with the fixed effects estimates in PROC PANEL.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In any case, the following is an example replicating two way fixed effects model estimates from PROC PANEL using PROC MIXED and PROC GLM.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data a ;&lt;BR /&gt;&amp;nbsp; do cs = 1 to 5 ; &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;do ts = 1 to 15 ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x = normal(1) ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;y = 2+3*x + 2*cs + 0.5*ts + rannor(32);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;output;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end;&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods graphics off;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc panel data =a ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;id cs ts;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;model y = x /fixtwo printfixed ;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc mixed data = a ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; class cs ts ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; model y = x cs ts /solution;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc glm data = a ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; class cs ts ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; model y = x cs ts /solution;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 17:43:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/SAS-and-Stata-return-unacceptably-different-regression-results/m-p/789547#M4311</guid>
      <dc:creator>SASCom1</dc:creator>
      <dc:date>2022-01-11T17:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS and Stata return unacceptably different regression results</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/SAS-and-Stata-return-unacceptably-different-regression-results/m-p/806748#M4408</link>
      <description>&lt;P&gt;Thanks for the solution.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 12:26:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/SAS-and-Stata-return-unacceptably-different-regression-results/m-p/806748#M4408</guid>
      <dc:creator>NaomiSerrato</dc:creator>
      <dc:date>2022-04-08T12:26:08Z</dc:date>
    </item>
  </channel>
</rss>

