binomRDci               package:MCPAN               R Documentation

_S_i_m_u_l_t_a_n_e_o_u_s _c_o_n_f_i_d_e_n_c_e _i_n_t_e_r_v_a_l_s _f_o_r _c_o_n_t_r_a_s_t_s _o_f _i_n_d_e_p_e_n_d_e_n_t _b_i_n_o_m_i_a_l _p_r_o_p_o_r_t_i_o_n_s (_i_n _a _o_n_e_w_a_y _l_a_y_o_u_t)

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

     Simultaneous asymptotic CI for contrasts of binomial proportions,
     assuming that standard normal approximation holds. The contrasts
     can be interpreted as differences of (weighted averages) of
     proportions (risk ratios).

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

     binomRDci(x,...)

     ## Default S3 method:
     binomRDci(x, n, names=NULL,
      type="Dunnett", cmat=NULL, method="Wald",
      alternative="two.sided", conf.level=0.95, ...)

     ## S3 method for class 'formula':
     binomRDci(formula, data,
      type="Dunnett", cmat=NULL, method="Wald",
      alternative="two.sided", conf.level=0.95,...)

     ## S3 method for class 'table':
     binomRDci(x, type="Dunnett",
      cmat=NULL, method="Wald", alternative="two.sided",
      conf.level=0.95,...)

     ## S3 method for class 'matrix':
     binomRDci(x, type="Dunnett",
      cmat=NULL, method="Wald", alternative="two.sided",
      conf.level=0.95,...)

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

       x: a numeric vector, giving the number of successes in I
          independent samples, or an object of class '"table"',
          representing the 2xk-table, or an object of class '"matrix"',
          representing the 2xk-table 

       n: a numeric vector, giving the number of trials (i.e. the
          sample size) in each of the I groups (only required if 'x' is
          a numeric vector, ignored otherwise) 

   names: an optional character string, giving the names of the groups/
          sample in 'x', 'n'; if not specified the possible names of x
          are taken as group names (ignored if 'x' is a table or
          matrix)

 formula: a two-sided formula of the style 'response ~ treatment',
          where 'response' should be a categorical variable with two
          levels, while treatment should be a factor specifying the
          treatment levels

    data: a data.frame, containing the variables specified in formula

    type: a character string, giving the name of a contrast method, as
          defined in 'contrMat(multcomp)'; ignored if 'cmat' is
          sepcified 

    cmat: a optional contrast matrix 

  method: a single character string, specifying the method for
          confidence interval construction; options are: '"Wald"',
          '"ADD1"', or '"ADD2"' 

alternative: a single character string, one of "two.sided", "less",
          "greater" 

conf.level: a single numeric value, simultaneous confidence level 

     ...: arguments to be passed to 'binomest', currently only
          'success' labelling the event which should be considered as
          success

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

     See the examples for different usages.

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

     A object of class "binomRDci", a list containing: 

conf.int: a matrix with 2 columns: lower and upper confidence bounds,
          and M rows

alternative : character string, as input

conf.level: single numeric value, as input

estimate: a matrix with 1 column: containing the estimates of the
          contrasts

       x: the observed number of successes in the treatment groups

       n: the number of trials in the treatment groups

       p: the estimated proportions in the treatment groups

 success: a character string labelling the event considered as success

   names: the group names

  method: a character string, specifying the method of interval
          construction

    cmat: the contrast matrix used

_N_o_t_e:

     Note, that all implemented methods are approximate only. The
     coverage probability of the  intervals might seriously deviate
     from the nominal level for small sample sizes and extreme success
     probabilities. See the simulation results in Sill (2007) for
     details.

_A_u_t_h_o_r(_s):

     Frank Schaarschmidt

_R_e_f_e_r_e_n_c_e_s:

     Statistical procedures and characterization of coverage
     probabilities are described in: Sill, M. (2007): .... Master
     thesis, Institute of Biostatistics, Leibniz University Hannover.

     Background references:

     The ideas underlying the "ADD1" and "ADD2" adjustment are
     described in:

     Agresti, A. and Caffo, B.(2000): Simple and effective confidence
     intervals for proportions and differences of proportions result
     from adding two successes and two failures. American Statistician
     54, p. 280-288.

     And have been generalized for a single contrast of I proportions
     in:

     Price, R.M. and Bonett, D.G. (2004): An improved confidence
     interval for a linear function of binomial proportions.
     Computational Statistics and Data Analysis 45, 449-456.

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

     'summary.binomRDci', 'plot.sci'

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

     # In simple cases, counts of successes
     # and number of trials can be just typed:

     ntrials <- c(40,20,20,20)
     xsuccesses <- c(1,2,2,4)
     names(xsuccesses) <- LETTERS[1:4]
     ex1D<-binomRDci(x=xsuccesses, n=ntrials, method="ADD1",
      type="Dunnett")
     ex1D

     ex1W<-binomRDci(x=xsuccesses, n=ntrials, method="ADD1",
      type="Williams", alternative="greater")
     ex1W

     # results can be plotted:
     plot(ex1D, main="Comparisons to control group A")

     # summary gives a more detailed print out:
     summary(ex1W)

     # if data are represented as dichotomous variable
     # in a data.frame one can make use of table:

     data(liarozole)

     head(liarozole)

     binomRDci(Improved ~ Treatment, data=liarozole, type="Tukey")
     # here it might be important to define which level of the
     # variable 'Improved' is to be considered as success
     binomRDci(Improved ~ Treatment, data=liarozole, type="Tukey", success="y")

     # If data are available as a named kx2-contigency table:

     tab<-table(liarozole)
     tab

     binomRDci(tab, type="Tukey", success="y")

