Inverse function to z or z(log) for laboratory measurement standardisation as proposed in Hoffmann 2017 et al.

iz(x, limits, probs = c(0.025, 0.975))

izlog(x, limits, probs = c(0.025, 0.975))

Arguments

x

numeric, z/zlog values.

limits

numeric or matrix, lower and upper reference limits. Has to be of length 2 for numeric or a two-column matrix with as many rows as elements in x.

probs

numeric, probabilities of the lower and upper reference limit, default: c(0.025, 0.975) (spanning 95 %). Has to be of length 2 for numeric or a two-column matrix with as many rows as elements in x.

Value

numeric, laboratory measurements.

Details

The inverse z value is calculated as follows (assuming that the limits where 0.025 and 0.975 quantiles): \(x = z * (limits_2 - limits_1)/3.92 + (limits_1 + limits_2)/2\)

The inverse z(log) value is calculated as follows (assuming that the limits where 0.025 and 0.975 quantiles): \(x = \exp(z * (\log(limits_2) - \log(limits_1))/3.92 + (\log(limits_1) + \log(limits_2))/2)\)

References

Georg Hoffmann, Frank Klawonn, Ralf Lichtinghagen, and Matthias Orth. 2017. "The Zlog-Value as Basis for the Standardization of Laboratory Results." LaboratoriumsMedizin 41 (1): 23–32. doi:10.1515/labmed-2016-0087 .

See also

Author

Sebastian Gibb

Examples

iz(z(1:10, limits = c(2, 8)), limits = c(2, 8))
#>  [1]  1  2  3  4  5  6  7  8  9 10

# from Hoffmann et al. 2017
albuminzlog <- c(-0.15, -2.25, -1.15, 0.08, 1.57, -0.15, -4.53, -3.16, -5.70)
izlog(albuminzlog, limits = c(35, 52))
#> [1] 42.02004 33.98964 37.98346 43.00754 49.99180 42.02004 26.99862 31.00504
#> [9] 23.98961

bilirubinzlog <- c(0.85, 0.57, -1.96, -0.43, 2.04, 3.12, 2.90, 5.72, 1.88)

limits <- cbind(
    lower = rep(c(35, 2), c(length(albuminzlog), length(bilirubinzlog))),
    upper = rep(c(52, 21), c(length(albuminzlog), length(bilirubinzlog)))
)
izlog(c(albuminzlog, bilirubinzlog), limits = limits)
#>  [1]  42.020036  33.989637  37.983464  43.007544  49.991803  42.020036
#>  [7]  26.998616  31.005036  23.989607  10.790960   9.122558   1.999957
#> [13]   5.007309  22.032798  42.113652  36.907124 200.334054  20.016480