Data visualization with SAS programming

Values option doesn't work

Reply
Occasional Contributor
Posts: 11

Values option doesn't work

Hi,

 

Why values x axis option can be not working? I'm using it with vline:

 

xaxis display = (nolabel) values=(1 to 30 by 1) offsetmin = 0.03 offsetmax = 0.03 valueattrs=( size=8pt );

vline col / response=scr stat=mean limitstat=stddev;

 

col and scr both are numeric, so it should be working, but sadly it's not. Any ideas?

Super User
Posts: 11,121

Re: Values option doesn't work

It may help to provide the full code, the log in case there are any messages, the actual results and a better description of the desired result. Also with graphics questions it often helps to post which version of SAS you are using as the options have changed rapidly with the last few releases.

 

Also "doesn't work" is bit vague. Please describe what doesn't work, do not get any output unexpected output, warning or errors?

SAS Super FREQ
Posts: 3,626

Re: Values option doesn't work

Here is code that works for me. Does this give what you want? If so, there is something wrong with your data:

 

proc sgplot data=sashelp.class;
  xaxis display = (nolabel) values=(10 to 18 by 0.5) 
        offsetmin = 0.03 offsetmax = 0.03 valueattrs=(size=8pt);
  vline age / response=height stat=mean limitstat=stddev;
run;
 
Occasional Contributor
Posts: 11

Re: Values option doesn't work

I'm using SAS 9.3. And it works that way with scatter or series (and from your example with vline), but for some reason doesn't work with vline. Under 'doesn't work' I mean it displays on the graph only those timepoints for wich data is available instead of showing all 30 timepoints. 

SAS Super FREQ
Posts: 1,139

Re: Values option doesn't work

As suggested by others, It will be easier to help if you add working code with sample data.

 

That said, SCATTER, SERIES treat numeric data is interval.  VLINE treats numeric data as DISCRETE.  Only the values in the data will show up on the axis (like a VBAR).  Also, there will not be any ordinal placement as these are treated merely as characters.  You should use VLINE only for discrete data like a VBAR.

Ask a Question
Discussion stats
  • 4 replies
  • 248 views
  • 0 likes
  • 4 in conversation