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
Diamond | Level 26

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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 2015 views
  • 2 likes
  • 3 in conversation