##Control Chart for Variables

This is an R Markdown document.we will make control P Chart. import the data using the code below. i got this data from “Pengendalian Kualitas Proses Produksi Kopi Arabika pada UD. Cipta Lestari di Desa Pujungan”

library(readxl)
DataUTS2<- read_excel('C:/semester 6/SKM/Produk Kopi Arabika.xlsx',
                      sheet = "Sheet1", range = "A1:D26")
attach(DataUTS2)
DataUTS2
## # A tibble: 25 x 4
##    `Hari_ke-` Sampel Jumlah_Cacat Proporsi_Kecacatan
##         <dbl>  <dbl>        <dbl>              <dbl>
##  1          1     50            1               0.02
##  2          2     50            0               0   
##  3          3     50            4               0.08
##  4          4     50            0               0   
##  5          5     50            0               0   
##  6          6     50            4               0.08
##  7          7     50            2               0.04
##  8          8     50            0               0   
##  9          9     50            3               0.06
## 10         10     50            0               0   
## # ... with 15 more rows

P Control Chart

after the data imported, let’s make control chart. first we will make p Control Chart. Use “qcc” packages to make control chart. on phase 1, decide the sample of data to find the control limit. the samples of data that used id the first until 25 data.

library(qcc)
## Package 'qcc' version 2.7
## Type 'citation("qcc")' for citing this R package in publications.
(q1<-qcc(Jumlah_Cacat[1:14], sizes = 50, type = "p"))

## List of 11
##  $ call      : language qcc(data = Jumlah_Cacat[1:14], type = "p", sizes = 50)
##  $ type      : chr "p"
##  $ data.name : chr "Jumlah_Cacat[1:14]"
##  $ data      : num [1:14, 1] 1 0 4 0 0 4 2 0 3 0 ...
##   ..- attr(*, "dimnames")=List of 2
##  $ statistics: Named num [1:14] 0.02 0 0.08 0 0 0.08 0.04 0 0.06 0 ...
##   ..- attr(*, "names")= chr [1:14] "1" "2" "3" "4" ...
##  $ sizes     : num [1:14] 50 50 50 50 50 50 50 50 50 50 ...
##  $ center    : num 0.0329
##  $ std.dev   : num 0.178
##  $ nsigmas   : num 3
##  $ limits    : num [1:14, 1:2] 0 0 0 0 0 0 0 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##  $ violations:List of 2
##  - attr(*, "class")= chr "qcc"

On Phase 1 above, there are data that out of control in 1, 3, 4, 7, 8, 9, 10, 11, 12 and 14 . On phase 1, we will find the control limit with the samples that we decided before. If there is no outlier, continue to the phase 2. After, that, continue on phase 2 with enter the 15th until 25th.

(q2 <- qcc(Jumlah_Cacat[1:14], sizes = 50, type = "p",
           newdata=Jumlah_Cacat[15:25], newsize= 50))

## List of 15
##  $ call        : language qcc(data = Jumlah_Cacat[1:14], type = "p", sizes = 50, newdata = Jumlah_Cacat[15:25],      newsizes = 50)
##  $ type        : chr "p"
##  $ data.name   : chr "Jumlah_Cacat[1:14]"
##  $ data        : num [1:14, 1] 1 0 4 0 0 4 2 0 3 0 ...
##   ..- attr(*, "dimnames")=List of 2
##  $ statistics  : Named num [1:14] 0.02 0 0.08 0 0 0.08 0.04 0 0.06 0 ...
##   ..- attr(*, "names")= chr [1:14] "1" "2" "3" "4" ...
##  $ sizes       : num [1:14] 50 50 50 50 50 50 50 50 50 50 ...
##  $ center      : num 0.0329
##  $ std.dev     : num 0.178
##  $ newstats    : Named num [1:11] 0 0.08 0.04 0 0.04 0 0.02 0.02 0.04 0.02 ...
##   ..- attr(*, "names")= chr [1:11] "15" "16" "17" "18" ...
##  $ newdata     : num [1:11, 1] 0 4 2 0 2 0 1 1 2 1 ...
##  $ newsizes    : num [1:11] 50 50 50 50 50 50 50 50 50 50 ...
##  $ newdata.name: chr "Jumlah_Cacat[15:25]"
##  $ nsigmas     : num 3
##  $ limits      : num [1:25, 1:2] 0 0 0 0 0 0 0 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##  $ violations  :List of 2
##  - attr(*, "class")= chr "qcc"

That’s all. If there is some mistake, please contact me on email.