Learn R Programming

mcr (version 1.2.1)

mc.paba.LargeData: Passing-Bablok Regression for Large Datasets

Description

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.

Usage

mc.paba.LargeData(X, Y, NBins = 1e+06, alpha = 0.05, posCor = TRUE,
  calcCI = TRUE)

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?

Value

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

Examples

Run this code
# NOT RUN {
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)

# 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)
getCoefficients(res1)-getCoefficients(res2)
# }

Run the code above in your browser using DataLab