BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ibsulkim
Obsidian | Level 7

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
STAT_Kathleen
SAS Employee

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:

 

http://go.documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.4&docsetId=etsug&docsetTarget=etsu...

 

and details of HCCME:

 

http://go.documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.4&docsetId=etsug&docsetTarget=etsu...

 

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

View solution in original post

5 REPLIES 5
Ksharp
Super User
Better post it at Forecasting forum too, since proc panel is under SAS/ETS .
SteveDenham
Jade | Level 19

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

STAT_Kathleen
SAS Employee

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:

 

http://go.documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.4&docsetId=etsug&docsetTarget=etsu...

 

and details of HCCME:

 

http://go.documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.4&docsetId=etsug&docsetTarget=etsu...

 

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

sbxkoenk
SAS Super FREQ

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

67322 - Heteroscedasticity and cluster correction of standard errors using the PANEL procedure (sas....

 

Cheers,

Koen

ibsulkim
Obsidian | Level 7
Thank you very much Kathleen for prompt help and for sharing the links - they are all very helpful.
Proc mixed seems a solution in my case, and thanks for the link that directly compares between proc panel and proc mixed.

All the best.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 5 replies
  • 896 views
  • 5 likes
  • 5 in conversation