Performs a nonparametric sign test of whether the median difference between two columns of paired censored data equals 0. Uses the Fong adjustment for pairs of equal values.

cen_signtest(xd, xc, yd, yc, alternative = "two.sided", printstat = TRUE)

## Arguments

xd

The first column of data values plus detection limits

xc

The column of censoring indicators, where 1 (or TRUE) indicates a detection limit in the xd column, and 0 (or FALSE) indicates a detected value in xd.

yd

The second column of data values plus detection limits.

yc

The column of censoring indicators, where 1 (or TRUE) indicates a detection limit in the yd column, and 0 (or FALSE) indicates a detected value in yd.

alternative

The usual notation for the alternate hypothesis. Default is “two.sided”. Options are “greater” or “less”.

printstat

Logical TRUE/FALSE option of whether to print the resulting statistics in the console window, or not. Default is TRUE.

## Value

Returns the number of xd and yd values greater than, less than and tied. Corrected and uncorrected p-value for ties also displayed.

## References

Fong, D.Y.T., Kwan, C.W., Lam, K.F., Lam, K.S.L., 2003. Use of the Sign Test for the Median in the Presence of Ties. The American Statistician 57, 237–240.

Helsel, D.R., 2011. Statistics for censored environmental data using Minitab and R, 2nd ed. John Wiley & Sons, USA, N.J. #'

## Examples


data(atrazine)

cen_signtest(atrazine$June,atrazine$JuneCen,atrazine$Sept,atrazine$SeptCen)
#> Censored sign test for median(x:atrazine$June - y:atrazine$Sept) equals 0
#>    alternative hypothesis: true median difference is not = 0
#>    n = 24   n+ = 3   n- = 16    ties: 5
#>
#>   No correction for ties:   p-value = 0.004425
#> Fong correction for ties:   p-value = 0.08956