This function builds p-charts.
cchart.p(
x1 = NULL,
n1 = NULL,
type = "norm",
p1 = NULL,
x2 = NULL,
n2 = NULL,
phat = NULL,
p2 = NULL
)The phase I data that will be plotted (if it is a phase I chart).
A value or a vector of values specifying the sample sizes associated with each group for the phase I data.
The type of p-chart to be plotted. The options are "norm" (traditional Shewhart p-chart), "CF" (Cornish Fisher p-chart) and "std" (standardized p-chart). If not specified, a Shewhart p-chart will be plotted.
The data used to estimate the phat (x1 / n1).
The phase II data that will be plotted in a phase II chart.
A value or a vector of values specifying the sample sizes associated with each group for the phase II data.
The estimate of p.
The values corresponding to x2 / n2.
Return a p-chart.
For a phase I p-chart, n1 must be specified and either x1 or p1. For a phase II p-chart, n2 must be specified, plus x2 or p2 and either phat, x1 and n1, or p1 and n1. The Shewhart is based on normal-approximation and should be used only for large values of np or n*p (n*p > 6).
Montgomery, D.C.,(2008)."Introduction to Statistical Quality Control". Chapter 11. Wiley
data(binomdata)
attach(binomdata)
#> The following object is masked from package:base:
#>
#> pi
cchart.p(x1 = Di[1:12], n1 = ni[1:12])
cchart.p(x1 = Di[1:12], n1 = ni[1:12], type = "CF", x2 = Di[13:25], n2 = ni[13:25])
cchart.p(type = "std", p2 = Di[13:25], n2 = ni[13:25], phat = 0.1115833)
#> Warning: NaNs produced
#> List of 11
#> $ call : language qcc(data = l, type = "p", sizes = n2, center = 0, limits = c(-SIGMA_MULT, SIGMA_MULT), title = "Standardized| __truncated__
#> $ type : chr "p"
#> $ data.name : chr "l"
#> $ data : num [1:13, 1] 309 274 196 224 281 ...
#> ..- attr(*, "dimnames")=List of 2
#> $ statistics: Named num [1:13] 2.58 2.29 1.78 2.8 3.51 ...
#> ..- attr(*, "names")= chr [1:13] "1" "2" "3" "4" ...
#> $ sizes : int [1:13] 120 120 110 80 80 80 90 100 100 100 ...
#> $ center : num 0
#> $ std.dev : num NaN
#> $ nsigmas : num 3
#> $ limits : num [1, 1:2] -3 3
#> ..- attr(*, "dimnames")=List of 2
#> $ violations:List of 2
#> - attr(*, "class")= chr "qcc"