From f381f9a6a8a47b89ec25cd627833a7248da7932b Mon Sep 17 00:00:00 2001 From: ranke Date: Tue, 23 May 2006 07:33:22 +0000 Subject: Don't do calplot and lod for linear models from weighted regression any more, since this is not supported (PR#8877). git-svn-id: http://kriemhild.uft.uni-bremen.de/svn/chemCal@13 5fad18fb-23f0-0310-ab10-e59a3bee62b4 --- man/calplot.lm.Rd | 4 +++- man/din32645.Rd | 37 ++++++++++++++++++++++++++++--------- man/lod.Rd | 27 ++++++++++++++++++++++----- man/loq.Rd | 9 +++++++-- 4 files changed, 60 insertions(+), 17 deletions(-) (limited to 'man') diff --git a/man/calplot.lm.Rd b/man/calplot.lm.Rd index 6d3f52d..734933d 100644 --- a/man/calplot.lm.Rd +++ b/man/calplot.lm.Rd @@ -39,13 +39,15 @@ } \examples{ # Example of a Calibration plot for a weighted regression +source("/home/ranke/tmp/r-base-2.3.0/src/library/stats/R/lm.R") data(massart97ex3) attach(massart97ex3) yx <- split(y,factor(x)) s <- round(sapply(yx,sd),digits=2) w <- round(1/(s^2),digits=3) weights <- w[factor(x)] -m <- lm(y ~ x,w=weights) +m <- lm(y ~ x,w=10 * weights) +calplot(m) calplot(m) } \author{ diff --git a/man/din32645.Rd b/man/din32645.Rd index d251b7c..94486c4 100644 --- a/man/din32645.Rd +++ b/man/din32645.Rd @@ -14,18 +14,33 @@ data(din32645) m <- lm(y ~ x, data=din32645) calplot(m) (prediction <- inverse.predict(m,3500,alpha=0.01)) -# This should give 0.074 according to DIN (cited from the Dintest test data) -round(prediction$Confidence,3) +# This should give 0.07434 according to Dintest test data, as +# collected from Procontrol 3.1 (isomehr GmbH) +round(prediction$Confidence,5) -# According to Dintest, we should get 0.07, but we get 0.0759 -lod(m, alpha = 0.01) +# According to Dintest test data, we should get 0.0698 for the critical value +# (decision limit, "Nachweisgrenze") +(lod <- lod(m, alpha = 0.01, beta = 0.5)) +round(lod$x,4) -# In German, there is the "Erfassungsgrenze", with k = 2, -# and we should get 0.14 according to Dintest -lod(m, k = 2, alpha = 0.01) +# In German, the smallest detectable value is the "Erfassungsgrenze", and we +# should get 0.140 according to Dintest test data, but with chemCal, we can't +# reproduce this, +lod(m, alpha = 0.01, beta = 0.01) +# except by using an equivalent to the approximation +# xD = 2 * Sc / A (Currie 1999, p. 118, or Orange Book, Chapter 18.4.3.7) +lod.approx <- 2 * lod$x +round(lod.approx, digits=3) +# which seems to be the pragmatic definition in DIN 32645, as judging from +# the Dintest test data. -# According to Dintest, we should get 0.21, we get 0.212 -loq(m, alpha = 0.01) +# This accords to the test data from Dintest again, except for the last digit +# of the value cited for Procontrol 3.1 (0.2121) +(loq <- loq(m, alpha = 0.01)) +round(loq$x,4) +# 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 } \references{ DIN 32645 (equivalent to ISO 11843) @@ -33,5 +48,9 @@ loq(m, alpha = 0.01) Dintest. Plugin for MS Excel for evaluations of calibration data. Written by Georg Schmitt, University of Heidelberg. \url{http://www.rzuser.uni-heidelberg.de/~df6/download/dintest.htm} + + Currie, L. A. (1997) Nomenclature in evaluation of analytical methods including + detection and quantification capabilities (IUPAC Recommendations 1995). + Analytica Chimica Acta 391, 105 - 126. } \keyword{datasets} diff --git a/man/lod.Rd b/man/lod.Rd index 15f9603..fa8c8ad 100644 --- a/man/lod.Rd +++ b/man/lod.Rd @@ -38,18 +38,35 @@ the analyte is present (type II or false negative error), is beta (also a one-sided significance test). } +\note{ + - The default values for alpha and beta are recommended by IUPAC. + - The estimation of the LOD in terms of the analyte amount/concentration + xD from the LOD in the signal domain SD is done by simply inverting the + calibration function (i.e. assuming a known calibration function). +} \references{ + 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 Applied Chemistry Compendium of Analytical Nomenclature: Definitive Rules. Web edition. + + 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{ data(din32645) m <- lm(y ~ x, data = din32645) - # The decision limit (critical value) is obtained by using beta = 0.5: - lod(m, alpha = 0.01, beta = 0.5) # approx. Nachweisgrenze in Dintest 2002 - lod(m, alpha = 0.01, beta = 0.01) - # In the latter case (Erfassungsgrenze), we get a slight deviation from - # Dintest 2002 test data. + lod(m) + + # The critical value (decision limit, German Nachweisgrenze) can be obtained + # by using beta = 0.5: + lod(m, alpha = 0.01, beta = 0.5) + # or approximated by + 2 * lod(m, alpha = 0.01, beta = 0.5)$x + # for the case of known, constant variance (homoscedastic data) } \keyword{manip} diff --git a/man/loq.Rd b/man/loq.Rd index 1030399..4850487 100644 --- a/man/loq.Rd +++ b/man/loq.Rd @@ -49,6 +49,11 @@ limit of detection is the x value, where the relative error of the quantification with the given calibration model is 1/k. } +\note{ + IUPAC recommends to base the LOQ on the standard deviation of the + signal where x = 0. The approach taken here is to my knowledge + original to the chemCal package. +} \examples{ data(massart97ex3) attach(massart97ex3) @@ -68,9 +73,9 @@ mwy <- lm(y ~ x, w = 1/y) # Let's do this with one iteration only - loq(mwy, w = 1 / predict(mwy,list(x = loq(mwy)))) + loq(mwy, w = 1 / predict(mwy,list(x = loq(mwy)$x))) # We can get better by doing replicate measurements - loq(mwy, n = 3, w = 1 / predict(mwy,list(x = loq(mwy)))) + loq(mwy, n = 3, w = 1 / predict(mwy,list(x = loq(mwy)$x))) } \keyword{manip} -- cgit v1.2.1