From 966da79af48c371c05dd8011702ef2bd3b1d1e03 Mon Sep 17 00:00:00 2001
From: Johannes Ranke
calplot(object, xlim = c("auto", "auto"), ylim = c("auto", "auto"), +calplot(object, xlim = c("auto", "auto"), ylim = c("auto", "auto"), xlab = "Concentration", ylab = "Response", alpha=0.05, varfunc = NULL)Arguments
-
lm
or
+ object | +A univariate model object of class y ~ x or y ~ x - 1 . |
+
---|---|
xlim | +The limits of the plot on the x axis. |
+
ylim | +The limits of the plot on the y axis. |
+
xlab | +The label of the x axis. |
+
ylab | +The label of the y axis. |
+
alpha | +The error tolerance level for the confidence and prediction bands. Note that this
includes both tails of the Gaussian distribution, unlike the alpha and beta parameters
- used in lod (see note below). |
+
varfunc | +The variance function for generating the weights in the model. + Currently, this argument is ignored (see note below). |
+
predict.lm
, therefore,
- calplot
does not draw prediction bands for such models.
- It is possible to compare the calplot
prediction bands with the
- lod
values if the lod()
alpha and beta parameters are
+ calplot
does not draw prediction bands for such models.
It is possible to compare the calplot
prediction bands with the
+ lod
values if the lod()
alpha and beta parameters are
half the value of the calplot()
alpha parameter.
+calplot(m) @@ -167,7 +178,7 @@ diff --git a/docs/reference/chemCal-package.html b/docs/reference/chemCal-package.html index b720fc9..ee92d84 100644 --- a/docs/reference/chemCal-package.html +++ b/docs/reference/chemCal-package.html @@ -6,8 +6,7 @@ -data(massart97ex3) m <- lm(y ~ x, data = massart97ex3) -calplot(m)
See ../DESCRIPTION
+See ../DESCRIPTION
There is a package vignette located in ../doc/chemCal.pdf.
+There is a package vignette located in ../doc/chemCal.pdf.
Sample dataset to test the package.
-data(din32645)+
data(din32645)
DIN 32645 (equivalent to ISO 11843), Beuth Verlag, Berlin, 1994
-Dintest. Plugin for MS Excel for evaluations of calibration data. Written +
Dintest. Plugin for MS Excel for evaluations of calibration data. Written by Georg Schmitt, University of Heidelberg. Formerly available from the Website of the University of Heidelberg.
-Currie, L. A. (1997) Nomenclature in evaluation of analytical methods including +
Currie, L. A. (1997) Nomenclature in evaluation of analytical methods including detection and quantification capabilities (IUPAC Recommendations 1995). Analytica Chimica Acta 391, 105 - 126.
@@ -96,9 +105,9 @@+3.04 * lod(m,alpha = 0.01, beta = 0.5)$x+calplot(m)#> $Prediction +(prediction <- inverse.predict(m, 3500, alpha = 0.01))#> $Prediction #> [1] 0.1054792 #> #> $`Standard Error` @@ -114,7 +123,7 @@ # was collected from Procontrol 3.1 (isomehr GmbH) in this case round(prediction$Confidence,5)#> [1] 0.07434#> $x +(crit <- lod(m, alpha = 0.01, beta = 0.5))#> $x #> [1] 0.0698127 #> #> $y @@ -129,12 +138,12 @@ # In German, the smallest detectable value is the "Erfassungsgrenze", and we # should get 0.14 according to DIN, which we achieve by using the method # described in it: -lod.din <- lod(m, alpha = 0.01, beta = 0.01, method = "din") +lod.din <- lod(m, alpha = 0.01, beta = 0.01, method = "din") round(lod.din$x, 2)#> [1] 0.14## Limit of quantification # This accords to the test data coming with the test data from Dintest again, # except for the last digits of the value cited for Procontrol 3.1 (0.2121) -(loq <- loq(m, alpha = 0.01))#> $x +(loq <- loq(m, alpha = 0.01))#> $x #> [1] 0.2119575 #> #> $y @@ -143,7 +152,7 @@ #>round(loq$x,4)#> [1] 0.212# A similar value is obtained using the approximation # LQ = 3.04 * LC (Currie 1999, p. 120) -3.04 * lod(m,alpha = 0.01, beta = 0.5)$x#> [1] 0.2122306
Plot calibration graphs from univariate linear models
- - - -chemCal-package
Calibration data from DIN 32645
-din32645
Predict x from y for a linear calibration
- - -Estimate a limit of detection (LOD)
- - -Estimate a limit of quantification (LOQ)
- - -Calibration data from Massart et al. (1997), example 1
-massart97ex1
Calibration data from Massart et al. (1997), example 3
-massart97ex3
inverse.predict(object, newdata, …, +inverse.predict(object, newdata, …, ws, alpha=0.05, var.s = "auto")Arguments
-
lm
or
+ object | +A univariate model object of class object has weights.
- y ~ x or y ~ x - 1 . |
+
---|---|
newdata | +A vector of observed y values for one sample. |
+
… | +Placeholder for further arguments that might be needed by + future implementations. |
+
ws | +The weight attributed to the sample. This argument is obligatory
+ if |
+
alpha | +The error tolerance level for the confidence interval to be reported. |
+
var.s | +The estimated variance of the sample measurements. The default is to take
the residual standard error from the calibration and to adjust it
using |
+
lod(object, …, alpha = 0.05, beta = 0.05, method = "default", tol = "default")+
lod(object, …, alpha = 0.05, beta = 0.05, method = "default", tol = "default")
lm
or
+ object | +A univariate model object of class |
+
---|---|
… | +Placeholder for further arguments that might be needed by + future implementations. |
+
alpha | +The error tolerance for the decision limit (critical value). |
+
beta | +The error tolerance beta for the detection limit. |
+
method | +The “default” method uses a prediction interval at the LOD for the estimation of the LOD, which obviously requires iteration. This is described for example in Massart, p. 432 ff. The “din” method uses the prediction interval at - x = 0 as an approximation. - - |
+
tol | +When the “default” method is used, the default tolerance for the LOD on the x scale is the value of the smallest non-zero standard - divided by 1000. Can be set to a numeric value to override this. - - + divided by 1000. Can be set to a numeric value to override this. |
+
Massart, L.M, Vandenginste, B.G.M., Buydens, L.M.C., De Jong, S., Lewi, P.J., Smeyers-Verbeke, J. (1997) Handbook of Chemometrics and Qualimetrics: Part A, Chapter 13.7.8
-J. Inczedy, T. Lengyel, and A.M. Ure (2002) International Union of Pure and +
J. Inczedy, T. Lengyel, and A.M. Ure (2002) International Union of Pure and Applied Chemistry Compendium of Analytical Nomenclature: Definitive Rules. Web edition.
-Currie, L. A. (1997) Nomenclature in evaluation of analytical methods including +
Currie, L. A. (1997) Nomenclature in evaluation of analytical methods including detection and quantification capabilities (IUPAC Recommendations 1995). Analytica Chimica Acta 391, 105 - 126.
Examples for din32645
Examples for din32645
inverse.predict
, and L is obtained by iteration.
+ inverse.predict
, and L is obtained by iteration.
- loq(object, …, alpha = 0.05, k = 3, n = 1, w.loq = "auto", +loq(object, …, alpha = 0.05, k = 3, n = 1, w.loq = "auto", var.loq = "auto", tol = "default")Arguments
-
lm
or
+ object | +A univariate model object of class |
+
---|---|
alpha | +The error tolerance for the prediction of x values in the calculation. |
+
… | +Placeholder for further arguments that might be needed by + future implementations. |
+
k | +The inverse of the maximum relative error tolerated at the + desired LOQ. |
+
n | +The number of replicate measurements for which the LOQ should be + specified. |
+
w.loq | +The weight that should be attributed to the LOQ. Defaults
to one for unweighted regression, and to the mean of the weights
- for weighted regression. See |
+
var.loq | +The approximate variance at the LOQ. The default value is + calculated from the model. |
+
tol | +The default tolerance for the LOQ on the x scale is the value of the smallest non-zero standard divided by 1000. Can be set to a - numeric value to override this. - - + numeric value to override this. |
+
Examples for din32645
Examples for din32645
Sample dataset from p. 175 to test the package.
-data(massart97ex1)+
data(massart97ex1)
Sample dataset from p. 188 to test the package.
-data(massart97ex3)+
data(massart97ex3)