09-23-2013 04:48 PM
From PROC LOGISTIC output, I had a dataset including predicted, lower and upper 95% confidence interval, and measurement (a continuous variable). How can I have a plot to show the confidence interval band in SAS v9.1?
09-23-2013 06:51 PM
I don't think the SG graphics are available in 9.1.3 so Gplot may be what you need.
Something like (asumes Measure is your horizontal axis).
proc gplot data=have;
plot lcl*measure predicted*measure ucl*measure /overlay
Or possibly something from
will be appropriate
Or if you want a legend and lines instead of areas transform data.
Data want (keep=measure plotval plottype);
Plotval=LCL; PlotType='LCL'; output;
Plotval=Predicted; PlotType='Predicted'; output;
Plotval=UCL; PlotType='UCL'; output;
symbol1 i=join c=red;
symbol2 i=join c=blue;
symbol3 i=join c=black;
/* may want to play with the colors and line type options on symbol as well*/
proc gplot data=want;
09-24-2013 10:54 AM
Thanks so much, Ballardw.
I am using the line option. There are two treatments, and how can I overlay these two groups? Also is there anyway to get shade between upper and lower interval in each group? Is it possible to get smooth lines?
09-24-2013 11:37 AM
To answer the last question first. Look at the interpolation options on the Symbol statement. The L1P L3P and L5P are some polynomial spline fits of different degrees of smoothness or SMnn where nn is 1 to 99, or Spline. All use different algorithms to smooth, I would experiment to see which ones appear to best fit for your use.
Since Gplot doesn't deal with transparency if the data are very similar and would overlap anything shading between the upper and lower bounds will only show the top layer clearly. That is why many users liked the introduction of the SG graphics and the GTL to allow transparency. I'm not sure of anyway with SAS 9.1 to get the type of overlay I think you're asking for though it may be possible with lots of coding using DSGI but you would likely need to do a lot of coding.
The AREAS option is what controls shading between lines. I don't use this much, it think mayber the areas=3 with the third example I provided and setting the symbol1 to the background color may be closer to what you want for one group but wouldn't work with two.
09-26-2013 09:39 AM
I will try as what you suggest after I have done the more urgent and newly assigned task for this project.
I will let you know how it turns out.
Thanks a lot!