04-11-2012 08:23 AM
I have a plot produced by proc gplot. I now need to add on the case count to each data point. There are multiple cases with same value.
Does anyone know how to do this without creating new variables? I know I probably can do this by creating a new "count" variable and then use pointlabel.
Thanks in advance!
04-11-2012 10:14 AM
Or any other SAS procedures can create this type of line graph?
Basically, I have about 10+ time points, I want to graph out the mean value for each time point. Every time points may have from 1 to 100 cases.
04-11-2012 11:17 AM
hi ... there's most likely a nice looking SG solution too, but here's one for GPLOT ...
do x = 1 to 10;
y = ceil(100*ranuni(0));
if ranuni(0) lt .3 then output;
if ranuni(0) lt .2 then output;
if ranuni(0) lt .1 then output;
create view xy as select x,y,count(*) as count from test group by x,y;
goptions reset=all ftext='calibri' htext=2 gunit=pct;
symbol1 v='6c'x f='wingdings' h=2 c=blue pointlabel=(c=blue "#count");
proc gplot data=xy;
plot y*x / haxis=axis1;
04-11-2012 11:49 AM
With sgplot, Mike, the minimal would be
ods graphics on;
proc sgplot data=xy;
scatter x=x y=y / datalabel=count markerattrs=(symbol=circlefilled color=blue);
but i don't know yet if in sgplot the tickmarks are generated by the data or if we could regulate them by program
xaxis grid values=(1 to 10 by 1);
could render better but is limited as i don't see the possibility for minor tickmarks