Hello, I want to create just Xbar chart for LOS(hours) quartely with 8 subgroups using SAS.,
I used XSCHART , it will give me both both X-bar and S charts together. Same for XR chart.
but I only want to have X-bar chart.
I also cannot use only xchart in my SAS code as xchart is used for individual data not for subgroup data.
How can I adjust my SAS code to see only the X-bar chart in my output?
proc shewhart data=MIS;
xSchart LOS*AdmitYYQ / Markers outtable=outtable ;
run;
Attached is the output to see both are in the same frame.
Thanks
Use the NOCHART2 option
You can use the NOCHART2 option in the XSCHART or the XRCHART statement to suppress the secondary chart.
proc shewhart data=MIS;
xSchart LOS*AdmitYYQ / Markers outtable=outtable nochart2;
run;
@bhr-q wrote:
I also cannot use only xchart in my SAS code as xchart is used for individual data not for subgroup data.
How can I adjust my SAS code to see only the X-bar chart in my output?
nochart2 is a fine solution. You could also use XCHART. XCHART in PROC SHEWHART is for subgroup means, the individual data chart is called an IRCHART.
@bhr-q wrote:
Thank you for the response, I actually tried Xchart, but doesn't work for the subgroup sample size greater than 25. so, I need to use nochart2.
If you use Xchart, by default it uses the subgroup range to estimate the process SD, with sample size greater than 25 you get an error, but it comes with a helpful suggestion:
ERROR: A subgroup sample size greater than 25 was encountered for process variable x. NOTE: Suggested alternatives are to subdivide the subgroups, or to base the control limits on subgroup standard deviations rather than subgroup ranges. NOTE: Use the STDDEVS option in an XCHART or MCHART statement to specify estimation of the process standard deviation from subgroup standard deviations rather than subgroup ranges.
So if you add the STDDEVS option, the XCHART will use subgroup SD to estimate the process SD, which is what an XSCHART does by default.
In my understanding,
xchart y*lot /stddevs ;
is equivalent to:
xschart y*lot /nochart2 ;
So, just two different ways to do the same thing (as often is available in SAS).
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.