BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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.
2 REPLIES 2
deleted_user
Not applicable
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;
deleted_user
Not applicable
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;

sas-innovate-2024.png

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.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 3222 views
  • 0 likes
  • 1 in conversation