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

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Re: How to show regression equation and calculate predicted value for ...

- 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 03-29-2016 08:46 PM
(14416 views)

so,fo example i have this results (PROC REG). now i have to show regresson equaton (which is y=0.33096x+1028.57177) on my graph. Moreover, i need find "y" for different x?

Thank you.

**Goal: Displaying Regression Equations in Fit Plots and use this equation to find "y" for certain x**

1 ACCEPTED SOLUTION

Accepted Solutions

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

You didn't say what version of SAS you are using, but here how to use PROC SGPLOT to display the slope and intercept of a regression line.

If you want to get REALLY fancy, you can use string concatenation to construct an "equation" and display the equation.

There are many ways to score a regression model. See examples and explanations in this article: Techniques for scoring a regression model in SAS

4 REPLIES 4

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

How are you making your graph? Where do you want to include equation?

Look at score and/or proc score to calculate predictions.

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

If you are plotting using SGPLOT, use INSET statement to show the equation. If you want the predicted y values for your data x values, then use an OUTPUT statement in PROC REG. You can also create the SAS code for the calculation of predicted values in a separate data step with the CODE statement in PROC REG.

PG

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

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

You didn't say what version of SAS you are using, but here how to use PROC SGPLOT to display the slope and intercept of a regression line.

If you want to get REALLY fancy, you can use string concatenation to construct an "equation" and display the equation.

There are many ways to score a regression model. See examples and explanations in this article: Techniques for scoring a regression model in SAS

**Don't miss out on SAS Innovate - Register now for the FREE Livestream!**

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

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.