SurvTest                package:coin                R Documentation

_I_n_d_e_p_e_n_d_e_n_t _T_w_o- _a_n_d _K-_S_a_m_p_l_e _T_e_s_t_s _f_o_r _C_e_n_s_o_r_e_d _D_a_t_a

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

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

     ## S3 method for class 'formula':
     surv_test(formula, data, subset = NULL,  
         weights = NULL, ...)
     ## S3 method for class 'IndependenceProblem':
     surv_test(object, 
         alternative = c("two.sided", "less", "greater"),
         distribution = c("asymptotic", "approximate", "exact"), 
         ties.method = c("logrank", "HL"), ...)

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

 formula: a formula of the form 'Surv(time, event) ~ x | block' where 
          'time' is a positive numeric variable denoting the survival
          time and 'event' is a logical being 'TRUE' when the event of
          interest was observed and 'FALSE' in case of censoring. 'x'
          is a factor with two or more levels giving the corresponding
          groups. 'block' is an optional factor for stratification.

    data: an optional data frame containing the variables in the model
          formula.

  subset: an optional vector specifying a subset of observations to be
          used.

 weights: an optional formula of the form '~ w' defining integer valued
          weights for the observations.

  object: an object of class 'IndependenceProblem'.

alternative: a character, the alternative hypothesis must be one of
          '"two.sided"' (default), '"greater"' or     '"less"'.  You
          can specify just the initial letter.

distribution: a character, the null distribution of the test statistic
          can be computed 'exact'ly or can be approximated by its
          asymptotic distribution ('asympt')   or via Monte-Carlo
          resampling ('approx'). Alternatively, the functions  'exact',
          'approximate' or 'asymptotic' can be used to specify how the
          exact conditional distribution of the test statistic should
          be calculated or approximated.

ties.method: a character specifying the way ties are handled in the
          definition of the logrank scores, see below.

     ...: further arguments to be passed to or from methods.

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

     The null hypothesis of the equality of the distribution of the
     survival functions in the groups induced by 'x' is tested. 

     The test implemented here is based on the classical logrank test,
     reformulated as a linear rank test. There are several ways of
     dealing with ties. Here, two methods are implemented. The first
     one ('ties.method = "logrank"') is described in Callaert (2003)
     for the uncensored case and leads, in  the presence of censored
     observations, to coefficients 

 a_i = delta_i - sum_{j: X_j <= X_i} delta_j / (n - |{k: X_k < X_j}|)

     for a linear rank statistic T = sum_{i = 1}^ n a_i U_i  (in the
     two-sample situations, where U_i = 0 or U_i = 1 denotes the
     groups). The second method is described in Hothorn & Lausen (2003)
     where the coefficients

 a_i = delta_i - sum_{j: X_j <= X_i} delta_j / (n - |{k: X_k <= X_j}| + 1)

     are suggested.

     Note, however, that the test statistics will differ from the
     results of 'survdiff' since the conditional variance  is not
     identical to the variance estimate used by the classical logrank
     test.

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

     An object inheriting from class 'IndependenceTest-class' with
     methods 'show', 'statistic', 'expectation', 'covariance' and
     'pvalue'. The null distribution can be inspected by 'pperm',
     'dperm',   'qperm' and 'support' methods.

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

     Herman Callaert (2003), Comparing Statistical Software Packages:
     The Case of the Logrank Test in StatXact.  _The American
     Statistician_, *57*, 214-217.

     Torsten Hothorn & Berthold Lausen (2003), On the Exact
     Distribution of Maximally Selected Rank Statistics. _Computational
     Statistics & Data Analysis_ *43*, 121-137.

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

     ### asymptotic tests for carcinoma data
     data(ocarcinoma, package = "coin")
     surv_test(Surv(time, event) ~ stadium, data = ocarcinoma)
     survdiff(Surv(time, event) ~ stadium, data = ocarcinoma)

     ### example data given in Callaert (2003)
     exdata <- data.frame(time = c(1, 1, 5, 6, 6, 6, 6, 2, 2, 2, 3, 4, 4, 5, 5),
                          event = rep(TRUE, 15),
                          group = factor(c(rep(0, 7), rep(1, 8))))
     ### p = 0.0523
     survdiff(Surv(time, event) ~ group, data = exdata)
     ### p = 0.0505
     surv_test(Surv(time, event) ~ group, data = exdata, 
               distribution = exact())

