In a proc reg code like the following:
proc reg data=data1 PLOTS(MAXPOINTS=none);
model var = var2 /noint;
where var3="var5" ;
OUTPUT OUT=data2 p=yhat r=resid1 rstudent=rstud1 ucl=yhatupper lcl=yhatlower;
run;
How does sas calculate ucl and lcl? If I want to calculate these in Excel how can do it?
I don't mean to sound snarky, but asking how to calculate something in Excel when SAS already calculates it for you is like asking how to drive a chariot when you already own a Porsche.
SteveDenham
if you have to calculate it by yourself for your work then you have to try and understand it and be able to implement it in other software as well.
If you have SAS, why implement it in some other software? SAS has spent lots of man-hours debugging their code, and validating the code, and it has been tested in approximately 5,378,022 real-world applications, and it has also been validated by the FDA and probably others. If you write the code yourself, you aren't going to put the effort into it that SAS has put into it, and your self-written code can be more easily questioned and can be more easily incorrect.
Then do it by hand. The act of putting pencil to paper will do more to make this understandable than trying to write code that already exists in so many other places. If you need the values for future computations in Excel, then learning to export the values via ODS and a libname would be more apt to be usable.
SteveDenham
@adrfinance wrote:
if you have to calculate it by yourself for your work then you have to try and understand it and be able to implement it in other software as well.
From an academic standpoint I agree, and you should especially understand the difference between a confidence interval and a prediction interval.
You should do it at least once to understand it, that usually occurs in an introduction to linear regression math course. Regression CI are fairly standard so I wouldn't expect SAS implementation to be significantly different in any manner so using the formula's in any standard reference book is fine.
Here's an R example:
https://rstudio-pubs-static.s3.amazonaws.com/195401_20b3272a8bb04615ae7ee4c81d18ffb5.html
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.