Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 4

> Dataset7 <- readXL("C:/Users/qstef/Downloads/calidad.

xls", rownames=FALSE,
header=TRUE, na="", sheet="Peso",
+ stringsAsFactors=TRUE)

> install.packages("qcc")
--- Please select a CRAN mirror for use in this session ---
package 'qcc' successfully unpacked and MD5 sums checked

The downloaded binary packages are in


C:\Users\qstef\AppData\Local\Temp\Rtmpu2EmuE\downloaded_packages

> library(qcc)

> data(peso)

> head(peso)

> data(calidad)

> head(calidad)

> data(dataset7)

> head(dataset7)

> data(dataset7)

> data(Dataset7)

> head(Dataset7)
Muestra Peso
1 1 12.02
2 1 12.15
3 1 12.10
4 1 12.20
5 1 12.12
6 2 12.14

> peso=with(Dataset7,qcc.groups(peso,muestra))

> head(peso)

> Peso = with(Dataset7,qcc.groups(Peso,Muestra))

> head(Peso)
[,1] [,2] [,3] [,4] [,5]
1 12.02 12.15 12.10 12.20 12.12
2 12.14 12.07 11.99 11.98 12.02
3 12.04 12.09 12.20 12.05 12.24
4 12.14 12.25 12.09 12.07 11.96
5 12.17 12.04 11.97 11.88 12.05
6 11.90 11.91 12.05 12.07 11.86

> q1 = qcc(Peso, type="xbar")

> summary(q1)

Call:
qcc(data = Peso, type = "xbar")

xbar chart for Peso

Summary of group statistics:


Min. 1st Qu. Median Mean 3rd Qu. Max.
11.86400 11.96800 12.06800 12.05411 12.12850 12.21200

Group sample size: 5


Number of groups: 18
Center of group statistics: 12.05411
Standard deviation: 0.09195567

Control limits:
LCL UCL
11.93074 12.17748

> q2 = qcc(Peso, type="R")

> summary(q2)

Call:
qcc(data = Peso, type = "R")

R chart for Peso

Summary of group statistics:


Min. 1st Qu. Median Mean 3rd Qu. Max.
0.0900000 0.1600000 0.2000000 0.2138889 0.2825000 0.3800000

Group sample size: 5


Number of groups: 18
Center of group statistics: 0.2138889
Standard deviation: 0.09195567

Control limits:
LCL UCL
0 0.4522616

> Dataset8 <- readXL("C:/Users/qstef/Downloads/calidad.xls", rownames=FALSE,


header=TRUE, na="", sheet="porcentaje",
+ stringsAsFactors=TRUE)

> Defectos <- readXL("C:/Users/qstef/Downloads/calidad.xls", rownames=FALSE,


header=TRUE, na="", sheet="defectos",
+ stringsAsFactors=TRUE)

> data(Dataset8)

> head(Dataset8)
Muestra D n
1 1 7 50
2 2 5 50
3 3 5 50
4 4 9 50
5 5 3 50
6 6 6 50

> attach(Dataset8)
> q3 = qcc(x, n, type="p")

> summary(q3)

> q3 = qcc(D, n, type="p")

> summary(q3)

Call:
qcc(data = D, type = "p", sizes = n)

p chart for D

Summary of group statistics:


Min. 1st Qu. Median Mean 3rd Qu. Max.
0.060 0.100 0.120 0.125 0.160 0.200

Summary of group sample sizes:


sizes 30 50
counts 1 39

Number of groups: 40
Center of group statistics: 0.1242424
Standard deviation: 0.3298579

Control limits:
LCL UCL
0 0.2641893
0 0.2641893
...
0 0.3049130

> data(Defectos)

> head(Defectos)
muestra x n
1 1 14 50
2 2 10 50
3 3 10 50
4 4 18 50
5 5 6 50
6 6 12 50

> attach(Defectos)

> q3 = qcc(x, n, type="p")

> summary(q3)

Call:
qcc(data = x, type = "p", sizes = n)

p chart for x

Summary of group statistics:


Min. 1st Qu. Median Mean 3rd Qu. Max.
0.120 0.200 0.240 0.246 0.290 0.360
Group sample size: 50
Number of groups: 40
Center of group statistics: 0.246
Standard deviation: 0.4306785

Control limits:
LCL UCL
0.06327857 0.4287214
0.06327857 0.4287214
...
0.06327857 0.4287214

> q4 = qcc(x, n, type="c")

> inc <- setdiff(which(trial), c(6,20))

> qcc(x[inc], sizes=n[inc], type="u", labels=inc,


+ newdata=x[!trial], newsizes=n[!trial], newlabels=which(!trial))

> q4 = qcc(x, n, type="c")

> inc <- setdiff(which(trial), c(6,20))

> qcc(x[inc], sizes=n[inc], type="u", labels=inc,


+ newdata=x[!trial], newsizes=size[!trial], newlabels=which(!trial))

> q4 = qcc(x, n, type="c")

> Dataset9 <- readXL("C:/Users/qstef/Downloads/calidad.xls", rownames=FALSE,


header=TRUE, na="", sheet="pareto",
+ stringsAsFactors=TRUE)

> defect = c(100, 80, 20, 10, 5)

> names(defect) = c("Llenado", "Envasado", "Etiquetado", "Embalaje", "Sellado")

> pareto.chart(defect, ylab = "Error frequency")

Pareto chart analysis for defect


Frequency Cum.Freq. Percentage Cum.Percent.
Llenado 100.000000 100.000000 46.511628 46.511628
Envasado 80.000000 180.000000 37.209302 83.720930
Etiquetado 20.000000 200.000000 9.302326 93.023256
Embalaje 10.000000 210.000000 4.651163 97.674419
Sellado 5.000000 215.000000 2.325581 100.000000

You might also like