cendiff                 package:NADA                 R Documentation

_T_e_s_t _C_e_n_s_o_r_e_d _E_C_D_F _D_i_f_f_e_r_e_n_c_e_s

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

     Tests if there is a difference between two or more empirical
     cumulative distribution functions (ECDF) using the G-rho family of
     tests, or for a single curve against a known alternative.

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

         cendiff(obs, censored, groups, ...)

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

     obs: Either a numeric vector of observations or a formula. See
          examples below. 

censored: A logical vector indicating TRUE where an observation in
          `obs' is censored (a less-than value) and FALSE otherwise. 

  groups: A factor vector used for grouping `obs' into subsets. 

     ...: Additional items that are common to this function and the
          'survdiff' function from the `survival' package.  See
          Details. 

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

     This, and related routines, are front ends to routines in the
     'survival' package.  Since the survival routines can not handle
     left-censored data, these routines transparently handle
     ``flipping" input data and resultant calculations.  

     This function shares the same arguments as 'survdiff'.  The most
     important of which is 'rho' which controls the type of test. With
     'rho = 0' this is the log-rank or Mantel-Haenszel test, and with
     'rho = 1' it is equivalent to the Peto & Peto modification of the
     Gehan-Wilcoxon test.  The default is 'rho = 1', or the Peto & Peto
     test.  This is the most appropriate for left-censored log-normal
     data.

     For the formula interface: if the right hand side of the formula
     consists only of an offset term, then a one sample test is done. 
     To cause missing values in the predictors to be treated as a
     separate group, rather than being omitted, use the 'factor'
     function with its 'exclude' argument.

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

     Returns a list with the following components:

       n: the number of subjects in each group. 

     obs: the weighted observed number of events in each group.  If
          there are strata, this will be a matrix with one column per
          stratum. 

     exp: the weighted expected number of events in each group.  If
          there are strata, this will be a matrix with one column per
          stratum. 

   chisq: the chisquare statistic for a test of equality. 

     var: the variance matrix of the test. 

  strata: optionally, the number of subjects contained in each stratum. 

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

     Lopaka(Rob) Lee <rclee@usgs.gov>

     Dennis Helsel <dhelsel@usgs.gov>

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

     Helsel, Dennis R. (2005).  Nondectects and Data Analysis;
     Statistics for censored environmental data.  John Wiley and Sons,
     USA, NJ.

     Harrington, D. P. and Fleming, T. R. (1982).  A class of rank test
     procedures for censored survival data.  _Biometrika_ *69*,
     553-566.

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

     'Cen', 'survdiff'

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

         data(Cadmium)

         obs      = Cadmium$Cd
         censored = Cadmium$CdCen
         groups   = Cadmium$Region

         # Cd differences between regions?
         cendiff(obs, censored, groups)
         
         # Same as above using formula interface
         cenfit(Cen(obs, censored)~groups) 

