BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello wise people who know more than me! This is my first post and I don't even know if I am using the correct SAS procedure for what I need.

I am using GPLOT in SAS 9.1.3 to make plots of the type y-variable*x-variable, and using INTERPOL=JOIN to connect data points with a line.

Is there a way to introduce discontinuity in the line? That is, join up data points for x values of A, B and C and join up data points for x values of D, E and F without having the line join up C and D?
4 REPLIES 4
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Consider using OVERLAY, possibly also "subgroup", and assign unique SAS variable(s) in a DATA step to plot as needed based on your SAS input file conditions.

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic / post:

gplot subgroup overlay join data points site:sas.com
Cynthia_sas
SAS Super FREQ
Hi:
In addition to Scott's suggestions, investigate the SKIPMISS option with PROC GPLOT -- for example, in the data below, the month of June has an observation, but the value for EXPENSE is missing (.) and therefore, the SKIPMISS option tells PROC GPLOT that join should "skip" over the missing value with the line. If your data does not have an observation for June (for example), then the line would be drawn from May - July -- so you might have to put a "dummy" observation into your data for SKIPMISS to work, under that scenario.

cynthia
[pre]
** Missing Y Values;
data expense;
infile datalines;
input date : mmddyy10. expense dept $;
format date monyy5.;
return;
datalines;
01/15/2010 100000 Acct
02/15/2010 125000 Acct
03/15/2010 115000 Acct
04/15/2010 135000 Acct
05/15/2010 140000 Acct
06/15/2010 . Acct
07/15/2010 120000 Acct
08/15/2010 145000 Acct
09/15/2010 160000 Acct
10/15/2010 130000 Acct
11/15/2010 155000 Acct
12/15/2010 150000 Acct
;
run;

goptions reset=symbol;
symbol1 cv=blue value=dot i=join;
proc gplot data=work.expense;
plot expense * date / skipmiss;
run;
quit;
[/pre]
deleted_user
Not applicable
Thank you for your rapid response Scott and Cynthia. I will check it out.
deleted_user
Not applicable
Bless you Cynthia, SKIPMISS worked a treat!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 4 replies
  • 1020 views
  • 0 likes
  • 3 in conversation