Performs a Peto-Peto nonparametric test of differences in cdfs between groups. If more than two groups, the test is followed by a nonparametric multiple comparison test. Uses the BH method of adjusting p-values.

cen1way(x1, x2, group, mcomp.method = "BH", printstat = TRUE)

Arguments

x1

The column of data values plus detection limits

x2

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

group

Grouping or factor variable. Can be either a text or numeric value indicating the group assignment.

mcomp.method

One of the standard methods for adjusting p-values for multiple comparisons. Type ?p.adjust for the list of possible methods. Default is Benjamini-Hochberg "BH" false discover rate.

printstat

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

Value

A list of summary statistics for each group evaluated containing the following components:

  • N Number of samples

  • PctND Percentage of non-detects

  • KMmean Kaplan-Meier estimate of the mean

  • KMsd Kaplan-Meier estimate of standard deviation

  • KMmedian Kaplan-Meier estmate of the median

Peto-Peto test results including Chi-Squared value, degrees of freedom and p-value of the test.

If more than two groups, p-values of the pairwise multiple comparisons, adjusted using the BH false-discovery rate, are reported.

References

Helsel, D.R., 2011. Statistics for Censored Environmental Data using Minitab and R, 2nd ed. John Wiley & Sons, USA, N.J.

Peto, R., Peto, J., 1972. Asymptotically Efficient Rank Invariant Test Procedures. Journal of the Royal Statistical Society. Series A (General) 135, 185. doi: 10.2307/2344317

Benjamini, Y., Hochberg, Y., 1995. Controlling the False Discovery Rate: A Practical and Powerful Approach to Multiple Testing. Journal of the Royal Statistical Society. Series B (Methodological), 57, 289-300.

Examples

data(PbHeron)

# Two Groups
cen1way(PbHeron$Liver,PbHeron$LiverCen,PbHeron$DosageGroup)
#> Warning: One or more group(s) do not have censored data.
#>      grp    N   PctND     Mean         SD   LCLmean
#> 1   High   13    0.00   9.2880   16.39000   -0.6188
#> 2    Low   14   28.57   0.1202    0.09919    0.0758
#> 
#>       Oneway Peto-Peto test of CensData: PbHeron$Liver   by Factor: PbHeron$DosageGroup 
#>       Chisq = 7.388   on 1 degrees of freedom     p = 0.00657 

# More than two groups
cen1way(PbHeron$Liver,PbHeron$LiverCen,PbHeron$Group)
#> Warning: One or more group(s) do not have censored data.
#> Warning: One or more group(s) do not have censored data.
#>     grp   N   PctND    KMmean       KMsd    LCLmean
#> 1     1   7   28.57    0.1020    0.08834    0.03338
#> 2     2   7   28.57    0.1384    0.10590    0.07153
#> 3     3   6    0.00   12.1100   16.16000   -4.84900
#> 4     4   7    0.00    6.8660   17.46000   -9.28600
#> 
#>       Oneway Peto-Peto test of CensData: PbHeron$Liver   by Factor: PbHeron$Group 
#>       Chisq = 7.795   on 3 degrees of freedom     p = 0.0504 
#> 
#> 	Pairwise comparisons using Peto & Peto test 
#> 
#> data:  CensData and Factor 
#> 
#>   1     2     3    
#> 2 0.887 -     -    
#> 3 0.171 0.321 -    
#> 4 0.079 0.127 0.887
#> 
#> P value adjustment method: BH