Carta xbar y S cuando n es variable

library(qcc)  #cargamos la libreria
## Package 'qcc' version 2.7
## Type 'citation("qcc")' for citing this R package in publications.
data(pistonrings)
attach(pistonrings)
PistonR<-diameter[-c(9,10,30,35,45,64,65,74,75,85,99,100,126:200)]

sample=c(rep(1,5),rep(2,3), rep(3,5),rep(4,5),rep(5,5), rep(6,4),
         rep(7,4),rep(8,5), rep(9,4),rep(10,5),rep(11,5), rep(12,5),
         rep(13,3),rep(14,5), rep(15,3),rep(16,5),rep(17,4), rep(18,5),
         rep(19,5),rep(20,3), rep(21,5),rep(22,5),rep(23,5), rep(24,5), rep(25,5))
datos<-qcc.groups(PistonR, sample) 
datos
##      [,1]   [,2]   [,3]   [,4]   [,5]
## 1  74.030 74.002 74.019 73.992 74.008
## 2  73.995 73.992 74.001     NA     NA
## 3  73.988 74.024 74.021 74.005 74.002
## 4  74.002 73.996 73.993 74.015 74.009
## 5  73.992 74.007 74.015 73.989 74.014
## 6  74.009 73.994 73.997 73.985     NA
## 7  73.995 74.006 73.994 74.000     NA
## 8  73.985 74.003 73.993 74.015 73.988
## 9  74.008 73.995 74.009 74.005     NA
## 10 73.998 74.000 73.990 74.007 73.995
## 11 73.994 73.998 73.994 73.995 73.990
## 12 74.004 74.000 74.007 74.000 73.996
## 13 73.983 74.002 73.998     NA     NA
## 14 74.006 73.967 73.994 74.000 73.984
## 15 74.012 74.014 73.998     NA     NA
## 16 74.000 73.984 74.005 73.998 73.996
## 17 73.994 74.012 73.986 74.005     NA
## 18 74.006 74.010 74.018 74.003 74.000
## 19 73.984 74.002 74.003 74.005 73.997
## 20 74.000 74.010 74.013     NA     NA
## 21 73.988 74.001 74.009 74.005 73.996
## 22 74.004 73.999 73.990 74.006 74.009
## 23 74.010 73.989 73.990 74.009 74.014
## 24 74.015 74.008 73.993 74.000 74.010
## 25 73.982 73.984 73.995 74.017 74.013
grafico_S<-qcc(datos, type="S",xlab = "Numero de muestra", ylab = "S", title = "Grafico S") 

summary(grafico_S)
## 
## Call:
## qcc(data = datos, type = "S", xlab = "Numero de muestra", ylab = "S",     title = "Grafico S")
## 
## S chart for datos 
## 
## Summary of group statistics:
##        Min.     1st Qu.      Median        Mean     3rd Qu.        Max. 
## 0.002863564 0.006806859 0.008700575 0.009234812 0.011928956 0.016177144 
## 
## Summary of group sample sizes:                
##   sizes  3 4  5
##   counts 4 4 17
## 
## Number of groups:  25
## Center of group statistics:  0.00938731
## Standard deviation:  0.009930923 
## 
## Control limits:
##     LCL        UCL
##       0 0.01955302
##       0 0.02318885
## ...               
##       0 0.01955302
grafico_x<-qcc(datos,type = "xbar",xlab = "Numero de muestra", ylab = "Medias", title = "Grafico de Medias")

summary(grafico_x)
## 
## Call:
## qcc(data = datos, type = "xbar", xlab = "Numero de muestra",     ylab = "Medias", title = "Grafico de Medias")
## 
## xbar chart for datos 
## 
## Summary of group statistics:
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
## 73.99020 73.99680 73.99980 74.00076 74.00425 74.01020 
## 
## Summary of group sample sizes:                
##   sizes  3 4  5
##   counts 4 4 17
## 
## Number of groups:  25
## Center of group statistics:  74.00075
## Standard deviation:  0.009856701 
## 
## Control limits:
##          LCL      UCL
##     73.98753 74.01398
##     73.98368 74.01782
## ...                  
##     73.98753 74.01398

Conclusión:

Se puede observar en los graficos que los datos se encuentra bajo control estadistico.