BookmarkSubscribeRSS Feed
annaabimbola
Calcite | Level 5

I'm want to create an XSchart 

 

this is the code I used but the chart was split into 5 instead of 1. The dates in my data are 09/01/2020, 10/01/2020, 11/01/2020, and so on. Do I need to include something that will make just 1 chart?

title "Length of Stay";
symbol v=dot;

proc shewhart data=work.nowsbaseline_sorted;
	xschart neonatald*measureperiodid;
run;

 

6 REPLIES 6
PaigeMiller
Diamond | Level 26

Try something like this

 

xschart neonatald*measureperiodid/haxis='01SEP2020'd to '01JUL2021'd by month;

You might also want to consider using a shorter format on the x-axis, for example assigning format YYMM5. to the x-axis variable, or using the TURNHLABELS option in PROC SHEWHART.

--
Paige Miller
annaabimbola
Calcite | Level 5

I tried that code but I got the same result.

 

PaigeMiller
Diamond | Level 26

Hello, @annaabimbola 

 

From now on, when code isn't working, SHOW US THE LOG (and from now on, do not wait until we request to see the log). We need to see the ENTIRE log for your PROC SHEWHART, all of it, 100%, every character of the log for PROC SHEWHART. Do not pick and choose parts of the PROC SHEWHART log to show us.

 

IMPORTANT INSTRUCTIONS: copy the log as text, then paste it into the window that appears when you click on the </> icon. DO NOT SKIP THIS STEP.

--
Paige Miller
annaabimbola
Calcite | Level 5
1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 72         
 73         
 74         title "Length of Stay";
 75         symbol v=dot;
 76         
 77         proc shewhart data=work.nowsbaseline_sorted;
 78         xschart neonatald*measureperiodid/haxis='01SEP2020'd to'01JUL2021'd by month;
 79         *xschart neonatald*measureperiodid;
 80         run;
 
 NOTE: Processing beginning for XSCHART statement number 1.
 ERROR: HAXIS values must be uniformly spaced.
 WARNING: Default axis scaling will be used.
 NOTE: Three-sigma limits are assumed.
 NOTE: TYPE=ESTIMATE is assumed for the process mean and standard deviation used to compute the control limits.
 NOTE: Since the format MMDDYY is associated with the subgroup variable MeasurePeriodID, it is assumed that the natural interval 
       between subgroup positions is one DAY.
 NOTE: The REPEAT option is assumed when a MMDDYY format is used with a subgroup variable.
 NOTE: There were 146 observations read from the data set WORK.NOWSBASELINE_SORTED.
 NOTE: PROCEDURE SHEWHART used (Total process time):
       real time           1.67 seconds
       user cpu time       0.79 seconds
       system cpu time     0.06 seconds
       memory              40867.59k
       OS Memory           71280.00k
       Timestamp           07/07/2021 08:46:54 PM
       Step Count                        44  Switch Count  0
       Page Faults                       0
       Page Reclaims                     13755
       Page Swaps                        0
       Voluntary Context Switches        1675
       Involuntary Context Switches      3
       Block Input Operations            0
       Block Output Operations           5176
       
 
 81         
 82         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 94         
PaigeMiller
Diamond | Level 26
ERROR: HAXIS values must be uniformly spaced.

Hmmm ... must be I mis-remembered that you can use months in PROC SHEWHART on the x-axis. It is kind of picky about things like that.

 

You can assign an integer index to each of your dates.

 

So, assign 01SEP2020 the index of 1, 01OCT2020 the index of 2, and so on. Then use this index as your horizontal axis variable. Also create a variable YEAR which contains 2020 and 2021, and a variable month which is 1 through 12 for each time period. Then

 

xschart neonatald*index (year month);

You can see examples here: https://documentation.sas.com/doc/en/qcug/15.2/qcug_shewhart_sect473.htm

 

--
Paige Miller
annaabimbola
Calcite | Level 5
Thank you, I'll try that.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 737 views
  • 0 likes
  • 2 in conversation