### R code from vignette source 'chCapAnalysis.Rnw' ################################################### ### code chunk number 1: chCapAnalysis.Rnw:16-19 ################################################### # source("../../R/chOptions.R") # setwd("E:/eclipseprojects/SixSigma_Book/Book/chSweave/chCapAnalysis") #setwd("/media/Datos/R/workspace/SixSigma_Book/Book/chSweave/chCapAnalysis") ################################################### ### code chunk number 2: chCapAnalysis.Rnw:128-144 ################################################### curve(dnorm(x,10,.5),8,12, type="l", lty=2, ylab="frequency", las=1, xlab="Observed value of the characteristic", axes=FALSE) axis(side=1, labels=FALSE) axis(side=2, labels=FALSE) abline(v=11.5) abline(v=8.5) abline(v=10) abline(h=0) text(10.1,0.6,"T") text(8.8,0.6,"LSL") text(11.8,0.6,"USL") text(11,0.2,"Variation") box("outer") ################################################### ### code chunk number 3: chCapAnalysis.Rnw:179-198 ################################################### curve(2*x^2,-10,10, axes=FALSE, lty=2, ylab="Cost of Poor Quality", xlab="Observed value of the characteristic", lwd=2) axis(side=1, labels=FALSE) axis(side=2, labels=FALSE) abline(v=-8) abline(v=8) abline(v=0) abline(h=0) text(0.5,100,"T") text(-8.7,100,"LSL") text(8.7,100,"USL") lines(c(-11,-8.1),c(128,128), lty=3, lwd=3) lines(c(-8.1,-8.1),c(128,0.3), lty=3, lwd=3) lines(c(-8.1,8.1),c(0.3,0.3), lty=3, lwd=3) lines(c(8.1,8.1), c(0.3, 128), lty=3, lwd=3) lines(c(8.1,11), c(128,128), lty=3, lwd=3) box("outer") ################################################### ### code chunk number 4: chCapAnalysis.Rnw:236-237 ################################################### (1915 - 5) / 1915 ################################################### ### code chunk number 5: chCapAnalysis.Rnw:244-245 ################################################### (1915 - 5 - 12) / 1915 ################################################### ### code chunk number 6: chCapAnalysis.Rnw:279-280 ################################################### ((1915-3)/1915) * ((1915-12)/1915) * ((1915-5)/1915) ################################################### ### code chunk number 7: chCapAnalysis.Rnw:311-312 ################################################### 3 + 12 + 5 ################################################### ### code chunk number 8: chCapAnalysis.Rnw:318-319 ################################################### ((3 + 12 + 5) / 1915) * 10^6 ################################################### ### code chunk number 9: chCapAnalysis.Rnw:353-354 ################################################### ss.ca.yield(c(3, 5, 12), c(1, 2, 4), 1915) ################################################### ### code chunk number 10: chCapAnalysis.Rnw:448-453 ################################################### x<-c(755.81, 750.54, 751.05, 749.52, 749.21, 748.38, 748.11, 753.07, 749.56, 750.08, 747.16, 747.53, 749.22, 746.76, 747.64, 750.46, 749.27, 750.33, 750.26, 751.29) ss.ca.z(x,740,760) ################################################### ### code chunk number 11: chCapAnalysis.Rnw:490-495 ################################################### set.seed(66) m<-matrix(round(rnorm(20,750,2.5),digits=2)) colnames(m)<-c("Volume") ss.bookTable(m, tcaption="Data for the winery example", tlabel="tab:datawine") ################################################### ### code chunk number 12: chCapAnalysis.Rnw:512-524 ################################################### curve(dnorm(x), -5,5, type="l",lty=2, ylab="", xlab="Number of SD's", axes=FALSE, ylim=c(0,.6)) axis(side=1, labels=TRUE) abline(v=-3) abline(v=3) text(-3,.6,expression(mu*-3*sigma),pos=4) text(3,.6,expression(mu*+3*sigma),pos=2) arrows(c(-3,3),c(.5,.5),c(3,-3),c(.5,.5)) text(0,.45,"99.7% (Natural Tolerance Limits)", pos=1) box("outer") ################################################### ### code chunk number 13: chCapAnalysis.Rnw:573-575 ################################################### ss.ca.cp(x,740, 760) ss.ca.cpk(x,740, 760) ################################################### ### code chunk number 14: chCapAnalysis.Rnw:582-584 ################################################### ss.ca.cp(x, 740, 760, ci = TRUE) ss.ca.cpk(x, 740, 760, ci = TRUE) ################################################### ### code chunk number 15: ca ################################################### ss.study.ca(x, LSL = 740, USL = 760, Target = 750, alpha = 0.5, f.su = "Winery Project") ################################################### ### code chunk number 16: chCapAnalysis.Rnw:635-636 ################################################### ss.study.ca(x, LSL = 740, USL = 760, Target = 750, alpha = 0.5, f.su = "Winery Project")