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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.