Transformations             package:coin             R Documentation

_F_u_n_c_t_i_o_n_s _f_o_r _D_a_t_a _T_r_a_n_s_f_o_r_m_a_t_i_o_n_s

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

     Rank-transformations for numerical data or dummy codings of
     factors.

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

     trafo(data, numeric_trafo = id_trafo, 
         factor_trafo = f_trafo, surv_trafo = logrank_trafo, block = NULL)
     id_trafo(x)
     ansari_trafo(x, ties.method = c("mid-ranks", "average-scores"))
     fligner_trafo(x, ties.method = c("mid-ranks", "average-scores"))
     normal_trafo(x, ties.method = c("mid-ranks", "average-scores"))
     median_trafo(x)
     consal_trafo(x, ties.method = c("mid-ranks", "average-scores"))
     maxstat_trafo(x, minprob = 0.1, maxprob = 0.9)
     logrank_trafo(x)
     f_trafo(x)

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

    data: an object of class 'data.frame'.

numeric_trafo: a function to by applied to 'numeric'  elements of
          'data' returning a matrix with 'nrow(data)' rows and an
          arbitrary number of columns.

factor_trafo: a function to by applied to 'factor' elements of 'data'
          returning a matrix with 'nrow(data)' rows and an arbitrary
          number of columns (usually a dummy or contrast  matrix).

surv_trafo: a function to by applied to  elements of class 'Surv' of
          'data' returning a  matrix with 'nrow(data)' rows and an
          arbitrary number of columns.

   block: an optional factor those levels are interpreted as blocks.
          'trafo' is applied to each level of 'block' separately.

       x: an object of classes 'numeric', 'factor' or 'Surv'.

ties.method: two methods are available to adjust scores for ties.
          Either the score generating function is applied to
          'mid-ranks' or scores, based on random ranks, are averaged
          'average-scores'.

 minprob: a fraction between 0 and 0.5.

 maxprob: a fraction between 0.5 and 1.

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

     The utility functions documented here are used to define special
     independence tests.

     'trafo' applies its arguments to the elements of 'data' according
     to the classes of the elements.

     'id_trafo' is the identity transformation and 'f_trafo' computes
     dummy matrices for factors.

     'ansari_trafo' and 'fligner_trafo' compute Ansari-Bradley or
     Fligner scores for scale problems.

     'normal_trafo', 'median_trafo' and 'consal_trafo' implement normal
     scores, median scores or Conover-Salburg scores (see 'neuropathy')
     for location problems,  'logrank_trafo' returns Logrank scores for
     censored data.

     A 'trafo' function with modified default arguments is usually
     feeded into 'independence_test' via the 'xtrafo' or 'ytrafo'
     arguments.

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

     A named matrix with 'nrow(data)' rows and  arbitrary number of
     columns.

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

     ### dummy matrices, 2-sample problem (only one column)
     f_trafo(y <- gl(2, 5))

     ### K-sample problem (K columns)
     f_trafo(y <- gl(5, 2))

     ### normal scores
     normal_trafo(x <- rnorm(10))

     ### and now together
     trafo(data.frame(x = x, y = y), numeric_trafo = normal_trafo)

     ### maximally selected statistics
     maxstat_trafo(rnorm(10))

     ### apply transformation blockwise (e.g. for Friedman test)
     trafo(data.frame(y = 1:20), numeric_trafo = rank, block = gl(4, 5))

