Hello,
I was wondering, how in the Proc Reg procedure can you simply predict a value, with a prediction interval, for a new observation? Such as, you run proc reg and get the regrssion equation, then I want to calculate the predicted value and prediction interval when x=5.5.
I am using SAS 9.4
proc reg data=regression;
model y= x
run;
Thank you,
Jeff S. O.
Easiest is often to include X (predictor) value(s) of interest with missing for the dependent variables.
Then either options on the Model Statement or create an output set:
Output out=want p=Ypredicted LCL=ylowerin LCLM=ylowermean UCL=yupperin UCLM=yuppermean;
Ypredicted would be the associated Predicted Y for any X, including the ones with missing Y, the LCL and LCLM do lower confidence limits for single obs or the mean and UCL UCLM for the upper.
Easiest is often to include X (predictor) value(s) of interest with missing for the dependent variables.
Then either options on the Model Statement or create an output set:
Output out=want p=Ypredicted LCL=ylowerin LCLM=ylowermean UCL=yupperin UCLM=yuppermean;
Ypredicted would be the associated Predicted Y for any X, including the ones with missing Y, the LCL and LCLM do lower confidence limits for single obs or the mean and UCL UCLM for the upper.
Thank you!
Look at Proc Score.
A quick and dirty method is to include the values in your original dataset but leave the dependent variable blank/missing.
Then use the output statement with the p= option to get the predicted values out.
To deploy a PROC REG model on new data , Look at PROC SCORE.
SAS/STAT(R) 14.1 User's Guide
The SCORE Procedure
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.