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

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 (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
Quartz | Level 8
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 (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
Quartz | Level 8
Thank you so much for letting me know, I did just now, and it works. Great way to know.

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