A copy from mcr::mcreg in mcr package
Arguments
- ...
Arguments passed on to
mcr::mcregxmeasurement values of reference method, or two column matrix.
ymeasurement values of test method.
error.ratioratio between squared measurement errors of reference and test method, necessary for Deming regression (Default 1).
alphavalue specifying the 100(1-alpha)% confidence level for confidence intervals (Default is 0.05).
mref.namename of reference method (Default "Method1").
mtest.namename of test Method (Default "Method2").
sample.namesnames of cases (Default "S##").
method.regregression method. It is possible to choose between five regression methods:
"LinReg"- ordinary least square regression."WLinReg"- weighted ordinary least square regression."Deming"- Deming regression."WDeming"- weighted Deming regression."TS"- Theil-Sen regression."PBequi"- equivariant Passing-Bablok regression."PaBa"- Passing-Bablok regression."PaBaLarge"- approximative Passing-Bablok regression for large datasets, operating onNBinsclasses of constant slope angle which each slope is classified to instead of building the complete triangular matrix of all N*N/2 slopes.method.cimethod of confidence interval calculation. The function contains four basic methods for calculation of confidence intervals for regression coefficients.
"analytical"- with parametric method."jackknife"- with leave one out resampling."bootstrap"- with ordinary non-parametric bootstrap resampling."nested bootstrap"- with ordinary non-parametric bootstrap resampling.method.bootstrap.cibootstrap based confidence interval estimation method.
nsamplesnumber of bootstrap samples.
nnestednumber of nested bootstrap samples.
rng.seedinteger number that sets the random number generator seed for bootstrap sampling. If set to NULL currently in the R session used RNG setting will be used.
rng.kindtype of random number generator for bootstrap sampling. Only used when rng.seed is specified, see set.seed for details.
iter.maxmaximum number of iterations for weighted Deming iterative algorithm.
thresholdnumerical tolerance for weighted Deming iterative algorithm convergence.
na.rmremove measurement pairs that contain missing values (Default is FALSE).
NBinsnumber of bins used when 'reg.method="PaBaLarge"' to classify each slope in one of 'NBins' bins covering the range of all slopes
slope.measureangular measure of pairwise slopes used for exact PaBa regression (see below 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)).methodlargeBoolean. This parameter applies only to regmethod="PBequi" and "TS". If TRUE, a quasilinear algorithm is used. If FALSE, a quadratic algorithm is used which is faster for less than several hundred data pairs.
Examples
data(platelet)
fit <- mcreg(
x = platelet$Comparative, y = platelet$Candidate,
method.reg = "Deming", method.ci = "jackknife"
)
#> Jackknife based calculation of standard error and confidence intervals according to Linnet's method.
printSummary(fit)
#>
#>
#> ------------------------------------------
#>
#> Reference method: Method1
#> Test method: Method2
#> Number of data points: 120
#>
#> ------------------------------------------
#>
#> The confidence intervals are calculated with jackknife (Linnet's) method.
#> Confidence level: 95%
#> Error ratio: 1
#>
#> ------------------------------------------
#>
#> DEMING REGRESSION FIT:
#>
#> EST SE LCI UCI
#> Intercept 4.335885 1.568968372 1.2289002 7.442869
#> Slope 1.012951 0.009308835 0.9945175 1.031386
#>
#>
#> ------------------------------------------
#>
#> JACKKNIFE SUMMARY
#>
#> EST Jack.Mean Bias Jack.SE
#> Intercept 4.335885 4.336377 4.918148e-04 1.568968372
#> Slope 1.012951 1.012950 -1.876312e-06 0.009308835
#> NULL
getCoefficients(fit)
#> EST SE LCI UCI
#> Intercept 4.335885 1.568968372 1.2289002 7.442869
#> Slope 1.012951 0.009308835 0.9945175 1.031386
