<?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: 2SLS regression with fixed effects and clustered standard errors in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/753359#M4170</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/310226"&gt;@YIN_YI_JEN&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes. You&amp;nbsp;&lt;SPAN&gt;should put fixed effect variables (firm and year) in the MODEL statement indeed.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In another post on this communities site, I have found a link to an article that may be of interest to you in this context:&lt;/P&gt;
&lt;DIV class="media-heading work-details-title"&gt;Computing Clustered Standard Errors for Two-Stage Least Squares in SAS&lt;/DIV&gt;
&lt;P&gt;&lt;SPAN class="source"&gt;(2007)&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="author" style="font-family: inherit;"&gt;Tanguy Brachet&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="author-institution" style="font-family: inherit;"&gt;University of Pennsylvania&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="author-institution" style="font-family: inherit;"&gt;&lt;A href="https://works.bepress.com/tbrachet/2/" target="_blank"&gt;https://works.bepress.com/tbrachet/2/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="author-institution" style="font-family: inherit;"&gt;I haven't read the article so I don't have an opinion on the quality.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="author-institution" style="font-family: inherit;"&gt;Kind regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="author-institution" style="font-family: inherit;"&gt;Koen&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 10 Jul 2021 17:50:42 GMT</pubDate>
    <dc:creator>sbxkoenk</dc:creator>
    <dc:date>2021-07-10T17:50:42Z</dc:date>
    <item>
      <title>2SLS regression with fixed effects and clustered standard errors</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/752098#M4155</link>
      <description>&lt;P&gt;Hi, everyone. I have a panel data set like this:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;firm&lt;/TD&gt;&lt;TD&gt;year&lt;/TD&gt;&lt;TD&gt;early_refin&lt;/TD&gt;&lt;TD&gt;turn_call&lt;/TD&gt;&lt;TD&gt;asset&lt;/TD&gt;&lt;TD&gt;leverage&lt;/TD&gt;&lt;TD&gt;elimat&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1990&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;0.5&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;1991&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;0.5&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;1992&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;0.5&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BBB&lt;/TD&gt;&lt;TD&gt;1990&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;0.01&lt;/TD&gt;&lt;TD&gt;0.22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BBB&lt;/TD&gt;&lt;TD&gt;1991&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;0.01&lt;/TD&gt;&lt;TD&gt;0.22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BBB&lt;/TD&gt;&lt;TD&gt;1992&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;0.01&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CCC&lt;/TD&gt;&lt;TD&gt;1990&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;0.02&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CCC&lt;/TD&gt;&lt;TD&gt;1991&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;0.02&lt;/TD&gt;&lt;TD&gt;0.65&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CCC&lt;/TD&gt;&lt;TD&gt;1992&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;0.02&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;STRONG&gt;Column definition:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;early_refin - dependent variable of 1st stage (dummy variable)&lt;/P&gt;&lt;P&gt;turn_call -&amp;nbsp;instrument variable (dummy variable)&lt;/P&gt;&lt;P&gt;asset, leverage - control variables&lt;/P&gt;&lt;P&gt;elimat -&amp;nbsp;dependent variable of 2nd stage&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I have to run a two-stage least square regression with this data set.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The two-stage regression model&lt;/STRONG&gt; I want to run is as follows (simplified):&lt;/P&gt;&lt;P&gt;1st -&amp;nbsp;&lt;SPAN&gt;early_refin = A + B*turn_call + C*asset + D*leverage + e&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2nd -&amp;nbsp;&lt;SPAN&gt;elimat = a + b* estimated early_refin + c* asset + d*leverage + ϵ&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I also want to &lt;STRONG&gt;include firm fixed effects and year fixed effects&lt;/STRONG&gt; and &lt;STRONG&gt;cluster standard errors at firm level&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried PROC PANEL, but it seems that PROC PANEL cannot perform a 2SLS regression.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate if anyone could give me some ideas about how to finish this task.&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 14:57:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/752098#M4155</guid>
      <dc:creator>YIN_YI_JEN</dc:creator>
      <dc:date>2021-07-05T14:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: 2SLS regression with fixed effects and clustered standard errors</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/752154#M4156</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;PROC PANEL is indeed for panel data (time-series cross-sectional data) but it is for&amp;nbsp;single-equation models&amp;nbsp;with common pooled estimates of the coefficients of the explanatory variables.&lt;/P&gt;
&lt;P&gt;It has been more than a decade that I have used Two-Stage Least Squares Estimation (2SLS) with&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;"first-stage" &lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;&lt;EM&gt;instrumental variable regression&lt;/EM&gt;, but I remember you should do it with PROC MODEL (SAS/ETS) or PROC SYSLIN (SAS/ETS).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Both&amp;nbsp;PROC SYSLIN and PROC MODEL can deal with panel data.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Let me know if you can sort it out. If not, I can maybe spend a bit more time on it.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Good luck,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Koen&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 20:03:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/752154#M4156</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-07-05T20:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: 2SLS regression with fixed effects and clustered standard errors</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/753125#M4160</link>
      <description>&lt;P&gt;Hi Koen,&lt;/P&gt;&lt;P&gt;Thank you for your helpful advice.&lt;/P&gt;&lt;P&gt;The code I tried yesterday was as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc syslin data=panel_data	2SLS first;
by firm year;
endogenous early_refin;
instruments turn_call asset leverage;
model elimat = early_refin asset leverage;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I failed to get a result (all the parameter estimates displayed 0).&lt;/P&gt;&lt;P&gt;And also, I couldn't find an option where I could specify cluster standard errors at firm level in the documentation.&lt;BR /&gt;Do you have any idea about how to fix this?&lt;BR /&gt;Thank you so much for your help.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 12:31:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/753125#M4160</guid>
      <dc:creator>YIN_YI_JEN</dc:creator>
      <dc:date>2021-07-09T12:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: 2SLS regression with fixed effects and clustered standard errors</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/753337#M4167</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Very weird you are getting all the parameter estimates displayed as 0.&lt;/P&gt;
&lt;P&gt;Do you have a warning or a note in the LOG?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which SAS version are you using? If you have SAS VIYA and SAS Econometrics you can use PROC CPANEL. PROC CPANEL can fit instrumental variables (IV) regression models for panel data and maybe it can deal with&amp;nbsp;&lt;SPAN&gt;clustered standard errors as well (I haven't checked the latter yet). But many procedure in SAS can deal with&amp;nbsp;clustered standard errors so maybe PROC CPANEL has that capability too.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'm sorry that I am only now telling you about the existence of PROC CPANEL (CAS-enabled) but I have just discovered it myself thanks to your question.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Let me know if you have SAS Econometrics and PROC CPANEL.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Good luck,&lt;BR /&gt;Koen&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jul 2021 13:51:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/753337#M4167</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-07-10T13:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: 2SLS regression with fixed effects and clustered standard errors</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/753356#M4169</link>
      <description>&lt;P&gt;Hi Koen,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My program actually crashed down after running for a couple of minutes. I think there might be something wrong, or my data set is too large.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use SAS 9.4 and I don't have SAS Econometrics, so I cannot run PROC CPANEL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found PROC SURVEYREG quite useful. It can deal with both fixed effects and clustered standard errors, and I used two PROC SURVEYREGs to perform 2-stage regression.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*first stage;&lt;BR /&gt;&lt;BR /&gt;proc surveyreg data=panel_data;
class firm year;
cluster firm;
model early_refin = turn_call 
				asset
				leverage
				firm
				year
				/ adjrsq solution;
output out=firststage p=early_refi;
run;
&lt;BR /&gt;*second stage;
proc surveyreg data=firststage;
class firm year;
cluster firm;
model elimat = early_refi 
			asset
			leverage
			firm
			year
			/ adjrsq solution;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the result I got didn't match with the result my fellow got using R. The estimates are very different from hers, so I'm still looking for possible problems in my program.&lt;/P&gt;&lt;P&gt;I am not sure whether I should put fixed effect variables (firm and year) in the MODEL statement. The result without them in MODEL statement looks more similar with my fellow's, but I think they should be there. Do you have any idea about this?&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jul 2021 17:36:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/753356#M4169</guid>
      <dc:creator>YIN_YI_JEN</dc:creator>
      <dc:date>2021-07-10T17:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: 2SLS regression with fixed effects and clustered standard errors</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/753359#M4170</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/310226"&gt;@YIN_YI_JEN&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes. You&amp;nbsp;&lt;SPAN&gt;should put fixed effect variables (firm and year) in the MODEL statement indeed.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In another post on this communities site, I have found a link to an article that may be of interest to you in this context:&lt;/P&gt;
&lt;DIV class="media-heading work-details-title"&gt;Computing Clustered Standard Errors for Two-Stage Least Squares in SAS&lt;/DIV&gt;
&lt;P&gt;&lt;SPAN class="source"&gt;(2007)&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="author" style="font-family: inherit;"&gt;Tanguy Brachet&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="author-institution" style="font-family: inherit;"&gt;University of Pennsylvania&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="author-institution" style="font-family: inherit;"&gt;&lt;A href="https://works.bepress.com/tbrachet/2/" target="_blank"&gt;https://works.bepress.com/tbrachet/2/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="author-institution" style="font-family: inherit;"&gt;I haven't read the article so I don't have an opinion on the quality.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="author-institution" style="font-family: inherit;"&gt;Kind regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="author-institution" style="font-family: inherit;"&gt;Koen&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jul 2021 17:50:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/753359#M4170</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-07-10T17:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: 2SLS regression with fixed effects and clustered standard errors</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/753533#M4173</link>
      <description>&lt;P&gt;Hi Koen,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply and the useful information.&lt;/P&gt;&lt;P&gt;I'm trying the method provided in the document that you sent me as a link, but I don't understand what the author meant by "Estimate the structural equation as usual and save the 2SLS residuals (PROC SYSLIN)."&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2sls_2.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61137i6FAC557BC89CD018/image-size/large?v=v2&amp;amp;px=999" role="button" title="2sls_2.jpg" alt="2sls_2.jpg" /&gt;&lt;/span&gt;&lt;BR /&gt;Specifically, I would like to know how to correctly use PROC SYSLIN to do what the author stated. Could you provide me the code using PROC SYSLIN with the variables in my original post?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jul 2021 15:35:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/753533#M4173</guid>
      <dc:creator>YIN_YI_JEN</dc:creator>
      <dc:date>2021-07-12T15:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: 2SLS regression with fixed effects and clustered standard errors</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/753551#M4174</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I think I understand it.&lt;/P&gt;
&lt;P&gt;But my working day is over. Other commitments tonight.&lt;/P&gt;
&lt;P&gt;I will try to deliver you the PROC SYSLIN code tomorrow before EOB (Brussels time).&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jul 2021 17:05:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/753551#M4174</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-07-12T17:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: 2SLS regression with fixed effects and clustered standard errors</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/753663#M4175</link>
      <description>&lt;P&gt;Hi Koen,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No worries. I'm just working very hard to figure this out, because this is the last mile of my MA thesis.&lt;/P&gt;&lt;P&gt;I've been more than thankful for your constant and quick reply.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 05:42:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/753663#M4175</guid>
      <dc:creator>YIN_YI_JEN</dc:creator>
      <dc:date>2021-07-13T05:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: 2SLS regression with fixed effects and clustered standard errors</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/753848#M4181</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;gt;&amp;gt; Could you provide me the code using PROC SYSLIN with the variables in my original post?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you test this?&lt;/P&gt;
&lt;P&gt;Let me know if it works out for you!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc syslin data=panel_data	2SLS first out=work.pred;
by firm year;
endogenous early_refin;
instruments turn_call asset leverage;
model elimat = early_refin asset leverage;
output PREDICTED=abc RESIDUAL=xyz;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 18:07:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/753848#M4181</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-07-13T18:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: 2SLS regression with fixed effects and clustered standard errors</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/754317#M4184</link>
      <description>&lt;P&gt;Hi Koen,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code works when I drop the BY statement. Is the BY statement for fixed effects?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I'm trying PROC CPANEL which you've suggested before. Since I only have SAS 9.4, I'm looking for a way to start a CAS session. I was following the steps from a SAS tutorial on YouTube, but problems happened again.&lt;/P&gt;&lt;P&gt;The code I used to start a CAS session is as follows (totally the same as the tutorial):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path=/Users/lab433/Documents/SAS_dataset/RFS;
libname mycas "&amp;amp;path";
cas mySession sessopts=(caslib=casuser timeout=1800 locale="en_US");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, the log said&lt;/P&gt;&lt;P&gt;"A host name is required to start a session. Use the HOST= CAS statement option, CASHOST=system option, or the _CASHOST_ environment variable to set the host name."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After checking the SAS documentation, I still don't have any idea about what to specify after the HOST statement. Do you know how to start a CAS session within SAS 9.4?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate your kindness and help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 13:09:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/754317#M4184</guid>
      <dc:creator>YIN_YI_JEN</dc:creator>
      <dc:date>2021-07-15T13:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: 2SLS regression with fixed effects and clustered standard errors</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/754321#M4185</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/310226"&gt;@YIN_YI_JEN&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will tell you about what the BY-statement exactly is doing later today. Not much time now.&lt;/P&gt;
&lt;P&gt;Now that I look at your code again, I do not think you need a BY-statement.&lt;/P&gt;
&lt;P&gt;You need one big model and not as many models as there are BY-groups!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You cannot run PROC CPANEL (SAS Econometrics procedure) if you do not have SAS VIYA.&lt;/P&gt;
&lt;P&gt;There's no way to start a CAS session if you only have SAS 9.4.&lt;/P&gt;
&lt;P&gt;For CAS, you need SAS VIYA (or a co-existing SAS 9.4 + VIYA).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 13:24:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/754321#M4185</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-07-15T13:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: 2SLS regression with fixed effects and clustered standard errors</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/754369#M4187</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just signed up for SAS Viya trial, but I have difficulties "activating" the environment (starting a CAS session, creating a CASLIB, passing data to CAS, etc.), since I am new to Jupyter Notebook.&lt;/P&gt;&lt;P&gt;Could you provide me the code to do all those "settings" before I can run a PROC CPANEL? If it's too complicated, is there any "SAS Viya on Jupyter Notebook" tutorial that you recommend? (I haven't found one on YouTube yet.)&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 15:40:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/754369#M4187</guid>
      <dc:creator>YIN_YI_JEN</dc:creator>
      <dc:date>2021-07-15T15:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: 2SLS regression with fixed effects and clustered standard errors</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/754380#M4189</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/310226"&gt;@YIN_YI_JEN&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why are you using 'Jupyter Notebook' if it's new to you?&lt;/P&gt;
&lt;P&gt;In that case I would just use 'SAS Studio 5.x' in your preferred browser&lt;/P&gt;
&lt;P&gt;http(s)://SAS_VIYA_SERVER_NAME/SASStudioV&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you login to SAS Studio? ... then I will tell you in great detail how to do the things you want to accomplish.&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>Thu, 15 Jul 2021 16:24:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/754380#M4189</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-07-15T16:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: 2SLS regression with fixed effects and clustered standard errors</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/754462#M4190</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Can you get SAS Studio V to work?&lt;/P&gt;
&lt;P&gt;Or do you want to stick to Jupyter Notebook?&lt;/P&gt;
&lt;P&gt;The latter is also fine of course but I'm not that familiar with coding in&amp;nbsp;Jupyter Notebook. Only reading into it &lt;span class="lia-unicode-emoji" title=":face_with_rolling_eyes:"&gt;🙄&lt;/span&gt;.&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 23:19:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/754462#M4190</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-07-15T23:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: 2SLS regression with fixed effects and clustered standard errors</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/754479#M4191</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for my late reply. It was late night here in Taiwan then.&lt;/P&gt;&lt;P&gt;I think I've successfully logged into SAS Studio, but I don't know whether merely SAS Studio will work, or I need another thing called "SAS Studio V."&lt;/P&gt;&lt;P&gt;Thank you for your information. I thought I could only use Jupyter Notebook with SAS Viya trial. It's good to know that I don't &lt;span class="lia-unicode-emoji" title=":grinning_squinting_face:"&gt;😆&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 02:00:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/754479#M4191</guid>
      <dc:creator>YIN_YI_JEN</dc:creator>
      <dc:date>2021-07-16T02:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: 2SLS regression with fixed effects and clustered standard errors</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/754516#M4192</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hopefully you will get this before the weekend, there in Taiwan.&lt;/P&gt;
&lt;P&gt;SAS Studio V is just the version number. I am running&amp;nbsp;Release: 5.2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's what you do in SAS Studio:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;cas mySession sessopts=(caslib=casuser timeout=1800 locale="en_US");

caslib _all_ assign;

libname mycas cas caslib='casuser';

data mycas.my_data_set_in_memory;
 set mylib.my_data_set_on_disk;
run;

PROC CPANEL data=mycas.my_data_set_in_memory ...
...
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Good luck,&lt;/P&gt;
&lt;P&gt;Koen (Brussels area, Belgium)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 08:28:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/754516#M4192</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-07-16T08:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: 2SLS regression with fixed effects and clustered standard errors</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/754546#M4193</link>
      <description>&lt;P&gt;Hello Koen,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ran the code on SAS Studio and errors showed up.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1626432162262.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61294i69CCB67C47D39FFC/image-size/large?v=v2&amp;amp;px=999" role="button" title="1626432162262.jpg" alt="1626432162262.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Do I need to do something to tell SAS Studio that I want to use SAS Viya?&lt;/P&gt;&lt;P&gt;I just googled "SAS Studio", logged into my SAS account, and opened SAS Studio. Is there anything I need to do before running the code?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 10:46:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/754546#M4193</guid>
      <dc:creator>YIN_YI_JEN</dc:creator>
      <dc:date>2021-07-16T10:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: 2SLS regression with fixed effects and clustered standard errors</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/754554#M4194</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It should work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope your SAS Studio is approaching SAS VIYA and not SAS 9.4Mx.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you click on your profile icon in the top-right corner and select "about"?&lt;BR /&gt;It should give you a VIYA version.&lt;BR /&gt;For me it says (it's the server of the customer I'm now working for):&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VIYA.png" style="width: 591px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61295iEB49C42719BC3EE6/image-size/large?v=v2&amp;amp;px=999" role="button" title="VIYA.png" alt="VIYA.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 11:03:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/754554#M4194</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-07-16T11:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: 2SLS regression with fixed effects and clustered standard errors</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/754568#M4195</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think there isn't a profile button on my SAS Studio user interface.&lt;/P&gt;&lt;P&gt;This is how my SAS Studio looks like: (I'm sorry that it's automatically in Chinese for some reason)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1626435802075.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61296i72CE77BDC2A35DD3/image-size/large?v=v2&amp;amp;px=999" role="button" title="1626435802075.jpg" alt="1626435802075.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The top-right button is just a log-out button (登出).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The email I received right after I signed up for SAS Viya trial is here:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1626435854630.jpg" style="width: 540px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61297i490D2C36960CDD3E/image-size/large?v=v2&amp;amp;px=999" role="button" title="1626435854630.jpg" alt="1626435854630.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As I click on &lt;U&gt;Log in to your Trial Portal&lt;/U&gt;, it directs me to Jupyter Notebook. I hope that this portal is not the only way I can use Viya trial.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the main problem is that SAS Studio doesn't know I signed up for Viya trial. Do you know how to fix this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 12:02:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/2SLS-regression-with-fixed-effects-and-clustered-standard-errors/m-p/754568#M4195</guid>
      <dc:creator>YIN_YI_JEN</dc:creator>
      <dc:date>2021-07-16T12:02:42Z</dc:date>
    </item>
  </channel>
</rss>

