Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- How does SAS calculate lower and upper bounds in proc reg?

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 10-20-2020 11:09 AM
(1715 views)

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?

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Formulas are here:

https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.4&docsetId=statug&docsetTarget=statu...

I wouldn't recommend trying to calculate it manually unless you have no choice. If you need estimates for new predictions you can get those from PROC PLM or SCORE if not directly from PROC REG.

https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.4&docsetId=statug&docsetTarget=statu...

I wouldn't recommend trying to calculate it manually unless you have no choice. If you need estimates for new predictions you can get those from PROC PLM or SCORE if not directly from PROC REG.

7 REPLIES 7

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.4&docsetId=statug&docsetTarget=statu...

I wouldn't recommend trying to calculate it manually unless you have no choice. If you need estimates for new predictions you can get those from PROC PLM or SCORE if not directly from PROC REG.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

--

Paige Miller

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

just to understand how it is calculated. I am not doubting that SAS is right

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

@adrfinance wrote:

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

**SAS Innovate 2025** is scheduled for May 6-9 in Orlando, FL. Sign up to be **first to learn** about the agenda and registration!

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.