# Developing And X And R Chart For Quality Control

We do create different type of charts to fulfill our charting needs – quite a few of them are related to quality control purposes.  In this post we will learn how to plot a control chart for mean of a value i.e. value of a mean for some measureable quantity over time.

A little bit of theory on Statistical Quality Control:

Control chart is a statistical quality control technique to monitor the variability of a variable over a period of time. We usually monitor on two different lines for quality control:

- Monitoring Variables

- Monitoring Attributes

For this post, we will be studying charts for monitoring variables – X - Charts. X-Chart simply monitors the mean of a variable. The mean value in Statistics is represented by X, hence called mean charts.

In order to calculate where should we draw the boundaries…

We need some formulas from the statistics textbooks to proceed. Using Montgomery’s all known book on Statistical Quality Control (or just goggling it on web), we can have these formulas:

With all this information in hand we can easily plot an X chart

### The Sample Data:

In the attached sample sheet we have the sample data.

### Calculating Values:

We first need to calculate the sample means, and they are calculated by averaging the values in rows. For first sample we will average out and the values in for C4:G4 and will report it in H4. The formula we will use is:

=AVERAGE(C4:G4)

We will again average the values in the Column H to get the value of

=AVERAGE(H4:H17)

We will repeat the same steps with range – range is defined as the difference of the maximum and the minimum for each sample. Hence it can be calculated as:

=MAX(C4:G4)-MIN(C4:G4)

=AVERAGE(I4:I17)

The final table should look like.

### Finding UCL and LCL

We first need to find A­­­ that is available from various resources on internet, the value is found to be 0.577.

UCL =

= 1.31 + (0.577) x 0.28 = 1.47

LCL =

= 1.31 - (0.577) x 0.28 = 1.15

### Plotting Chart

That was all about the tricky statistics calculation, now we just need to create a chart. We will use a separate range of cells on the same sheet to plot four series, three created by UCL, and LCL and the last one being the averaged values for each sample i.e.

We will select an entire table in the range K3:017 to plot a Line Chart – the resulting following chart still need to be formatted to look more appealing:

The final chart looks like:

What we have done with this:

1. Adjust maximum and minimum values for Y axis to be 1.6 and 1.0 respectively.

2. Formatted all the four series to look different.

3. Marker option used for Average value series

4. Removed gridlines - horizontal

5. Chart Title Center and Above is used

6. Legend on the bottom of the chart

7. Selected chart area and bordered with same color as that of axis’s.

That is it; we have our X-Chart in place. We can also produce a R chart and other variation chart as well with this trick.
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://www.sheetzoom.com/Tips/developing-and-x-and-r-chart-for-quality-control", "fetch_time": 1674775265000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2023-06/segments/1674764494826.88/warc/CC-MAIN-20230126210844-20230127000844-00478.warc.gz", "warc_record_offset": 983988610, "warc_record_length": 11682, "token_count": 706, "char_count": 2999, "score": 4.375, "int_score": 4, "crawl": "CC-MAIN-2023-06", "snapshot_type": "latest", "language": "en", "language_score": 0.9093119502067566, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00050-of-00064.parquet"}