Description Usage Arguments Details Value See Also Examples

The preferred way of creating new objects from the family
of `"OC2c"`

classes.

1 2 |

`n` |
A vector of length k giving the sample size at each of the k stages of sampling, e.g. for double sampling k=2. |

`c` |
A vector of length k giving the |

`r` |
A vector of length k giving the |

`type` |
The possible types relate to the distribution on
which the plans are based on, namely, |

`...` |
Additional parameters passed to the class generating function for each type. See Details for options. |

Typical usages are:

1 2 3 4 5 |

The first and second forms use a default `type`

of
"binomial". The first form can calculate `r`

*only* when
`n`

and `c`

are of length 1 or 2.

The second form provides a the proportion of defectives, `pd`

, for
which the OC function should be calculated (default is ```
pd=seq(0,
1, 0.01)
```

.

The third form states that the OC function based on a Hypergeometric
distribution is desired. In this case the population size `N`

also needs to be specified. In this case, `pd`

indicates the
proportion of population defectives, such that `pd*N`

gives the
actual number of defectives in the population. If `N`

or
`pd`

are not specified they take defaults of `N=100`

and
`pd=seq(0, 1, 0.01)`

. A warning is issued if N and D=N*pd are
not integers by checking the value, not the object type.

An object from the family of `OC2c-class`

, namely of class
`OCbinomial`

, `OChypergeom`

, or `OCpoisson`

.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ```
## A standard binomial sampling plan
x <- OC2c(10,1)
x ## print out a brief summary
plot(x) ## plot the OC curve
plot(x, xlim=c(0,0.5)) ## plot the useful part of the OC curve
## A double sampling plan
x <- OC2c(c(125,125), c(1,4), c(4,5), pd=seq(0,0.1,0.001))
x
plot(x) ## Plot the plan
## Assess whether the plan can meet desired risk points
assess(x, PRP=c(0.01, 0.95), CRP=c(0.05, 0.04))
## A plan based on the Hypergeometric distribution
x <- OC2c(10,1, type="hypergeom", N=5000, pd=seq(0,0.5, 0.025))
plot(x)
## The summary
x <- OC2c(10,1, type="hypergeom", N=5000, pd=seq(0,0.5, 0.1))
summary(x, full=TRUE)
## Plotting against a function which generates P(defective)
xm <- seq(-3, 3, 0.05) ## The mean of the underlying characteristic
x <- OC2c(10, 1, pd=1-pnorm(0, mean=xm, sd=1))
plot(xm, x) ## Plot P(accept) against mean
``` |

```
Acceptance Sampling Plan (binomial)
Sample 1
Sample size(s) 10
Acc. Number(s) 1
Rej. Number(s) 2
Acceptance Sampling Plan (binomial)
Sample 1 Sample 2
Sample size(s) 125 125
Acc. Number(s) 1 4
Rej. Number(s) 4 5
Acceptance Sampling Plan (binomial)
Sample 1 Sample 2
Sample size(s) 125 125
Acc. Number(s) 1 4
Rej. Number(s) 4 5
Plan CANNOT meet desired risk point(s):
Quality RP P(accept) Plan P(accept)
PRP 0.01 0.95 0.89995598
CRP 0.05 0.04 0.01507571
Acceptance Sampling Plan (hypergeom with N=5000)
Sample 1
Sample size(s) 10
Acc. Number(s) 1
Rej. Number(s) 2
Detailed acceptance probabilities:
Pop. Defectives Pop. Prop. defective P(accept)
0 0.0 1.00000000
500 0.1 0.73613783
1000 0.2 0.37556779
1500 0.3 0.14904357
2000 0.4 0.04620019
2500 0.5 0.01068073
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.