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

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- plot predicted values

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-18-2009 06:01 PM

Hi All,

I ran a regression analysis that produced four different equations. I would like to produce one graphic using predicted values from the four equations.

Any help or advice is appreciated.

I ran a regression analysis that produced four different equations. I would like to produce one graphic using predicted values from the four equations.

Any help or advice is appreciated.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to deleted_user

08-19-2009 07:41 AM

You didn't say what PROC you are using. Assuming REG, the following code illustrates one approach (example with just two models but easily expanded) without any graph customizations:

proc reg data=test;

one: model y = x;

output out=pdata1 predicted=p1;

two: model y = x xsq;

output out=pdata2 predicted=p2;

run;

quit;

data plot;

merge pdata1 pdata2;

run;

proc gplot data=plot;

plot (p1 p2)*x/ overlay;

run;

quit;

proc reg data=test;

one: model y = x;

output out=pdata1 predicted=p1;

two: model y = x xsq;

output out=pdata2 predicted=p2;

run;

quit;

data plot;

merge pdata1 pdata2;

run;

proc gplot data=plot;

plot (p1 p2)*x/ overlay;

run;

quit;

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to deleted_user

08-19-2009 02:25 PM

Hi KMG,

Thanks for your answer. I appreciate it.

As I said, I got four equations (by M ) from the four different methods and I would like to plot the predicted values from all the four equations in one graph, join them and show the trends. With your proposal SAS disabled the By statement.

Fernando.

proc reg outest=est1 outsscp=sscp1 data=WDDGS.fractionsWDDGS24;

by M;

eq1: model Y=PS;

eq2: model Y=PS PSSQ / r cli clm;

plot predicted.*pssq;

plot Y*PSsq='a' predicted.*pssq='p' u95.*pssq='u' l95.*pssq='1' / overlay;

run;

quit;

Thanks for your answer. I appreciate it.

As I said, I got four equations (by M ) from the four different methods and I would like to plot the predicted values from all the four equations in one graph, join them and show the trends. With your proposal SAS disabled the By statement.

Fernando.

proc reg outest=est1 outsscp=sscp1 data=WDDGS.fractionsWDDGS24;

by M;

eq1: model Y=PS;

eq2: model Y=PS PSSQ / r cli clm;

plot predicted.*pssq;

plot Y*PSsq='a' predicted.*pssq='p' u95.*pssq='u' l95.*pssq='1' / overlay;

run;

quit;