BookmarkSubscribeRSS Feed
Barkamih
Pyrite | Level 9
proc nlin data = new method = marquardt;
  parms A = 15 B = -0.19 C = 0.0012 ;
      by pr  ;
  model TEST_DAY_PROT_PERCENT = A * Time **b * exp(-C*Time);
  output out = Fit predicted = pred ;
  symbol1 interpol= join value = star color= black;
symbol2 interpol = none value = none color = red;
 run;
QUIT;
proc sort data=fit; by time;

proc gplot data=fit;
title1' Lactation curves of milk fat and milk protein % ';
	plot pred*time TEST_DAY_PROT_PERCENT*time/overlay;
run;quit;

Hi guys,,,

I just wanted to know how to plot two curves from the same dataset on the same graph. 

this code has to plot only one curve for prot_percent, I wanna to plot fat_percent on the same graph, and all the data on the same dataset. (may dataset name is fit).

 

best regards 

 

Ibrahim 

 

1 REPLY 1
ballardw
Super User

It may be time to use the newer SG graphics procedures. SGPLOT makes it fairly easy to create multiple plots as you request as long as the x axis use the same variable.

 

proc sgplot data=fit;
title1' Lactation curves of milk fat and milk protein % ';
   series y=pred x=time;
   series y=TEST_DAY_PROT_PERCENT x=time;
   series y=Fat_PERCENT x=time;
run;

Lots of appearance options related to markers and colors to control

 

Use SCATTER instead of SERIES if you want points instead of connected points.

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1 reply
  • 2327 views
  • 4 likes
  • 2 in conversation