Hello,
I have a panel dataset with a number of firms over different dates. Assume the left hand side variable in the panel regression is called y. I am trying to run a panel regression using the inverse of the std.dev(y) as regression weight (and include time and firm fixed effects). Could anyone help how I can implement this in SAS?
I have been using proc panel to include the time and firm fixed effects as below, and I was hoping to add "weight" option in the code (similar to what we do in proc reg), but it seems there is no such option available for proc panel.
proc panel data=data PRINTFIXED;
id firm_id date;
model y = x1 x2 x3 / fixtwo ;
output out=est residual=residual predicted=predicted;
run;
Any help would be greatly appreciated.
PROC PANEL does not support WEIGHT statement as PROC REG does and there is no way to weight observations in estimation in PROC PANEL. However, if your concern is heteroskedasticity and you wanted to correct for heteroskedasticity, then there are alternative options you could consider other than to apply weights. PROC PANEL supports HCCME = option on the MODEL statement which allows you to obtain heteroskedasticity corrected covariance matrix of parameters. This option is discussed in the following section of documentation:
and details of HCCME:
In addition, SAS/STAT procedure PROC MIXED can also be used to fit some panel data models and PROC MIXED procedure does support WEIGHT statement similar to that in PROC REG. The following usage note provides some example codes to fit fixed and random effects models in PROC MIXED and PROC TSCSREG/PANEL:
http://support.sas.com/kb/22/851.html
I hope the above information is helpful.
Kathleen
This is just a wild-eyed guess, but you might look into using the INSTRUMENTS statement, with 1/sd defined in the dataset as a variable that gets included via the INSTRUMENTS statement. Best bet would be to follow @Ksharp 's advice and post in the Forecasting community.
SteveDenham
PROC PANEL does not support WEIGHT statement as PROC REG does and there is no way to weight observations in estimation in PROC PANEL. However, if your concern is heteroskedasticity and you wanted to correct for heteroskedasticity, then there are alternative options you could consider other than to apply weights. PROC PANEL supports HCCME = option on the MODEL statement which allows you to obtain heteroskedasticity corrected covariance matrix of parameters. This option is discussed in the following section of documentation:
and details of HCCME:
In addition, SAS/STAT procedure PROC MIXED can also be used to fit some panel data models and PROC MIXED procedure does support WEIGHT statement similar to that in PROC REG. The following usage note provides some example codes to fit fixed and random effects models in PROC MIXED and PROC TSCSREG/PANEL:
http://support.sas.com/kb/22/851.html
I hope the above information is helpful.
Kathleen
Hello,
To build upon the reply of @STAT_Kathleen
... if your concern is heteroskedasticity and you wanted to correct for heteroskedasticity, ...
I have just come across this interesting (recent) PROC PANEL usage note:
Usage Note 67322: Heteroscedasticity and cluster correction of standard errors using the PANEL procedure
Cheers,
Koen
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!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.