BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
bhr-q
Pyrite | Level 9

Hi everyone,

I can see all the markers in the plot, but the corresponding admission dates on the x-axis are not fully visible. How can I adjust to see every admission date?

 

proc shewhart data=VV;
xchart   LOS*admission_date  /Markers   outtable=outtable    nohlabel   TOTPANELS=1;
run;proc print;run;

 

Thanks,

 

1 ACCEPTED SOLUTION

Accepted Solutions
Zard
SAS Employee
If you split dates up into Year, Month, and Day and use Day as the group var while blocking on Year and Month, it can help to fit more labels. Such as:
data vv ;
  format admission_date date9.;
  do admission_date='05Mar2023'd to '15Mar2024'd;
    do i=1 to 5;
      los=10+3*rand('normal');
      output ;
    end ;
  end ;
  drop i;
run ;
proc shewhart data=VV;
  Xchart LOS*admission_date /Markers totpanels=1;
run;

Zard_0-1715358985921.png

data vv;
  set vv;
  year=year(admission_date);
  month=month(admission_date);
  day=day(admission_date);
  charday=put(day,2.); *use a character subgroup var, otherwise DAY is required to be sorted;
run;
proc shewhart data=VV;
  Xchart LOS*charday(month year) /Markers totpanels=5;
run;
(showing 1st of 5 panels)

Zard_2-1715359105097.png

 

 

View solution in original post

7 REPLIES 7
Quentin
Super User

Are you getting a note in the log saying some of your tick value labels were "thinned"?  If there are too many tick labels SAS will typically try to rotate them, but after that will thin them so they don't collide.  You could maybe try shrinking the font (probably in style template), if you're close to fitting.  But typically I just live with the thinning, and perhaps add minor tick marks in between the labeled major tick marks. 

 

In the off chance that you're using HTML output, you can add "tips" to each marker, where a user can hove over a marker and it will show you the x-value.

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.
bhr-q
Pyrite | Level 9

Thank you for your answer; Log is usual, and I don’t get a note in the log saying some of the tick value labels were too "thinned."

There are not too many tick labels. I can see just 11 out of 23.

 

I tried this way but still showed me the 11 label

proc shewhart data=VV;

   Xchart LOS*admission_date /Markers outtable=outtable nohlabel  TOTPANELS=1  Hminor=23 ;

run;proc print;run;

Quentin
Super User

I guess SHEWHART is silently thinning.  The docs for HAXIS option say:

Quentin_0-1715353752782.png

You could try adding TURNHLABELS, and see if you get lucky, e.g.:

data vv ;
  do admission_date=1 to 30 ;
    do los=10 to 30 by 10 ;
      output ;
    end ;
  end ;
run ;
proc shewhart data=VV;
   Xchart LOS*admission_date /Markers turnhlabels haxis=1 to 30 by 1;
run;

 

 

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.
ballardw
Super User

From discussion in  https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927782#M4... it appeared that @bhr-q does not have SAS/Graph.

 

Which means that HAXIS= <anything> is likely not going to work as that looks like SAS/Graph syntax.

 

Might try using ODS GRAPHICS / width= 10in; (or similar) option to make the graph larger which might allow more ticks and labels to display. At least it is quick to test.

 

bhr-q
Pyrite | Level 9
Thank you for your answer, I tried this way just made my plot wider.
bhr-q
Pyrite | Level 9
I could get the answer with this way as well. Thank you for your help.
Zard
SAS Employee
If you split dates up into Year, Month, and Day and use Day as the group var while blocking on Year and Month, it can help to fit more labels. Such as:
data vv ;
  format admission_date date9.;
  do admission_date='05Mar2023'd to '15Mar2024'd;
    do i=1 to 5;
      los=10+3*rand('normal');
      output ;
    end ;
  end ;
  drop i;
run ;
proc shewhart data=VV;
  Xchart LOS*admission_date /Markers totpanels=1;
run;

Zard_0-1715358985921.png

data vv;
  set vv;
  year=year(admission_date);
  month=month(admission_date);
  day=day(admission_date);
  charday=put(day,2.); *use a character subgroup var, otherwise DAY is required to be sorted;
run;
proc shewhart data=VV;
  Xchart LOS*charday(month year) /Markers totpanels=5;
run;
(showing 1st of 5 panels)

Zard_2-1715359105097.png

 

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 1045 views
  • 6 likes
  • 4 in conversation