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

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

1 ACCEPTED SOLUTION

Accepted Solutions
7 REPLIES 7
PaigeMiller
Diamond | Level 26

Use the NOCHART2 option

--
Paige Miller
Zard
SAS Employee

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;

Quentin
Super User

@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.  

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
bhr-q
Pyrite | Level 9
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.
Quentin
Super User

@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).

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
bhr-q
Pyrite | Level 9
Thank you so much for letting me know, I did just now, and it works. Great way to know.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 4847 views
  • 4 likes
  • 4 in conversation