Hi
I have panel data and using the Instrumental Variable approach with 2SLS by using the following code:
proc syslin data=have 2sls first;
endogenous Female_Mgr;
instruments Change_Female_Population Grad MBA Fund_Ret Fund_Size Fund_Flow Fund_Age;
model Y = Female_Mgr Grad MBA Fund_Ret Fund_Size Fund_Flow Fund_Age ;
run;
Here endogenous variable is "Female_Mgr", a dummy variable and instrumental variable is "Change_female_population". This code works well. But I need to include "Year and Industry Fixed Effect" and "Huber-White Robust Standard Error" in 2SLS. I am struggling to find a code that can fulfill these requirements. Please help. Thanks.
Hi,
If you have sas viya 3.4 you can try PROC CPANEL. For example, if you have a panel data with id and time to be firm and year, dependent variable to be cost, independent variable to be production (endogenous) and iv, instrumental variable to be iv2, the code is following:
proc cpanel data = Electricity;
id firm year;
endogenous production ;
instruments iv2;
model cost = production iv/ ivfixtwo printfixed robust;
run;
should be able to give you the heteroskedasticity robust standard error with twoway fixed effects.
Hi,
From the PANEL related procs side, there's no other solution as far as I know.
PANEL and CPANEL can do that,
proc panel data = Electricity;
id firm year;
model cost = production iv/ hccme=0 cluster;
run;
will give clustered s.e clustering on firm.
Hi @Saba1,
I've been struggling to figure out the same problem as you did.
I would like to run a 2SLS regression on my panel data, and I also need to include firm and year fixed effects and cluster standard errors at firm level.
It's frustrated to find that similar problems posted on SAS community seems to end up being unsolved.
I was wondering if you eventually fixed this. If you did, could you tell me how?
Thank you.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.