Data visualization with SAS programming

Plot rates and confidence intervals by year, grouped by day

Reply
Contributor
Posts: 60

Plot rates and confidence intervals by year, grouped by day

Hi,

 

I have this type of data:

 

Year  Trust  Weekend Rate Lower_95 Upper_95

2008 1 1 8.4 7.9 8.6

2008 1 0 7.4 6.9 7.6

.....

2008 2 1 9.4 7.1 10.6

2008 2 0 8.4 7.9 8.6

......

 

I want to plot rate (with 95% CI) by year grouped by weekend, different graph for each trust. I used this code:

 

proc sgpanel data=rate;

panelby trust/rows=3 novarname spacing=5;

colaxis min=2008 max=2014;

rowaxis min=0 max=15;

scatter y=rate x=year/group=weekend yerrorlower=lower_95 yerrorupper=upper_95;

series y=rate x=year/group=weekend;

run;

quit;

 

I would like to change line attributes and markers attributes, how can I do it? Is there any other way to draw similar graph?

 

Thanks

 

 

 

 

SAS Super FREQ
Posts: 3,420

Re: Plot rates and confidence intervals by year, grouped by day

Look into the HIGHLOW statement, which supports the LINEATTRS= option for specifying the line attributes.

You can use the HIGHLOW statement to plot the error bars, then use the SCATTER statement and the MARKERATTRS= option to overlay the estimate in the middle.

 

 You don't say HOW you want to change the attributes, but you might be interested in this article about how to set the marker and line attributes by using ODS style elements.

Ask a Question
Discussion stats
  • 1 reply
  • 235 views
  • 0 likes
  • 2 in conversation