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.
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 ;
model cost = production iv/ ivfixtwo printfixed robust;
should be able to give you the heteroskedasticity robust standard error with twoway fixed effects.
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?
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.