Using R to Fix Data Quality: Section 6

本文介绍如何使用比例控制图来监测生产过程中的异常波动,并通过实例演示了如何读取CSV文件中的数据,计算缺陷率的平均值及上下控制界限,最后绘制出控制图。

Section 6: Control Charts


Overview

A common issue in the field of process control and manufacturing is that how to find the sudden spike in productions. A control chart can make a view to show us which productions are different from others. In this section, we are going to talk about how to create a control chart.


Proportions Control Charts

There is more than one way to create a control chart. In this demo, we prefer to create a proportions control charts.

A reference of it: http://www.itl.nist.gov/div898/handbook/pmc/section3/pmc332.htm


Read CSV data

The data we are going to use in this demo is wafers.csv. As can be seen, there are two columns in the table. One is Sample.Number, and the other is Fraction.Defectives


> data = read.csv('wafers.csv')
> head(data)
  Sample.Number Fraction.Defectives
1             1                0.24
2             2                0.30
3             3                0.16
4             4                0.20
5             5                0.08
6             6                0.14


Count the mean of defectives:

> pbar=mean(data$Fraction.Defectives)

Count the upper control limit (UCL) and lower control limit (LCL):

> sd=sqrt((pbar*(1-pbar))/50)

> ucl=pbar +(3*sd)

> lcl=pbar-(3*sd)

Create the chart:

> plot(data$Fraction.Defectives, type="b", ylim=c(0,1), ylab="proportion defective")

> abline(h=pbar,lw=2)

> abline(h=ucl,lw=1)

> abline(h=lcl,lw=1)


Congratulations! You have completed your Control Chart.


Practice Question

1. Is there any process out of control? If so, which points?


2. What are the values of the UCL and LCL?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值