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

Hi All, 

I've created a graphic showing results of an ITS showing the impact of an event on a population.  This works as I want it to extend the line stops with 2016, and I'd like it to connect with the refline noting the event.  Is this something I can do in my datalines or in the program below?

 

Data AimII_Table2;
input TimeElapsed Year Distress Event $;
datalines;
0 2011 3.7339771 Before
1 2012 3.8688698 Before
2 2013 3.8669976 Before
3 2014 3.5876379 Before
4 2015 3.64495 Before
5 2016 3.4850532 Before
6 2017 3.6610487 After
7 2018 3.5467001 After
;


Proc sgplot data=AimII_Table2;
Xaxis Values=(2011 TO 2018);
Yaxis Values=(1 TO 25);
reg x=Year y=Distress/group=Event ;
refline 2017 / axis=x label='Event' Transparency = 0.5;
Title'Distress over Time';
run;

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

You can modify the data. Note TimeElapsed=5 now appears twice, this causes the line to be extended to 2017.

 

Data AimII_Table2;
input TimeElapsed Year Distress Event $;
datalines;
0 2011 3.7339771 Before
1 2012 3.8688698 Before
2 2013 3.8669976 Before
3 2014 3.5876379 Before
4 2015 3.64495 Before
5 2016 3.4850532 Before
5 2017 3.4850532 Before
6 2017 3.6610487 After
7 2018 3.5467001 After
;
--
Paige Miller

View solution in original post

3 REPLIES 3
cmc_NYC
Fluorite | Level 6

Here is the graph as it currently appears. 

this might work.png

PaigeMiller
Diamond | Level 26

You can modify the data. Note TimeElapsed=5 now appears twice, this causes the line to be extended to 2017.

 

Data AimII_Table2;
input TimeElapsed Year Distress Event $;
datalines;
0 2011 3.7339771 Before
1 2012 3.8688698 Before
2 2013 3.8669976 Before
3 2014 3.5876379 Before
4 2015 3.64495 Before
5 2016 3.4850532 Before
5 2017 3.4850532 Before
6 2017 3.6610487 After
7 2018 3.5467001 After
;
--
Paige Miller
cmc_NYC
Fluorite | Level 6
Thank you!!!! That did it!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 624 views
  • 4 likes
  • 2 in conversation