BookmarkSubscribeRSS Feed
Calcite | Level 5


I am using proc panel to do some analysis.


proc panel outest=parms data = comgasfinal2 ;

id pa year;

model cngc_fs =  time1 gasprice gsp1 hddcon scgc sdgec pgep1 scgp1 sdgep1/ rantwo parks;

output out=panelout p=forecast;



I am not sure if its me or it's the procedure but I am not able to forecast the future values of the dependent variable. Procedures like proc reg allow automatic calculation of  the future values of the dependent variable. Is this a limitation of proc panel? If so, is there a macro that I can use to automatically generate the final equation for the parameters estimated by proc panel?


SAS Employee

Hello -

At this time, if you want to obtain out-of-sample forecast in PROC PANEL, you would  need to have observations for both dependent variable and independent variables for *at least some cross sections* which are needed to obtain estimate  for the time periods, and to obtain forecast for some cross sections that do not have observations for the dependent variable for some time periods, you will need to have observations for all the independent* variables for those periods.

This is what the documentation was referring to when talking about predictions with missing dependent variables, but unfortunately this requirement is not very clearly stated. You may want to output OUTEST data set and compute the predicted values yourself in a data step.



Calcite | Level 5

I don’t understand your answer.  I have observations for Cross-sections and independent variables until time T.  Then I have observations for the independent variables post-T.  How do I get predictions?

Even from OUTEST, how would I get predictions? Crosssection/Timeseries is not a simple formula. As asked above - " If so, is there a macro that I can use to automatically generate the final equation for the parameters estimated by proc panel?"

Calcite | Level 5

I've exactly done as you say, add 4 years more to my forecast sample and then I increase the ony independent variable making different scenarii. Also I leave dependent variable as missing but i have an error message.

Could you tell me if Proc panel can produde forecasts or not?


Thank you.

SAS Employee

I think you can get the predicted values in this way:

1) Remove post-T observations from the dataset in a data step;

2) Run proc panel to get the estimates with OUTEST option or capture parameter estimates beta_hat with ODS OUTPUT;

3) Calculate predicted value by the formula y_hat = x*beta_hat. You can use IML to calculate the formula.

Calcite | Level 5

Dear linxia


Your solution is not possible at least in an automatic or programme way, because the cross sectional values, that are necessary to use your solution of making the prediction "by hand" are not included in any out file.

Is there any elegant possibility to forecast using proc panel or not? Please give us a clear answer.

Thank you.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Multiple Linear Regression in SAS

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.

Discussion stats
  • 5 replies
  • 5 in conversation