cenken: Compute Kendall's tau correlation coefficient and associated...

Description Usage Arguments Details Value References Examples

Description

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.

Usage

1
    cenken(y, ycen, x, xcen)

Arguments

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.

Details

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.

Value

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

References

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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
    # 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))

    ## Not run: 
    # 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)
    
## End(Not run)

Example output

Loading required package: survival

Attaching package: 'NADA'

The following object is masked from 'package:stats':

    cor

$slope
[1] 0.01537807

$intercept
[1] 0.005803673

$tau
[1] 0.4216524

$p
[1] 0.0004277088

attr(,"class")
[1] "cenken"
$slope
[1] 0.3835066

$intercept
[1] -1.15052

$tau
[1] 0.1458477

$p
[1] 0.0003007718

attr(,"class")
[1] "cenken"
$slope
[1] 0.3835066

$intercept
[1] -1.15052

$tau
[1] 0.1458477

$p
[1] 0.0003007718

attr(,"class")
[1] "cenken"

NADA documentation built on Feb. 16, 2020, 3 a.m.

Related to cenken in NADA...