Hi @Zard I have a panel data set (firm-year), and I would like to include firm and year fixed effects and cluster standard errors at firm level. I was trying PROC MIXED which you suggested, but in my case, I need to run a two stage regression, so I tried to output a data set where predicted estimates are included, so that I can regress on the predicted value in the second regression. However, I cannot find a statement that specifies outputting a data set with the predicted values in PROC MIXED. As there aren't a large number of cluster levels in my data set, I've also tried PROC SURVEYREG. My code is as follows: proc surveyreg data=panel_data;
class firm year;
cluster firm;
model early_refin = turn_call /*early_refin and turn_call are dummy variables*/
asset
leverage
firm
year
/ adjrsq solution;
output out=firststage p=predicted_value;
run;
proc surveyreg data=firststage;
class firm year;
cluster firm;
model elimat = predicted_value /*elimat is a dummy variable*/
asset
leverage
firm
year
/ adjrsq solution;
run; The PROC SURVEYREG code above runs well, but the result was totally different from the one I got using R. I can see that the algorithm differs from software to software, but I was wondering if this PROC SURVEYREG code did the same thing as I expected it to do. Could you give me some advice on how to perform my case (2SLS & firm and year fixed effects & cluster standard error at firm level) or how to adjust the code above to match my request? Thank you in advance.
... View more