Quantcast
Channel: All Developer posts
Viewing all articles
Browse latest Browse all 48378

Re: R Control Chart

$
0
0

RE : xBarChart

In true life scenario, I'd say the following data would probably be obtained as a result
of fancy mathemathic algorithm formula... though I'll leave that to Math PhDs...Smiley Happy
So for for simplicity I just added a list of subgroup manually...

So here we go...

#declare qcc library:

library(qcc)

# Load a mock list of 10 subgroup data manually:

sg1 <- c(1.397742,1.399917,1.278918,1.279828) # Fill in subgroup 1 data!
sg2 <- c(1.283877,1.307215,1.341566,1.396107) # Fill in subgroup 2 data!
sg3 <- c(1.313634,1.278839,1.242498,1.331201) # Fill in subgroup 3 data!
sg4 <- c(1.245943,1.303432,1.390168,1.298949) # Fill in subgroup 4 data!
sg5 <- c(1.188624,1.226905,1.217450,1.284127) # Fill in subgroup 5 data!
sg6 <- c(1.287875,1.283185,1.234186,1.314055) # Fill in subgroup 6 data!
sg7 <- c(1.276711,1.284376,1.305309,1.249184) # Fill in subgroup 7 data!
sg8 <- c(1.312219,1.297509,1.272367,1.371223) # Fill in subgroup 8 data!
sg9 <- c(1.378350,1.312981,1.381944,1.268875) # Fill in subgroup 9 data!
sg10 <- c(1.332196,1.268824,1.299608,1.329053) # Fill in subgroup 10 data!

# Include those subgroups into a my.data mock list through rbind

my.data <- rbind(sg1,sg2,sg3,sg4,sg5,sg6,sg7,sg8,sg9,sg10)

# Draw the R Chart and calculate relevant metrics

q1 <- qcc(my.data, type="R", nsigmas=3)

which should generate similar R chart:

RChart.png

then add following to ldraw the X-BAR chart...

# Draw the X-Bar Chart and calculate relevant metrics
q2 <- qcc(my.data, type="xbar", nsigmas=3)

which should generate following X-Bar Chart:
xBar.png

Finally:

# Establish the LSL and USL as set by customer specs, then
# draw the process capability chart and calculate metrics:

lsl <- 1.31 # Fill in a mock LSL here!
usl <- 1.32 # Fill in a mock USL here!

process.capability(q2, spec.limits=c(lsl,usl))

which should end up with following:
ProcessCap.png

Hope this helps...


Viewing all articles
Browse latest Browse all 48378

Trending Articles