BookmarkSubscribeRSS Feed
asishgautam
Calcite | Level 5

hi all,

i have a data set arranged with the following columns:

Month Day Hour EndUse LoadElec LoadGas

I think the columns Month/Day/Hour are pretty self-explanatory.  The column "EndUse" has 13 categories (Lighting,Cooking,Hotwater,AC,Heating,....).  I would like to create a chart showing how the various end-uses contribute to daily load for each month-day.  I haven't been able to find an option that allows me although the cloest I got was a series plot with the column "EndUse" as a parameter to the Group= option.

7 REPLIES 7
art297
Opal | Level 21

Have you looked at the code on Robert Allison's page:

http://robslink.com/SAS/democd7/aaaindex.htm

asishgautam
Calcite | Level 5

thanks! i am curious as to why proc sgplot cannot handle something like this?

Rick_SAS
SAS Super FREQ

You might want to use PROC SORT to sort by EndUse and then use PROC MEANS to summarize the data for each Month+Day pair.

You can then use PROC SGPLOT to construct a line plot or PROC SGPANEL to construct a panel of line plots. See if the last two examples at http://blogs.sas.com/content/iml/2010/12/03/how-does-participation-in-social-media-vary-with-age/ are similar to what you want. If so, you can use the link in the first paragraph to download the program that created the plots.

DanH_sas
SAS Super FREQ

If you want to draw this as an area plot using the SG procedures, you can use the BAND plot to do it. Set the LOWER = 0 and the UPPER=<your varialble>. You can also set transparency on the plot so that you can see obscured areas.

Hope this helps!
Dan

Jay54
Meteorite | Level 14
asishgautam
Calcite | Level 5

awesome!!!

GraphGuy
Meteorite | Level 14

Rather than area (or band) plots, I tend to prefer stacked bar charts for this kind of thing.  You can make the space between the bars zero, so that there's no gap between the bars, which gives it the same visual effect of the area plot, but since you have discrete bar segments, you can easily add mouse-over text (and do things like placing labels on each of the bar segments, etc).  Bar charts also let you do easy "grouping", which might come in handy with you (day/hour) data.

Here is an example:

http://robslink.com/SAS/democd48/smartphones.htm

http://robslink.com/SAS/democd48/smartphones_info.htm

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
  • 7 replies
  • 1570 views
  • 6 likes
  • 6 in conversation