<?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: the incompatibility of IVFIXTWO and HCCME in PROC CPANEL in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/the-incompatibility-of-IVFIXTWO-and-HCCME-in-PROC-CPANEL/m-p/757953#M4217</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While the CPANEL procedure supports 2SLS estimation method for panel data, the HCCME option as well as the CLUSTER option in the procedure are not supported for instrumental variable estimation method(the same for dynamic panel estimation method), and that is the reason why you get the error message that HCCME is not allowed for this model when you specify both the IVFIXONE and HCCME/CLUSTER option. For instrumental variable estimation method (and dynamic panel estimation method as well), you can use the ROBUST option instead to obtain robust covariance matrix:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_015/casecon/casecon_cpanel_syntax16.htm#casecon.cpanel.modelstmt_robust" target="_self"&gt;ROBUST&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The robust covariance matrix is robust to both heteroscedasticity and serial correlation, hence it is already clustered at cross sectional level. The formulas for robust covariance matrix for instrumental variable estimation method are discussed in the following section of documentation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_015/casecon/casecon_cpanel_details26.htm" target="_self"&gt;Instrumental Variables Regression&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In addition to the above, another thing I would like to point out is that, I noticed that in your code you commented that the endogenous variable early_refin is a dummy variable:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;endogenous early_refin;  /*early_refin is a dummy variable*/&lt;/LI-CODE&gt;
&lt;P&gt;Do you intend to treat the endogenous variable early-refin as continuous in your instrumental variable estimation, or do you want to treat this variable as binary discrete as it is? PROC PANEL (as well as PROC SYSLIN) is designed for continuous dependent variable models, and the endogenous variables in the 2SLS estimation are all treated as continuous. If you wanted to treat the endogenous variable on the right hand side of the equation as binary, then you may consider using PROC QLIM. PROC QLIM is designed for qualitative and limited dependent variable models, and it can address endogeneity by estimating joint likelihood of the structural model together with the reduced form model for the binary endogenous variable. You can specify fixed effects in PROC QLIM using the &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_015/etsug/etsug_qlim_syntax14.htm" target="_self"&gt;CLASS&lt;/A&gt; statement. PROC QLIM also supports tests for endogeneity with TEST statement and ENDOTEST option in the MODEL statement. The following section of PROC QLIM documentation discusses endogeneity and instrumental variables in models involving discrete and limited dependent and endogenous variables and tests for endogeneity supported in the QLIM procedure:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_015/etsug/etsug_qlim_details24.htm" target="_self"&gt;Endogeneity and Instrumental Variables&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And specifically, for a discussion on endogenous dummy variable models:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_015/etsug/etsug_qlim_details24.htm#etsug.qlim.qlimtrmteffdetail" target="_self"&gt;Endogenous Dummy Variable Models--Treatment Effects Regression&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, please note that the joint likelihood estimation method in PROC QLIM is not a 2SLS estimation method. PROC QLIM also does not support HCCME and CLUSTER option, but it does support COVEST = QML option in PROC QLIM statement to provide quasi-maximum likelihood estimates of covariance matrix, a sandwich estimator that is robust to some form of misspecification:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_015/etsug/etsug_qlim_syntax02.htm#etsug.qlim.qlimmodest" target="_self"&gt;COVEST = OP|HESSIAN|QML&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope the above information is helpful. If you have further questions, please let me know.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Jul 2021 22:05:22 GMT</pubDate>
    <dc:creator>SASCom1</dc:creator>
    <dc:date>2021-07-28T22:05:22Z</dc:date>
    <item>
      <title>the incompatibility of IVFIXTWO and HCCME in PROC CPANEL</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/the-incompatibility-of-IVFIXTWO-and-HCCME-in-PROC-CPANEL/m-p/756655#M4212</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to run a 2-stage least squares regression (2SLS) on my panel data, so I choose to use PROC CPANEL.&lt;/P&gt;&lt;P&gt;In my model, I need to include two fixed effects (firm and year) and cluster standard errors at firm level at the same time, so I run the following code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc cpanel data=casuser.entire;
id CUSIP year;
model elimat = early_refin firm_controls interest_controls / ivfixtwo hccme=3 cluster;
endogenous early_refin;  /*early_refin is a dummy variable*/
instruments turn_call;  /*turn_call is a dummy variable*/
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, the log tells me "&lt;SPAN&gt;ERROR: The HCCME option is not allowed for this model."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If I take out either IVFIXTWO or HCCME, it works, so I was wondering if there is an alternative for me to meet all the requirements in my model.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 15:05:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/the-incompatibility-of-IVFIXTWO-and-HCCME-in-PROC-CPANEL/m-p/756655#M4212</guid>
      <dc:creator>YIN_YI_JEN</dc:creator>
      <dc:date>2021-07-26T15:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: the incompatibility of IVFIXTWO and HCCME in PROC CPANEL</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/the-incompatibility-of-IVFIXTWO-and-HCCME-in-PROC-CPANEL/m-p/757953#M4217</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While the CPANEL procedure supports 2SLS estimation method for panel data, the HCCME option as well as the CLUSTER option in the procedure are not supported for instrumental variable estimation method(the same for dynamic panel estimation method), and that is the reason why you get the error message that HCCME is not allowed for this model when you specify both the IVFIXONE and HCCME/CLUSTER option. For instrumental variable estimation method (and dynamic panel estimation method as well), you can use the ROBUST option instead to obtain robust covariance matrix:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_015/casecon/casecon_cpanel_syntax16.htm#casecon.cpanel.modelstmt_robust" target="_self"&gt;ROBUST&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The robust covariance matrix is robust to both heteroscedasticity and serial correlation, hence it is already clustered at cross sectional level. The formulas for robust covariance matrix for instrumental variable estimation method are discussed in the following section of documentation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_015/casecon/casecon_cpanel_details26.htm" target="_self"&gt;Instrumental Variables Regression&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In addition to the above, another thing I would like to point out is that, I noticed that in your code you commented that the endogenous variable early_refin is a dummy variable:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;endogenous early_refin;  /*early_refin is a dummy variable*/&lt;/LI-CODE&gt;
&lt;P&gt;Do you intend to treat the endogenous variable early-refin as continuous in your instrumental variable estimation, or do you want to treat this variable as binary discrete as it is? PROC PANEL (as well as PROC SYSLIN) is designed for continuous dependent variable models, and the endogenous variables in the 2SLS estimation are all treated as continuous. If you wanted to treat the endogenous variable on the right hand side of the equation as binary, then you may consider using PROC QLIM. PROC QLIM is designed for qualitative and limited dependent variable models, and it can address endogeneity by estimating joint likelihood of the structural model together with the reduced form model for the binary endogenous variable. You can specify fixed effects in PROC QLIM using the &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_015/etsug/etsug_qlim_syntax14.htm" target="_self"&gt;CLASS&lt;/A&gt; statement. PROC QLIM also supports tests for endogeneity with TEST statement and ENDOTEST option in the MODEL statement. The following section of PROC QLIM documentation discusses endogeneity and instrumental variables in models involving discrete and limited dependent and endogenous variables and tests for endogeneity supported in the QLIM procedure:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_015/etsug/etsug_qlim_details24.htm" target="_self"&gt;Endogeneity and Instrumental Variables&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And specifically, for a discussion on endogenous dummy variable models:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_015/etsug/etsug_qlim_details24.htm#etsug.qlim.qlimtrmteffdetail" target="_self"&gt;Endogenous Dummy Variable Models--Treatment Effects Regression&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, please note that the joint likelihood estimation method in PROC QLIM is not a 2SLS estimation method. PROC QLIM also does not support HCCME and CLUSTER option, but it does support COVEST = QML option in PROC QLIM statement to provide quasi-maximum likelihood estimates of covariance matrix, a sandwich estimator that is robust to some form of misspecification:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_015/etsug/etsug_qlim_syntax02.htm#etsug.qlim.qlimmodest" target="_self"&gt;COVEST = OP|HESSIAN|QML&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope the above information is helpful. If you have further questions, please let me know.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 22:05:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/the-incompatibility-of-IVFIXTWO-and-HCCME-in-PROC-CPANEL/m-p/757953#M4217</guid>
      <dc:creator>SASCom1</dc:creator>
      <dc:date>2021-07-28T22:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: the incompatibility of IVFIXTWO and HCCME in PROC CPANEL</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/the-incompatibility-of-IVFIXTWO-and-HCCME-in-PROC-CPANEL/m-p/759047#M4221</link>
      <description>&lt;P&gt;Hello &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;This helps me a lot. Thank you so much for your detailed and clear explanation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to treat the endogenous variable (early_refin) as binary discrete. It seems that PROC QLIM is the closest one to what I need, but it is not a 2SLS estimation method. So is there any SAS procedure that can fulfill the following requirements at the same time?&lt;/P&gt;&lt;P&gt;(1) perform a 2SLS regression with a binary endogenous variable&lt;/P&gt;&lt;P&gt;(2) fix two effects&lt;/P&gt;&lt;P&gt;(3) cluster standard errors&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If there isn't, is there any alternative to do so in SAS?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 15:20:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/the-incompatibility-of-IVFIXTWO-and-HCCME-in-PROC-CPANEL/m-p/759047#M4221</guid>
      <dc:creator>YIN_YI_JEN</dc:creator>
      <dc:date>2021-08-03T15:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: the incompatibility of IVFIXTWO and HCCME in PROC CPANEL</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/the-incompatibility-of-IVFIXTWO-and-HCCME-in-PROC-CPANEL/m-p/759535#M4222</link>
      <description>&lt;P&gt;Hi&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;You are welcome. I am glad the information was helpful to you.&lt;/P&gt;
&lt;P&gt;I am afraid PROC QLIM does not provide 2SLS method for models involving binary endogenous variables with a probit equation. Within SAS procedures, you only have these two choices, either use linear 2SLS method with ROBUST covariance matrix in PROC CPANEL, or use PROC QLIM to specify probit equation for the binary endogenous variable and use maximum likelihood method with quasi-maximum likelihood covariance matrix. The linear 2SLS method essentially is specifying a linear probability model for the binary endogenous variable, i.e., prob(y2 = 1) = x*beta, while the probit equation in PROC QLIM specifies prob(y2=1) = Phi(x*beta), where Phi( ) is the normal cdf function.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 21:54:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/the-incompatibility-of-IVFIXTWO-and-HCCME-in-PROC-CPANEL/m-p/759535#M4222</guid>
      <dc:creator>SASCom1</dc:creator>
      <dc:date>2021-08-04T21:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: the incompatibility of IVFIXTWO and HCCME in PROC CPANEL</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/the-incompatibility-of-IVFIXTWO-and-HCCME-in-PROC-CPANEL/m-p/760152#M4223</link>
      <description>&lt;P&gt;Hello&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;I see. Thank you so much for your explanation.&lt;/P&gt;&lt;P&gt;I've been working so hard to find out the answer to this question. I am so happy that you tell me about this.&lt;/P&gt;&lt;P&gt;I think your first reply is very clear and highly informative, so I would like to take it as the solution to this post.&lt;/P&gt;&lt;P&gt;Thank you once again for your time &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Aug 2021 14:25:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/the-incompatibility-of-IVFIXTWO-and-HCCME-in-PROC-CPANEL/m-p/760152#M4223</guid>
      <dc:creator>YIN_YI_JEN</dc:creator>
      <dc:date>2021-08-07T14:25:23Z</dc:date>
    </item>
  </channel>
</rss>

