This function represents an interface to a fast C-implementation of an adaption of the Passing-Bablok algorithm for large datasets. Instead of building the complete matrix of pair-wise slope values, a pre-defined binning of slope-values is used (Default NBins=1e06). This reduces the required memory dramatically and speeds up the computation.

mc.paba.LargeData(
  X,
  Y,
  NBins = 1e+06,
  alpha = 0.05,
  posCor = TRUE,
  calcCI = TRUE,
  slope.measure = c("radian", "tangent")
)

Arguments

X

(numeric) vector containing measurement values of reference method

Y

(numeric) vector containing measurement values of test method

NBins

(integer) value specifying the number of bins used to classify slope-values

alpha

(numeric) value specifying the 100(1-alpha)% confidence level for confidence intervals

posCor

(logical) should algorithm assume positive correlation, i.e. symmetry around slope 1?

calcCI

(logical) should confidence intervals be computed?

slope.measure

angular measure of pairwise slopes (see mcreg for details).
"radian" - for data sets with even sample numbers median slope is calculated as average of two central slope angles.
"tangent" - for data sets with even sample numbers median slope is calculated as average of two central slopes (tan(angle)).

Value

Matrix of estimates and confidence intervals for intercept and slope. No standard errors provided by this algorithm.

Author

Andre Schuetzenmeister andre.schuetzenmeister@roche.com (partly re-using code of function 'mc.paba')

Examples


 library("mcr")
 data(creatinine,package="mcr")
 
# remove any NAs
crea <- na.omit(creatinine)
    
# call the approximative Passing-Bablok algorithm (Default NBins=1e06)
res1 <- mcreg(x=crea[,1], y=crea[,2], method.reg="PaBaLarge", method.ci="analytical") 
getCoefficients(res1)
#>                  EST SE        LCI       UCI
#> Intercept -0.1171756 NA -0.2001147 -0.020000
#> Slope      1.0880108 NA  1.0000000  1.173004

# now increase the number of bins and see whether this makes a difference
res2 <- mcreg(x=crea[,1], y=crea[,2], method.reg="PaBaLarge", method.ci="analytical", NBins=1e07) 
getCoefficients(res2)
#>                  EST SE        LCI       UCI
#> Intercept -0.1171726 NA -0.2001147 -0.020000
#> Slope      1.0880087 NA  1.0000000  1.173004
getCoefficients(res1)-getCoefficients(res2)
#>                     EST SE          LCI           UCI
#> Intercept -2.974027e-06 NA 6.661338e-16  0.000000e+00
#> Slope      2.058150e-06 NA 0.000000e+00 -6.661338e-16