I want to draw 8 curves on the same graph by using the following code. I have 4 groups of PR and 2 groups of FD inside each group of PR. This code working perfectly to draw for groups of PR. So, I'm looking for editing this code to have them all together on the same graph.
What should I do for this code?
PROC SORT DATA = FAT;
proc nlin data = FAT method = marquardt;
parms A = 15 B = -0.19 C = 0.0012 ;
by pr ;
model TEST_DAY_MILK_kg = A * Time **b * exp(-C*Time);
output out = Fitmilk predicted = MKG ;
symbol1 interpol= none value = star color= black;
symbol2 interpol = none value = none color = red;
proc sort data=fitmilk; by time;run;quit;
proc sgplot data=fitmilk;
series y=MKG x=time / group= pr ;
yaxis values = (0 TO 40 BY 5 );
xaxis values = (1 to 12 by 1);
One way would be to create a single variable that contains the information from both PR and FD such as concatenation and use that variable for the Group variable. That would be easily done in a data step before SGPLOT.
You may want to investigate using a DATTRMAP data set to control appearances of the groups such as having similar marker for the PR value but different color for the FD value so the relationships are easier to see if that is a desire.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.