In: Statistics and Probability
Write a R code.
This question requires you to obtain FOUR different types of multivariate control charts for two datasets of your choice and interpret the results.
#Statistical Quality Control
SOLUTION:
X bar and R chart
library(qcc) #is the program to read the file in R
data=file.choose() #the code is used to choose a file from your
system
data=read.csv(data) #tye a data in a excel sheet and save as a csv
format
names(data)
pistonring=data[,-1] #the variable -1 denotes the last value of the
table
#.....X Bar Chart.......#
qcc(pistonring,type="xbar",nsigma=3)
#.....R Chart........#
qcc(pistonring,type="R",nsigma=3)
#.........S-CHART.......#
library(qcc)
data=file.choose()
data=read.csv(data)
names(data)
pistonring=data[,-1]
#......S Bar Chart.......#
qcc(pistonring,type="S",nsigma=3)
ex.42
#.........X-Bar And S-CHART ......#
library(qcc)
data=file.choose()
data=read.csv(data)
names(data)
transactiontime=data[,-1]
#....X Bar Chart.......#
qcc(transactiontime,type="xbar",nsigma=3)
#....S Bar Chart.......#
qcc(transactiontime,type="S",nsigma=3)
library(qcc)
#..........np Chart...........#
defectives=c(33,37,21,39,18,20,35,41,33,37,25,41,24,30,31,19,35,27,15,19)
samplesize=rep(100,20)
ceramic=data.frame(defectives,samplesize)
qcc(ceramic$defectives,sizes=ceramic$samplesize,type="np")
#................................#
library(qcc)
#..........np Chart...........#
defectives=c(425,430,216,341,225,322,280,306,337,305,356,402,216,264,126,409,193,326,280,389,451,420)
samplesize=rep(2000,22)
rubberbelt=data.frame(defectives,samplesize)
qcc(rubberbelt$defectives,sizes=rubberbelt$samplesize,type="np")
#................................#
library(qcc)
#............U chart.........#
defects=c(6,4,8,10,9,12,16,2,3,10,9,15,8,10,8,2,7,1,7,13)
samplesize=c(rep(50,20))
circuit=data.frame(defects,samplesize)
qcc(circuit[,1],size=circuit[,2],type="u",title="u chart for
circuit board defects")
library(qcc)
#............c chart.........#
defects=c(6,4,8,10,9,12,16,2,3,10,9,15,8,10,8,2,7,1,7,13)
samplesize=c(rep(50,20))
circuit=data.frame(defects,samplesize)
qcc(circuit[,1],size=circuit[,2],type="c",title="c chart for
circuit board defects")
Try the given coding coding in R console. And you can get a different types of charts. Here i given some data in the coding for understanding purpose. Use excel sheets type some data and store in a csv format and do in a r console as i discribed in a x bar and r chart.
: