BookmarkSubscribeRSS Feed
DinoPut
Obsidian | Level 7

Hi

 

I have been trying to create a hysteresis loop using Proc Template. Unfortunately, I couldn't find any sample code for it. The plot needs to have 'Mean response on Y-Axis, Concentration on X-axis & Time presented on the line as a loop. I would appreciate if someone could help me with a sample code. The hysteresis loop should look like below:

 

 

3 REPLIES 3
Reeza
Super User
Can you provide some sample data please.
Reeza
Super User

I don't think you need PROC TEMPLATE here, SGPLOT seems to work fine, as long as the data is what you need. 

 

data have;
input x y;
cards;
1 5
2 6
3 7
4 7.8
5 9
6 10
5 11
4 8
3 7.4 
2 6.5
1 5.5
;;;;
run;

proc sgplot data=have;
series x=x y=y / markers;
run;

@DinoPut wrote:

Hi

 

I have been trying to create a hysteresis loop using Proc Template. Unfortunately, I couldn't find any sample code for it. The plot needs to have 'Mean response on Y-Axis, Concentration on X-axis & Time presented on the line as a loop. I would appreciate if someone could help me with a sample code. The hysteresis loop should look like below:

 

 


 

Cynthia_sas
SAS Super FREQ

Hi:

  And, building on @Reeza's example, if you have a variable  called DRUG and another variable called LBL (with the data labels), you can use SGPANEL to produce something like this:

drug_chart_no_template.png

Without using PROC TEMPLATE. This does assume that all the data are in the one file. Here's how I imagined the data might be organized:

drug_data.png

 

Hope this helps,

Cynthia

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1518 views
  • 2 likes
  • 3 in conversation