cenken                 package:NADA                 R Documentation

_C_o_m_p_u_t_e _K_e_n_d_a_l_l'_s _t_a_u _c_o_r_r_e_l_a_t_i_o_n _c_o_e_f_f_i_c_i_e_n_t _a_n_d _a_s_s_o_c_i_a_t_e_d _l_i_n_e
_f_o_r _c_e_n_s_o_r_e_d _d_a_t_a.  _C_o_m_p_u_t_e_s _t_h_e _A_k_r_i_t_a_s-_T_h_e_i_l-_S_e_n _n_o_n_p_a_r_a_m_e_t_r_i_c _l_i_n_e,
_w_i_t_h _t_h_e _T_u_r_n_b_u_l_l _e_s_t_i_m_a_t_e _o_f _i_n_t_e_r_c_e_p_t.

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

     Computes Kendall's tau for singly (y only) or doubly (x and y)
     censored data.  Computes the Akritas-Theil-Sen nonparametric line,
      with the Turnbull estimate of intercept.

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

         cenken(y, ycen, x, xcen)
         cenken(y, ycen, x)

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

       y: A numeric vector of observations or a formula. 

    ycen: A  logical vector indicating TRUE where an observation in x
          is censored (a less-than value) and FALSE otherwise.  Can be 
          missing/omitted for the case where x is not censored. 

       x: A numeric vector of observations. 

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

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

     If you are using the formula interface:  The 'ycen', 'x' and
     'xcen' parameters are not specified - all information is provided
     via a formula as the 'y' parameter.  The formula must have a 'Cen'
     object as the response on the left of the '~' operator and, if
     desired, terms separated by + operators on the right. See example
     below.

     Kendall's tau is a nonparametric correlation coefficient measuring
     the monotonic association between y and x.  For left-censored
     data, concordant and discordant directions between x and y are
     measured whenever possible.  So with increasing x values, a change
     in y from <1 to 10 is an increase (concordant).  A change from a
     <1 to a detected 0.5 is considered a tie, as is a <1 to a <5,
     because neither can definitively be called an increase or
     decrease.  Tie corrections are employed for the variance of the
     test statistic in order to account for the many ties when
     computing p-values. The ATS line is the slope that results in a
     Kendalls tau of 0 for correlation between the residuals, y-slope*x
     and x.  The cenken routine performs an iterative bisection search
     to find that slope.  The intercept is the median residual, where
     the median for censored data is computed using the Turnbull
     estimate for interval censored data, as implmented in the Icens
     contributed package for R.

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

     Returns tau (Kendall's tau), slope, and p-value for the
     regression.

_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.

     Akritas, M.G., S. A. Murphy, and M. P. LaValley (1995).  The
     Theil-Sen  Estimator With Doubly Censored Data and Applications to
     Astronomy.   Journ. Amer. Statistical Assoc. 90, p. 170-177.

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

         # Both y and x are censored
         # (exercise 11-1 on pg 198 of the NADA book)
         data(Golden)
         with(Golden, cenken(Blood, BloodCen, Kidney, KidneyCen))

         # x is not censored
         # (example on pg 213 of the NADA book)
         data(TCEReg)
         with(TCEReg, cenken(log(TCEConc), TCECen, PopDensity))

         # formula interface
         with(TCEReg, cenken(Cen(log(TCEConc), TCECen)~PopDensity))

         # Plotting data and the regression line
         data(DFe)
         # Recall x and y parameter positons are swapped in plot vs regression calls
         with(DFe, cenxyplot(Year, YearCen, Summer, SummerCen))    # x vs. y
         reg = with(DFe, cenken(Summer, SummerCen, Year, YearCen)) # y~x
         lines(reg)

