OC2c           package:AcceptanceSampling           R Documentation

_O_p_e_r_a_t_i_n_g _C_h_a_r_a_c_t_e_r_i_s_t_i_c_s _o_f _a_n _A_c_c_e_p_t_a_n_c_e _S_a_m_p_i_n_g _P_l_a_n

_D_e_s_c_r_i_p_t_i_o_n:

     The preferred way of creating new objects from the family of
     '"OC2c"' classes.

_U_s_a_g_e:

     OC2c(n,c,r=if (length(c)==1) c+1 else NULL, type=c("binomial","hypergeom", "poisson"), ...)
      

_A_r_g_u_m_e_n_t_s:

       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 *cumulative* acceptance
          numbers at each of the k stages of sampling.

       r: A vector of length k giving the *cumulative* rejection
          numbers at each of the k stages of sampling.

    type: The possible types relate to the distribution on which the
          plans are based on, namely, 'binomial', 'hypergeom', and
          'poisson'.

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

_D_e_t_a_i_l_s:

     Typical usages are:


         OC2c(n, c)
         OC2c(n, c, r, pd)
         OC2c(n, c, r, type="hypergeom", N, pd)
         OC2c(n, c, r, type="poisson", pd)

     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.

     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)'.

_V_a_l_u_e:

     An object from the family of 'OC2c-class', namely of class
     'OCbinomial', 'OChypergeom', or 'OCpoisson'.

_S_e_e _A_l_s_o:

     'OC2c-class'

_E_x_a_m_p_l_e_s:

     ## 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

