BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Barkamih
Pyrite | Level 9

Hi guys 

I would like to plot four lactation curves on the same graph by pr, (PR) is a categorical number. which is represented observations that came from year one, two, three and four.

  

in my dataset, I have PR 1, 2,  3, and 4. 

 

this code that I have plottered all the PRS in one curve, 

 

How can I change this code to plot all the lactations in one place?

  proc nlin data = ALLfd method = marquardt;
parms A = 15 B = -0.19 C = 0.0012 ;
by pr  ;
AXIS1 ORDER = (5 TO 45 BY 5 );
model TEST_DAY_milk_kg = 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;
RUN;
proc gplot data=fit;
plot pred*time TEST_DAY_milk_kg*time/overlay VAXIS = AXIS1;
run;quit;

 

Kind regards 

 

Ibrahim 

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

You haven't provided an image of what you want, but try this:

 

proc sgplot data=fit;
series y=pred x=ttime / group=pr;
series y=TEST_DAY_milk_kg x=time / group=pr;
run;

View solution in original post

3 REPLIES 3
Rick_SAS
SAS Super FREQ

You haven't provided an image of what you want, but try this:

 

proc sgplot data=fit;
series y=pred x=ttime / group=pr;
series y=TEST_DAY_milk_kg x=time / group=pr;
run;
Barkamih
Pyrite | Level 9
										
    proc nlin data = fdfdfd method = marquardt;
  parms A = 15 B = -0.19 C = 0.0012 ;
      by pr  ;
	  AXIS1 ORDER = (0 TO 1 BY 0.1 );
  model TEST_DAY_fat_kg = A * Time **b * exp(-C*Time);
  output out = Fit predicted = pred ;
  symbol1 interpol= none value = star color= black;
symbol2 interpol = none value = none color = red;
 run;
QUIT;
proc sort data=fit; by time;
run;

proc sgplot data=fit;
series y=pred x=time / group=pr;
run;

Hi Pick_SAS 

this code has done everything that I  was looking for except this code can not appear my request, it is only present the default programme numbers. 

What do you think the issue is?

 

regards 

 

 

AXIS1 ORDER = (0 TO 1 BY 0.1 );

 

Rick_SAS
SAS Super FREQ

To change the ticks on the X axis, use the XAXIS statement:

proc sgplot data=fit;
series y=pred x=time / group=pr;
xaxis values=(0 to 1 by 0.1);
run;

Here is a link to the documentation of PROC SGPLOT. You can also search for questions online, such as 

     change ticks "proc sgplot" site:sas.com

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 3 replies
  • 797 views
  • 1 like
  • 2 in conversation