Computes the within-column ranks of data having one or more detection limits. If multiple limits are present in a column, data are first re-censored at the highest detection limit.

ordranks(dat.frame, paired = TRUE)

Arguments

dat.frame

A data frame. Default format is paired = TRUE, where for 3 chemical parameters the input format is C1 I1 C2 I2 C3 I3, a concentration column followed by its censoring indicator column.

paired

An option to specify paired = FALSE, where the input format would be C1 C2 C3 I1 I2 I3 where the C columns contain concentrations or a detection limit, and the I columns are their associated indicators, in the same order as the concentration columns.

Value

Returns columns of ranks of censored data in the same order as the paired columns of input data. For 3 chemical parameters, the data frame returned will be R1 R2 R3 where R represents the ranks of the C1 C2 C3 input data accounting for the censoring indicated by columns I1 I2 I3.

References

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

Examples

library(NADA) #For example data
#> Warning: package 'NADA' was built under R version 4.1.3
#> Loading required package: survival
#> 
#> Attaching package: 'NADA'
#> The following object is masked from 'package:stats':
#> 
#>     cor
data(PbHeron)

ordranks(PbHeron[,4:15])
#>       rnk.Liver rnk.Bone rnk.Brain rnk.Feather rnk.Blood rnk.Kidney
#>  [1,]        20      7.0        11         2.5        10          5
#>  [2,]        13      1.5        15         2.5        10          4
#>  [3,]         4      1.5        20        15.0        10          2
#>  [4,]        10      3.0         7         7.0        10          6
#>  [5,]         4      4.0         2        11.0        10          8
#>  [6,]         8     10.0         5         5.0        10          3
#>  [7,]         4      5.0         2         2.5        10          1
#>  [8,]        14     14.0        12        10.0        10         15
#>  [9,]        21      8.0        26         2.5        10          9
#> [10,]        12     17.0        23        16.0        22         13
#> [11,]        18      9.0        18         6.0        10          7
#> [12,]         4      6.0         9        13.0        10         10
#> [13,]         4     13.0        10         8.0        10         11
#> [14,]         4     12.0         4         9.0        10         12
#> [15,]        24     24.0        25        25.0        24         25
#> [16,]        26     23.0        27        20.0        25         26
#> [17,]         4     11.0         2        17.0        10         18
#> [18,]        15     18.0        17        26.0        20         23
#> [19,]        11     16.0         8        14.0        10         14
#> [20,]        25     26.0        16        22.0        27         24
#> [21,]        23     21.0        21        23.0        23         21
#> [22,]        19     20.0        19        19.0        10         17
#> [23,]        16     22.0        14        18.0        10         19
#> [24,]        17     19.0        13        21.0        21         20
#> [25,]        22     25.0        24        24.0        10         22
#> [26,]        27     27.0        22        27.0        26         27
#> [27,]         9     15.0         6        12.0        10         16