diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2022-03-31 19:21:03 +0200 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2022-03-31 19:59:10 +0200 |
commit | 08465d77a6ca5a9656ac86047c6008f1e7f3e9c7 (patch) | |
tree | f27a775e146748881eb6526ed57298f4bdc40c2f | |
parent | f4fcef8228ebd5a1a73bc6edc47b5efa259c2e20 (diff) |
Fix URLs in README, convert to roxygenv0.2.3
- The roxygen conversion was done using Rd2roxygen
- Also edit _pkgdown.yml to group the reference
- Use markdown bullet lists for lod and loq docs
39 files changed, 1192 insertions, 532 deletions
diff --git a/.Rbuildignore b/.Rbuildignore index 3115cf6..f0b4d3d 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -4,6 +4,7 @@ check.log$ chemCal_.*.tar.gz docs _pkgdown.yml +README.rmd README.html .travis.yml experimental diff --git a/DESCRIPTION b/DESCRIPTION index cbf3c38..806d3d5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -20,4 +20,4 @@ VignetteBuilder: knitr Encoding: UTF-8 BugReports: https://github.com/jranke/chemCal/issues URL: https://pkgdown.jrwb.de/chemCal/, https://cgit.jrwb.de/chemCal/about -RoxygenNote: 6.1.1 +RoxygenNote: 7.1.2 @@ -1,14 +1,22 @@ -# Export all names -exportPattern(".") -S3method(calplot, default) -S3method(calplot, lm) -S3method(lod, default) -S3method(lod, lm) -S3method(loq, default) -S3method(loq, lm) -S3method(inverse.predict, default) -S3method(inverse.predict, lm) -S3method(inverse.predict, rlm) +# Generated by roxygen2: do not edit by hand -importFrom("graphics", "legend", "matlines", "plot", "points") -importFrom("stats", "optimize", "predict", "qt") +S3method(calplot,default) +S3method(calplot,lm) +S3method(inverse.predict,default) +S3method(inverse.predict,lm) +S3method(inverse.predict,rlm) +S3method(lod,default) +S3method(lod,lm) +S3method(loq,default) +S3method(loq,lm) +export(calplot) +export(inverse.predict) +export(lod) +export(loq) +importFrom(graphics,legend) +importFrom(graphics,matlines) +importFrom(graphics,plot) +importFrom(graphics,points) +importFrom(stats,optimize) +importFrom(stats,predict) +importFrom(stats,qt) diff --git a/R/calplot.R b/R/calplot.R index fd49a54..3c227d4 100644 --- a/R/calplot.R +++ b/R/calplot.R @@ -1,3 +1,45 @@ +#' Plot calibration graphs from univariate linear models +#' +#' Produce graphics of calibration data, the fitted model as well as +#' confidence, and, for unweighted regression, prediction bands. +#' +#' @aliases calplot calplot.default calplot.lm +#' @param object A univariate model object of class \code{\link{lm}} or +#' \code{\link[MASS:rlm]{rlm}} with model formula \code{y ~ x} or \code{y ~ x - +#' 1}. +#' @param xlim The limits of the plot on the x axis. +#' @param ylim The limits of the plot on the y axis. +#' @param xlab The label of the x axis. +#' @param ylab The label of the y axis. +#' @param legend_x An optional numeric value for adjusting the x coordinate of +#' the legend. +#' @param 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 \code{\link{lod}} (see note +#' below). +#' @param varfunc The variance function for generating the weights in the +#' model. Currently, this argument is ignored (see note below). +#' @return A plot of the calibration data, of your fitted model as well as +#' lines showing the confidence limits. Prediction limits are only shown for +#' models from unweighted regression. +#' @note Prediction bands for models from weighted linear regression require +#' weights for the data, for which responses should be predicted. Prediction +#' intervals using weights e.g. from a variance function are currently not +#' supported by the internally used function \code{\link{predict.lm}}, +#' therefore, \code{calplot} does not draw prediction bands for such models. +#' +#' It is possible to compare the \code{\link{calplot}} prediction bands with +#' the \code{\link{lod}} values if the \code{lod()} alpha and beta parameters +#' are half the value of the \code{calplot()} alpha parameter. +#' @author Johannes Ranke +#' @importFrom graphics legend matlines plot points +#' @examples +#' +#' data(massart97ex3) +#' m <- lm(y ~ x, data = massart97ex3) +#' calplot(m) +#' +#' @export calplot calplot <- function(object, xlim = c("auto", "auto"), ylim = c("auto", "auto"), xlab = "Concentration", ylab = "Response", @@ -7,6 +49,7 @@ calplot <- function(object, UseMethod("calplot") } +#' @export calplot.default <- function(object, xlim = c("auto","auto"), ylim = c("auto","auto"), xlab = "Concentration", ylab = "Response", @@ -16,6 +59,7 @@ calplot.default <- function(object, stop("Calibration plots only implemented for univariate lm objects.") } +#' @export calplot.lm <- function(object, xlim = c("auto","auto"), ylim = c("auto","auto"), xlab = "Concentration", ylab = "Response", diff --git a/R/chemCal-package.R b/R/chemCal-package.R new file mode 100644 index 0000000..8cc8c76 --- /dev/null +++ b/R/chemCal-package.R @@ -0,0 +1,194 @@ +#' Calibration data from DIN 32645 +#' +#' Sample dataset to test the package. +#' +#' +#' @name din32645 +#' @docType data +#' @format A dataframe containing 10 rows of x and y values. +#' @references DIN 32645 (equivalent to ISO 11843), Beuth Verlag, Berlin, 1994 +#' +#' 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 detection and quantification capabilities (IUPAC Recommendations +#' 1995). Analytica Chimica Acta 391, 105 - 126. +#' @keywords datasets +#' @examples +#' +#' m <- lm(y ~ x, data = din32645) +#' calplot(m) +#' +#' ## Prediction of x with confidence interval +#' prediction <- inverse.predict(m, 3500, alpha = 0.01) +#' +#' # This should give 0.07434 according to test data from Dintest, which +#' # was collected from Procontrol 3.1 (isomehr GmbH) in this case +#' round(prediction$Confidence, 5) +#' +#' ## Critical value: +#' crit <- lod(m, alpha = 0.01, beta = 0.5) +#' +#' # According to DIN 32645, we should get 0.07 for the critical value +#' # (decision limit, "Nachweisgrenze") +#' round(crit$x, 2) +#' # and according to Dintest test data, we should get 0.0698 from +#' round(crit$x, 4) +#' +#' ## Limit of detection (smallest detectable value given alpha and beta) +#' # 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") +#' round(lod.din$x, 2) +#' +#' ## 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) +#' 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 +#' +NULL + + + + + +#' Calibration data from Massart et al. (1997), example 1 +#' +#' Sample dataset from p. 175 to test the package. +#' +#' +#' @name massart97ex1 +#' @docType data +#' @format A dataframe containing 6 observations of x and y data. +#' @source 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 8. +#' @keywords datasets +NULL + + + + + +#' Calibration data from Massart et al. (1997), example 3 +#' +#' Sample dataset from p. 188 to test the package. +#' +#' +#' @name massart97ex3 +#' @docType data +#' @format A dataframe containing 6 levels of x values with 5 observations of y +#' for each level. +#' @source 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 8. +#' @keywords datasets +#' @examples +#' +#' # For reproducing the results for replicate standard measurements in example 8, +#' # we need to do the calibration on the means when using chemCal > 0.2 +#' weights <- with(massart97ex3, { +#' yx <- split(y, x) +#' ybar <- sapply(yx, mean) +#' s <- round(sapply(yx, sd), digits = 2) +#' w <- round(1 / (s^2), digits = 3) +#' }) +#' +#' massart97ex3.means <- aggregate(y ~ x, massart97ex3, mean) +#' +#' m3.means <- lm(y ~ x, w = weights, data = massart97ex3.means) +#' +#' # The following concords with the book p. 200 +#' inverse.predict(m3.means, 15, ws = 1.67) # 5.9 +- 2.5 +#' inverse.predict(m3.means, 90, ws = 0.145) # 44.1 +- 7.9 +#' +#' # The LOD is only calculated for models from unweighted regression +#' # with this version of chemCal +#' m0 <- lm(y ~ x, data = massart97ex3) +#' lod(m0) +#' +#' # Limit of quantification from unweighted regression +#' loq(m0) +#' +#' # For calculating the limit of quantification from a model from weighted +#' # regression, we need to supply weights, internally used for inverse.predict +#' # If we are not using a variance function, we can use the weight from +#' # the above example as a first approximation (x = 15 is close to our +#' # loq approx 14 from above). +#' loq(m3.means, w.loq = 1.67) +#' # The weight for the loq should therefore be derived at x = 7.3 instead +#' # of 15, but the graphical procedure of Massart (p. 201) to derive the +#' # variances on which the weights are based is quite inaccurate anyway. +#' +NULL + + + + + +#' Cadmium concentrations measured by AAS as reported by Rocke and Lorenzato +#' (1995) +#' +#' Dataset reproduced from Table 1 in Rocke and Lorenzato (1995). +#' +#' +#' @name rl95_cadmium +#' @docType data +#' @format A dataframe containing four replicate observations for each of the +#' six calibration standards. +#' @source Rocke, David M. und Lorenzato, Stefan (1995) A two-component model +#' for measurement error in analytical chemistry. Technometrics 37(2), 176-184. +#' @keywords datasets +NULL + + + + + +#' Toluene amounts measured by GC/MS as reported by Rocke and Lorenzato (1995) +#' +#' Dataset reproduced from Table 4 in Rocke and Lorenzato (1995). The toluene +#' amount in the calibration samples is given in picograms per 100 µL. +#' Presumably this is the volume that was injected into the instrument. +#' +#' +#' @name rl95_toluene +#' @docType data +#' @format A dataframe containing four replicate observations for each of the +#' six calibration standards. +#' @source Rocke, David M. und Lorenzato, Stefan (1995) A two-component model +#' for measurement error in analytical chemistry. Technometrics 37(2), 176-184. +#' @keywords datasets +NULL + + + + + +#' Example data for calibration with replicates from University of Toronto +#' +#' Dataset read into R from +#' \url{https://sites.chem.utoronto.ca/chemistry/coursenotes/analsci/stats/files/example14.xls}. +#' +#' +#' @name utstats14 +#' @docType data +#' @format A tibble containing three replicate observations of the response for +#' five calibration concentrations. +#' @source David Stone and Jon Ellis (2011) Statistics in Analytical Chemistry. +#' Tutorial website maintained by the Departments of Chemistry, University of +#' Toronto. +#' \url{https://sites.chem.utoronto.ca/chemistry/coursenotes/analsci/stats/index.html} +#' @keywords datasets +NULL + + + diff --git a/R/inverse.predict.lm.R b/R/inverse.predict.lm.R index 77d548f..031f9d4 100644 --- a/R/inverse.predict.lm.R +++ b/R/inverse.predict.lm.R @@ -1,19 +1,87 @@ -# This is an implementation of Equation (8.28) in the Handbook of Chemometrics -# and Qualimetrics, Part A, Massart et al (1997), page 200, validated with -# Example 8 on the same page, extended as specified in the package vignette - +#' Predict x from y for a linear calibration +#' +#' This function predicts x values using a univariate linear model that has +#' been generated for the purpose of calibrating a measurement method. +#' Prediction intervals are given at the specified confidence level. The +#' calculation method was taken from Massart et al. (1997). In particular, +#' Equations 8.26 and 8.28 were combined in order to yield a general treatment +#' of inverse prediction for univariate linear models, taking into account +#' weights that have been used to create the linear model, and at the same time +#' providing the possibility to specify a precision in sample measurements +#' differing from the precision in standard samples used for the calibration. +#' This is elaborated in the package vignette. +#' +#' This is an implementation of Equation (8.28) in the Handbook of Chemometrics +#' and Qualimetrics, Part A, Massart et al (1997), page 200, validated with +#' Example 8 on the same page, extended as specified in the package vignette +#' +#' @aliases inverse.predict inverse.predict.lm inverse.predict.rlm +#' inverse.predict.default +#' @param object A univariate model object of class \code{\link{lm}} or +#' \code{\link[MASS:rlm]{rlm}} with model formula \code{y ~ x} or \code{y ~ x - +#' 1}. +#' @param newdata A vector of observed y values for one sample. +#' @param \dots Placeholder for further arguments that might be needed by +#' future implementations. +#' @param ws The weight attributed to the sample. This argument is obligatory +#' if \code{object} has weights. +#' @param alpha The error tolerance level for the confidence interval to be +#' reported. +#' @param 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 \code{ws}, if applicable. This means that \code{var.s} overrides +#' \code{ws}. +#' @return A list containing the predicted x value, its standard error and a +#' confidence interval. +#' @note The function was validated with examples 7 and 8 from Massart et al. +#' (1997). Note that the behaviour of inverse.predict changed with chemCal +#' version 0.2.1. Confidence intervals for x values obtained from calibrations +#' with replicate measurements did not take the variation about the means into +#' account. Please refer to the vignette for details. +#' @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, p. 200 +#' @importFrom stats optimize predict qt +#' @examples +#' +#' # This is example 7 from Chapter 8 in Massart et al. (1997) +#' m <- lm(y ~ x, data = massart97ex1) +#' inverse.predict(m, 15) # 6.1 +- 4.9 +#' inverse.predict(m, 90) # 43.9 +- 4.9 +#' inverse.predict(m, rep(90,5)) # 43.9 +- 3.2 +#' +#' # For reproducing the results for replicate standard measurements in example 8, +#' # we need to do the calibration on the means when using chemCal > 0.2 +#' weights <- with(massart97ex3, { +#' yx <- split(y, x) +#' ybar <- sapply(yx, mean) +#' s <- round(sapply(yx, sd), digits = 2) +#' w <- round(1 / (s^2), digits = 3) +#' }) +#' +#' massart97ex3.means <- aggregate(y ~ x, massart97ex3, mean) +#' +#' m3.means <- lm(y ~ x, w = weights, data = massart97ex3.means) +#' +#' inverse.predict(m3.means, 15, ws = 1.67) # 5.9 +- 2.5 +#' inverse.predict(m3.means, 90, ws = 0.145) # 44.1 +- 7.9 +#' +#' +#' @export inverse.predict <- function(object, newdata, ..., ws = "auto", alpha = 0.05, var.s = "auto") { UseMethod("inverse.predict") } +#' @export inverse.predict.default <- function(object, newdata, ..., ws = "auto", alpha = 0.05, var.s = "auto") { stop("Inverse prediction only implemented for univariate lm objects.") } +#' @export inverse.predict.lm <- function(object, newdata, ..., ws = "auto", alpha = 0.05, var.s = "auto") { @@ -31,6 +99,7 @@ inverse.predict.lm <- function(object, newdata, ..., ws = ws, alpha = alpha, var.s = var.s, w = w, xname = xname, yname = yname) } +#' @export inverse.predict.rlm <- function(object, newdata, ..., ws = "auto", alpha = 0.05, var.s = "auto") { @@ -1,13 +1,74 @@ +#' Estimate a limit of detection (LOD) +#' +#' The decision limit (German: Nachweisgrenze) is defined as the signal or +#' analyte concentration that is significantly different from the blank signal +#' with a first order error alpha (one-sided significance test). The detection +#' limit, or more precise, the minimum detectable value (German: +#' Erfassungsgrenze), is then defined as the signal or analyte concentration +#' where the probability that the signal is not detected although the analyte +#' is present (type II or false negative error), is beta (also a one-sided +#' significance test). +#' +#' @aliases lod lod.lm lod.rlm lod.default +#' @param object A univariate model object of class \code{\link{lm}} or +#' \code{\link[MASS:rlm]{rlm}} with model formula \code{y ~ x} or \code{y ~ x - +#' 1}, optionally from a weighted regression. +#' @param \dots Placeholder for further arguments that might be needed by +#' future implementations. +#' @param alpha The error tolerance for the decision limit (critical value). +#' @param beta The error tolerance beta for the detection limit. +#' @param method The \dQuote{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 \dQuote{din} method +#' uses the prediction interval at x = 0 as an approximation. +#' @param tol When the \dQuote{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. +#' @return A list containig the corresponding x and y values of the estimated +#' limit of detection of a model used for calibration. +#' @note +#' * The default values for alpha and beta are the ones 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). +#' * The calculation of a LOD from weighted calibration models requires a +#' weights argument for the internally used \code{\link{predict.lm}} +#' function, which is currently not supported in R. +#' @seealso Examples for \code{\link{din32645}} +#' @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. +#' @importFrom stats optimize predict +#' @examples +#' +#' m <- lm(y ~ x, data = din32645) +#' 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) +#' +#' @export lod <- function(object, ..., alpha = 0.05, beta = 0.05, method = "default", tol = "default") { UseMethod("lod") } +#' @export lod.default <- function(object, ..., alpha = 0.05, beta = 0.05, method = "default", tol = "default") { stop("lod is only implemented for univariate lm objects.") } +#' @export lod.lm <- function(object, ..., alpha = 0.05, beta = 0.05, method = "default", tol = "default") { if (length(object$weights) > 0) { @@ -1,15 +1,65 @@ +#' Estimate a limit of quantification (LOQ) +#' +#' The limit of quantification is the x value, where the relative error of the +#' quantification given the calibration model reaches a prespecified value 1/k. +#' Thus, it is the solution of the equation \deqn{L = k c(L)}{L = k * c(L)} +#' where c(L) is half of the length of the confidence interval at the limit L +#' (DIN 32645, equivalent to ISO 11843). c(L) is internally estimated by +#' \code{\link{inverse.predict}}, and L is obtained by iteration. +#' +#' @aliases loq loq.lm loq.rlm loq.default +#' @param object A univariate model object of class \code{\link{lm}} or +#' \code{\link[MASS:rlm]{rlm}} with model formula \code{y ~ x} or \code{y ~ x - +#' 1}, optionally from a weighted regression. If weights are specified in the +#' model, either \code{w.loq} or \code{var.loq} have to be specified. +#' @param alpha The error tolerance for the prediction of x values in the +#' calculation. +#' @param \dots Placeholder for further arguments that might be needed by +#' future implementations. +#' @param k The inverse of the maximum relative error tolerated at the desired +#' LOQ. +#' @param n The number of replicate measurements for which the LOQ should be +#' specified. +#' @param 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 \code{\link{massart97ex3}} for an example how to take +#' advantage of knowledge about the variance function. +#' @param var.loq The approximate variance at the LOQ. The default value is +#' calculated from the model. +#' @param 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. +#' @return The estimated limit of quantification for a model used for +#' calibration. +#' @note +#' * IUPAC recommends to base the LOQ on the standard deviation of the +#' signal where x = 0. +#' * The calculation of a LOQ based on weighted regression is non-standard and +#' therefore not tested. Feedback is welcome. +#' @seealso Examples for \code{\link{din32645}} +#' @examples +#' +#' m <- lm(y ~ x, data = massart97ex1) +#' loq(m) +#' +#' # We can get better by using replicate measurements +#' loq(m, n = 3) +#' +#' @export loq <- function(object, ..., alpha = 0.05, k = 3, n = 1, w.loq = "auto", var.loq = "auto", tol = "default") { UseMethod("loq") } +#' @export loq.default <- function(object, ..., alpha = 0.05, k = 3, n = 1, w.loq = "auto", var.loq = "auto", tol = "default") { stop("loq is only implemented for univariate lm objects.") } +#' @export loq.lm <- function(object, ..., alpha = 0.05, k = 3, n = 1, w.loq = "auto", var.loq = "auto", tol = "default") { diff --git a/README.html b/README.html index 47ce3a1..3bb6cbd 100644 --- a/README.html +++ b/README.html @@ -611,7 +611,7 @@ body { <h2 id="overview">Overview</h2> <p>chemCal is an R package providing some basic functions for conveniently working with linear calibration curves with one explanatory variable.</p> <h2 id="installation">Installation</h2> -<p>From within <a href="https://r-project.org">R</a>, get the official chemCal release using</p> +<p>From within <a href="https://www.r-project.org/">R</a>, get the official chemCal release using</p> <div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true"></a><span class="kw">install.packages</span>(<span class="st">"chemCal"</span>)</span></code></pre></div> <h2 id="usage">Usage</h2> <p>chemCal works with univariate linear models of class <code>lm</code>. Working with one of the datasets coming with chemCal, we can produce a calibration plot using the <code>calplot</code> function:</p> @@ -671,7 +671,7 @@ body { <span id="cb7-11"><a href="#cb7-11" aria-hidden="true"></a><span class="co">#> $`Confidence Limits`</span></span> <span id="cb7-12"><a href="#cb7-12" aria-hidden="true"></a><span class="co">#> [1] 42.30749 45.57217</span></span></code></pre></div> <h2 id="reference">Reference</h2> -<p>You can use the R help system to view documentation, or you can have a look at the <a href="https://pkgdown.jrwb.de/chemCal">online documentation</a>.</p> +<p>You can use the R help system to view documentation, or you can have a look at the <a href="https://pkgdown.jrwb.de/chemCal/">online documentation</a>.</p> </body> </html> @@ -139,5 +139,5 @@ inverse.predict(m0, c(91, 89, 87, 93, 90)) You can use the R help system to view documentation, or you can have a look at the [online documentation][pd-site]. -[r-project]: https://r-project.org -[pd-site]: https://pkgdown.jrwb.de/chemCal +[r-project]: https://www.r-project.org/ +[pd-site]: https://pkgdown.jrwb.de/chemCal/ @@ -99,5 +99,5 @@ inverse.predict(m0, c(91, 89, 87, 93, 90)) You can use the R help system to view documentation, or you can have a look at the [online documentation][pd-site]. -[r-project]: https://r-project.org -[pd-site]: https://pkgdown.jrwb.de/chemCal +[r-project]: https://www.r-project.org/ +[pd-site]: https://pkgdown.jrwb.de/chemCal/ diff --git a/_pkgdown.yml b/_pkgdown.yml index f5eeff8..7942085 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -2,3 +2,19 @@ title: chemCal template: bootswatch: spacelab + +reference: + - title: Main functions + contents: + - calplot + - lod + - loq + - inverse.predict + - title: Datasets + contents: + - din32645 + - massart97ex1 + - massart97ex3 + - rl95_cadmium + - rl95_toluene + - utstats14 diff --git a/docs/articles/chemCal.html b/docs/articles/chemCal.html index 4e145bf..bbcc568 100644 --- a/docs/articles/chemCal.html +++ b/docs/articles/chemCal.html @@ -98,7 +98,7 @@ <div class="sourceCode" id="cb1"><pre class="downlit sourceCode r"> <code class="sourceCode R"><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://pkgdown.jrwb.de/chemCal/" class="external-link">chemCal</a></span><span class="op">)</span> <span class="va">m0</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/stats/lm.html" class="external-link">lm</a></span><span class="op">(</span><span class="va">y</span> <span class="op">~</span> <span class="va">x</span>, data <span class="op">=</span> <span class="va">massart97ex3</span><span class="op">)</span> -<span class="fu"><a href="../reference/calplot.lm.html">calplot</a></span><span class="op">(</span><span class="va">m0</span><span class="op">)</span></code></pre></div> +<span class="fu"><a href="../reference/calplot.html">calplot</a></span><span class="op">(</span><span class="va">m0</span><span class="op">)</span></code></pre></div> <p><img src="chemCal_files/figure-html/unnamed-chunk-1-1.png" width="700"></p> <p>As we can see, the scatter increases with increasing x. This is also illustrated by one of the diagnostic plots for linear models provided by R:</p> <div class="sourceCode" id="cb2"><pre class="downlit sourceCode r"> diff --git a/docs/index.html b/docs/index.html index 4019484..7882a73 100644 --- a/docs/index.html +++ b/docs/index.html @@ -87,7 +87,7 @@ <div class="section level2"> <h2 id="installation">Installation<a class="anchor" aria-label="anchor" href="#installation"></a> </h2> -<p>From within <a href="https://r-project.org" class="external-link">R</a>, get the official chemCal release using</p> +<p>From within <a href="https://www.r-project.org/" class="external-link">R</a>, get the official chemCal release using</p> <div class="sourceCode" id="cb1"><pre class="downlit sourceCode r"> <code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/utils/install.packages.html" class="external-link">install.packages</a></span><span class="op">(</span><span class="st">"chemCal"</span><span class="op">)</span></code></pre></div> </div> @@ -101,7 +101,7 @@ <div class="sourceCode" id="cb2"><pre class="downlit sourceCode r"> <code class="sourceCode R"><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://pkgdown.jrwb.de/chemCal/" class="external-link">chemCal</a></span><span class="op">)</span> <span class="va">m0</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/stats/lm.html" class="external-link">lm</a></span><span class="op">(</span><span class="va">y</span> <span class="op">~</span> <span class="va">x</span>, data <span class="op">=</span> <span class="va">massart97ex3</span><span class="op">)</span> -<span class="fu"><a href="reference/calplot.lm.html">calplot</a></span><span class="op">(</span><span class="va">m0</span><span class="op">)</span></code></pre></div> +<span class="fu"><a href="reference/calplot.html">calplot</a></span><span class="op">(</span><span class="va">m0</span><span class="op">)</span></code></pre></div> <p><img src="reference/figures/README-calplot-1.png"><!-- --></p> </div> <div class="section level3"> @@ -169,7 +169,7 @@ <div class="section level2"> <h2 id="reference">Reference<a class="anchor" aria-label="anchor" href="#reference"></a> </h2> -<p>You can use the R help system to view documentation, or you can have a look at the <a href="https://pkgdown.jrwb.de/chemCal" class="external-link">online documentation</a>.</p> +<p>You can use the R help system to view documentation, or you can have a look at the <a href="https://pkgdown.jrwb.de/chemCal/" class="external-link">online documentation</a>.</p> </div> </div> </div> diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index dc4cced..3c1d018 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -3,5 +3,5 @@ pkgdown: 2.0.2 pkgdown_sha: ~ articles: chemCal: chemCal.html -last_built: 2022-03-31T16:32Z +last_built: 2022-03-31T17:56Z diff --git a/docs/reference/calplot-1.png b/docs/reference/calplot-1.png Binary files differnew file mode 100644 index 0000000..c2deae8 --- /dev/null +++ b/docs/reference/calplot-1.png diff --git a/docs/reference/calplot.html b/docs/reference/calplot.html new file mode 100644 index 0000000..88321b1 --- /dev/null +++ b/docs/reference/calplot.html @@ -0,0 +1,154 @@ +<!DOCTYPE html> +<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Plot calibration graphs from univariate linear models — calplot • chemCal</title><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"><script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><meta property="og:title" content="Plot calibration graphs from univariate linear models — calplot"><meta property="og:description" content="Produce graphics of calibration data, the fitted model as well as +confidence, and, for unweighted regression, prediction bands."><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]> +<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> +<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> +<![endif]--></head><body data-spy="scroll" data-target="#toc"> + + + <div class="container template-reference-topic"> + <header><div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <span class="navbar-brand"> + <a class="navbar-link" href="../index.html">chemCal</a> + <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">0.2.3</span> + </span> + </div> + + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"><li> + <a href="../articles/chemCal.html">Get started</a> +</li> +<li> + <a href="../reference/index.html">Reference</a> +</li> +<li> + <a href="../news/index.html">Changelog</a> +</li> + </ul><ul class="nav navbar-nav navbar-right"><li> + <a href="https://github.com/jranke/chemCal/" class="external-link"> + <span class="fab fa-github fa-lg"></span> + + </a> +</li> + </ul></div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + + </header><div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Plot calibration graphs from univariate linear models</h1> + <small class="dont-index">Source: <a href="https://github.com/jranke/chemCal/blob/HEAD/R/calplot.R" class="external-link"><code>R/calplot.R</code></a></small> + <div class="hidden name"><code>calplot.Rd</code></div> + </div> + + <div class="ref-description"> + <p>Produce graphics of calibration data, the fitted model as well as +confidence, and, for unweighted regression, prediction bands.</p> + </div> + + <div id="ref-usage"> + <div class="sourceCode"><pre class="sourceCode r"><code><span class="fu">calplot</span><span class="op">(</span> + <span class="va">object</span>, + xlim <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"auto"</span>, <span class="st">"auto"</span><span class="op">)</span>, + ylim <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"auto"</span>, <span class="st">"auto"</span><span class="op">)</span>, + xlab <span class="op">=</span> <span class="st">"Concentration"</span>, + ylab <span class="op">=</span> <span class="st">"Response"</span>, + legend_x <span class="op">=</span> <span class="st">"auto"</span>, + alpha <span class="op">=</span> <span class="fl">0.05</span>, + varfunc <span class="op">=</span> <span class="cn">NULL</span> +<span class="op">)</span></code></pre></div> + </div> + + <div id="arguments"> + <h2>Arguments</h2> + <dl><dt>object</dt> +<dd><p>A univariate model object of class <code><a href="https://rdrr.io/r/stats/lm.html" class="external-link">lm</a></code> or +<code><a href="https://rdrr.io/pkg/MASS/man/rlm.html" class="external-link">rlm</a></code> with model formula <code>y ~ x</code> or <code>y ~ x - +1</code>.</p></dd> +<dt>xlim</dt> +<dd><p>The limits of the plot on the x axis.</p></dd> +<dt>ylim</dt> +<dd><p>The limits of the plot on the y axis.</p></dd> +<dt>xlab</dt> +<dd><p>The label of the x axis.</p></dd> +<dt>ylab</dt> +<dd><p>The label of the y axis.</p></dd> +<dt>legend_x</dt> +<dd><p>An optional numeric value for adjusting the x coordinate of +the legend.</p></dd> +<dt>alpha</dt> +<dd><p>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 <code><a href="lod.html">lod</a></code> (see note +below).</p></dd> +<dt>varfunc</dt> +<dd><p>The variance function for generating the weights in the +model. Currently, this argument is ignored (see note below).</p></dd> +</dl></div> + <div id="value"> + <h2>Value</h2> + <p>A plot of the calibration data, of your fitted model as well as +lines showing the confidence limits. Prediction limits are only shown for +models from unweighted regression.</p> + </div> + <div id="note"> + <h2>Note</h2> + <p>Prediction bands for models from weighted linear regression require +weights for the data, for which responses should be predicted. Prediction +intervals using weights e.g. from a variance function are currently not +supported by the internally used function <code><a href="https://rdrr.io/r/stats/predict.lm.html" class="external-link">predict.lm</a></code>, +therefore, <code>calplot</code> does not draw prediction bands for such models.</p> +<p>It is possible to compare the <code>calplot</code> prediction bands with +the <code><a href="lod.html">lod</a></code> values if the <code><a href="lod.html">lod()</a></code> alpha and beta parameters +are half the value of the <code>calplot()</code> alpha parameter.</p> + </div> + <div id="author"> + <h2>Author</h2> + <p>Johannes Ranke</p> + </div> + + <div id="ref-examples"> + <h2>Examples</h2> + <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"></span> +<span class="r-in"><span class="fu"><a href="https://rdrr.io/r/utils/data.html" class="external-link">data</a></span><span class="op">(</span><span class="va">massart97ex3</span><span class="op">)</span></span> +<span class="r-in"><span class="va">m</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/stats/lm.html" class="external-link">lm</a></span><span class="op">(</span><span class="va">y</span> <span class="op">~</span> <span class="va">x</span>, data <span class="op">=</span> <span class="va">massart97ex3</span><span class="op">)</span></span> +<span class="r-in"><span class="fu">calplot</span><span class="op">(</span><span class="va">m</span><span class="op">)</span></span> +<span class="r-plt img"><img src="calplot-1.png" alt="" width="700" height="433"></span> +<span class="r-in"></span> +</code></pre></div> + </div> + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar"> + <nav id="toc" data-toggle="toc" class="sticky-top"><h2 data-toc-skip>Contents</h2> + </nav></div> +</div> + + + <footer><div class="copyright"> + <p></p><p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.2.</p> +</div> + + </footer></div> + + + + + + + </body></html> + diff --git a/docs/reference/din32645.html b/docs/reference/din32645.html index 1c02f36..ba6246a 100644 --- a/docs/reference/din32645.html +++ b/docs/reference/din32645.html @@ -47,7 +47,7 @@ <div class="col-md-9 contents"> <div class="page-header"> <h1>Calibration data from DIN 32645</h1> - + <small class="dont-index">Source: <a href="https://github.com/jranke/chemCal/blob/HEAD/R/chemCal-package.R" class="external-link"><code>R/chemCal-package.R</code></a></small> <div class="hidden name"><code>din32645.Rd</code></div> </div> @@ -55,9 +55,6 @@ <p>Sample dataset to test the package.</p> </div> - <div id="ref-usage"> - <div class="sourceCode"><pre class="sourceCode r"><code><span class="fu"><a href="https://rdrr.io/r/utils/data.html" class="external-link">data</a></span><span class="op">(</span><span class="va">din32645</span><span class="op">)</span></code></pre></div> - </div> <div id="format"> <h2>Format</h2> @@ -66,18 +63,19 @@ <div id="references"> <h2>References</h2> <p>DIN 32645 (equivalent to ISO 11843), Beuth Verlag, Berlin, 1994</p> -<p>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.</p> -<p>Currie, L. A. (1997) Nomenclature in evaluation of analytical methods including - detection and quantification capabilities (IUPAC Recommendations 1995). - Analytica Chimica Acta 391, 105 - 126.</p> +<p>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.</p> +<p>Currie, L. A. (1997) Nomenclature in evaluation of analytical methods +including detection and quantification capabilities (IUPAC Recommendations +1995). Analytica Chimica Acta 391, 105 - 126.</p> </div> <div id="ref-examples"> <h2>Examples</h2> - <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span class="va">m</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/stats/lm.html" class="external-link">lm</a></span><span class="op">(</span><span class="va">y</span> <span class="op">~</span> <span class="va">x</span>, data <span class="op">=</span> <span class="va">din32645</span><span class="op">)</span></span> -<span class="r-in"><span class="fu"><a href="calplot.lm.html">calplot</a></span><span class="op">(</span><span class="va">m</span><span class="op">)</span></span> + <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"></span> +<span class="r-in"><span class="va">m</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/stats/lm.html" class="external-link">lm</a></span><span class="op">(</span><span class="va">y</span> <span class="op">~</span> <span class="va">x</span>, data <span class="op">=</span> <span class="va">din32645</span><span class="op">)</span></span> +<span class="r-in"><span class="fu"><a href="calplot.html">calplot</a></span><span class="op">(</span><span class="va">m</span><span class="op">)</span></span> <span class="r-plt img"><img src="din32645-1.png" alt="" width="700" height="433"></span> <span class="r-in"></span> <span class="r-in"><span class="co">## Prediction of x with confidence interval</span></span> @@ -118,6 +116,7 @@ <span class="r-in"><span class="co"># LQ = 3.04 * LC (Currie 1999, p. 120)</span></span> <span class="r-in"><span class="fl">3.04</span> <span class="op">*</span> <span class="fu"><a href="lod.html">lod</a></span><span class="op">(</span><span class="va">m</span>, alpha <span class="op">=</span> <span class="fl">0.01</span>, beta <span class="op">=</span> <span class="fl">0.5</span><span class="op">)</span><span class="op">$</span><span class="va">x</span></span> <span class="r-out co"><span class="r-pr">#></span> [1] 0.2122306</span> +<span class="r-in"></span> </code></pre></div> </div> </div> diff --git a/docs/reference/index.html b/docs/reference/index.html index 3685007..9812256 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -50,22 +50,14 @@ </div> <table class="ref-index"><colgroup><col class="alias"><col class="title"></colgroup><tbody><tr><th colspan="2"> - <h2 id="all-functions">All functions <a href="#all-functions" class="anchor" aria-hidden="true"></a></h2> + <h2 id="main-functions">Main functions <a href="#main-functions" class="anchor" aria-hidden="true"></a></h2> <p class="section-desc"></p> </th> </tr></tbody><tbody><tr><td> - <p><code><a href="calplot.lm.html">calplot()</a></code> </p> + <p><code><a href="calplot.html">calplot()</a></code> </p> </td> <td><p>Plot calibration graphs from univariate linear models</p></td> </tr><tr><td> - <p><code><a href="din32645.html">din32645</a></code> </p> - </td> - <td><p>Calibration data from DIN 32645</p></td> - </tr><tr><td> - <p><code><a href="inverse.predict.html">inverse.predict()</a></code> </p> - </td> - <td><p>Predict x from y for a linear calibration</p></td> - </tr><tr><td> <p><code><a href="lod.html">lod()</a></code> </p> </td> <td><p>Estimate a limit of detection (LOD)</p></td> @@ -74,6 +66,18 @@ </td> <td><p>Estimate a limit of quantification (LOQ)</p></td> </tr><tr><td> + <p><code><a href="inverse.predict.html">inverse.predict()</a></code> </p> + </td> + <td><p>Predict x from y for a linear calibration</p></td> + </tr></tbody><tbody><tr><th colspan="2"> + <h2 id="datasets">Datasets <a href="#datasets" class="anchor" aria-hidden="true"></a></h2> + <p class="section-desc"></p> + </th> + </tr></tbody><tbody><tr><td> + <p><code><a href="din32645.html">din32645</a></code> </p> + </td> + <td><p>Calibration data from DIN 32645</p></td> + </tr><tr><td> <p><code><a href="massart97ex1.html">massart97ex1</a></code> </p> </td> <td><p>Calibration data from Massart et al. (1997), example 1</p></td> @@ -84,7 +88,8 @@ </tr><tr><td> <p><code><a href="rl95_cadmium.html">rl95_cadmium</a></code> </p> </td> - <td><p>Cadmium concentrations measured by AAS as reported by Rocke and Lorenzato (1995)</p></td> + <td><p>Cadmium concentrations measured by AAS as reported by Rocke and Lorenzato +(1995)</p></td> </tr><tr><td> <p><code><a href="rl95_toluene.html">rl95_toluene</a></code> </p> </td> diff --git a/docs/reference/inverse.predict.html b/docs/reference/inverse.predict.html index cb9fe98..6fe081e 100644 --- a/docs/reference/inverse.predict.html +++ b/docs/reference/inverse.predict.html @@ -1,14 +1,14 @@ <!DOCTYPE html> -<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Predict x from y for a linear calibration — inverse.predict • chemCal</title><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"><script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><meta property="og:title" content="Predict x from y for a linear calibration — inverse.predict"><meta property="og:description" content="This function predicts x values using a univariate linear model that has been - generated for the purpose of calibrating a measurement method. Prediction - intervals are given at the specified confidence level. - The calculation method was taken from Massart et al. (1997). In particular, - Equations 8.26 and 8.28 were combined in order to yield a general treatment - of inverse prediction for univariate linear models, taking into account - weights that have been used to create the linear model, and at the same - time providing the possibility to specify a precision in sample measurements - differing from the precision in standard samples used for the calibration. - This is elaborated in the package vignette."><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]> +<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Predict x from y for a linear calibration — inverse.predict • chemCal</title><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"><script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><meta property="og:title" content="Predict x from y for a linear calibration — inverse.predict"><meta property="og:description" content="This function predicts x values using a univariate linear model that has +been generated for the purpose of calibrating a measurement method. +Prediction intervals are given at the specified confidence level. The +calculation method was taken from Massart et al. (1997). In particular, +Equations 8.26 and 8.28 were combined in order to yield a general treatment +of inverse prediction for univariate linear models, taking into account +weights that have been used to create the linear model, and at the same time +providing the possibility to specify a precision in sample measurements +differing from the precision in standard samples used for the calibration. +This is elaborated in the package vignette."><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--></head><body data-spy="scroll" data-target="#toc"> @@ -56,73 +56,87 @@ <div class="col-md-9 contents"> <div class="page-header"> <h1>Predict x from y for a linear calibration</h1> - + <small class="dont-index">Source: <a href="https://github.com/jranke/chemCal/blob/HEAD/R/inverse.predict.lm.R" class="external-link"><code>R/inverse.predict.lm.R</code></a></small> <div class="hidden name"><code>inverse.predict.Rd</code></div> </div> <div class="ref-description"> - <p>This function predicts x values using a univariate linear model that has been - generated for the purpose of calibrating a measurement method. Prediction - intervals are given at the specified confidence level. - The calculation method was taken from Massart et al. (1997). In particular, - Equations 8.26 and 8.28 were combined in order to yield a general treatment - of inverse prediction for univariate linear models, taking into account - weights that have been used to create the linear model, and at the same - time providing the possibility to specify a precision in sample measurements - differing from the precision in standard samples used for the calibration. - This is elaborated in the package vignette.</p> + <p>This function predicts x values using a univariate linear model that has +been generated for the purpose of calibrating a measurement method. +Prediction intervals are given at the specified confidence level. The +calculation method was taken from Massart et al. (1997). In particular, +Equations 8.26 and 8.28 were combined in order to yield a general treatment +of inverse prediction for univariate linear models, taking into account +weights that have been used to create the linear model, and at the same time +providing the possibility to specify a precision in sample measurements +differing from the precision in standard samples used for the calibration. +This is elaborated in the package vignette.</p> </div> <div id="ref-usage"> - <div class="sourceCode"><pre class="sourceCode r"><code><span class="fu">inverse.predict</span><span class="op">(</span><span class="va">object</span>, <span class="va">newdata</span>, <span class="va">...</span>, - <span class="va">ws</span>, alpha<span class="op">=</span><span class="fl">0.05</span>, var.s <span class="op">=</span> <span class="st">"auto"</span><span class="op">)</span></code></pre></div> + <div class="sourceCode"><pre class="sourceCode r"><code><span class="fu">inverse.predict</span><span class="op">(</span> + <span class="va">object</span>, + <span class="va">newdata</span>, + <span class="va">...</span>, + ws <span class="op">=</span> <span class="st">"auto"</span>, + alpha <span class="op">=</span> <span class="fl">0.05</span>, + var.s <span class="op">=</span> <span class="st">"auto"</span> +<span class="op">)</span></code></pre></div> </div> <div id="arguments"> <h2>Arguments</h2> <dl><dt>object</dt> -<dd><p>A univariate model object of class <code><a href="https://rdrr.io/r/stats/lm.html" class="external-link">lm</a></code> or - <code><a href="https://rdrr.io/pkg/MASS/man/rlm.html" class="external-link">rlm</a></code> - with model formula <code>y ~ x</code> or <code>y ~ x - 1</code>.</p></dd> +<dd><p>A univariate model object of class <code><a href="https://rdrr.io/r/stats/lm.html" class="external-link">lm</a></code> or +<code><a href="https://rdrr.io/pkg/MASS/man/rlm.html" class="external-link">rlm</a></code> with model formula <code>y ~ x</code> or <code>y ~ x - +1</code>.</p></dd> <dt>newdata</dt> <dd><p>A vector of observed y values for one sample.</p></dd> <dt>...</dt> -<dd><p>Placeholder for further arguments that might be needed by - future implementations.</p></dd> +<dd><p>Placeholder for further arguments that might be needed by +future implementations.</p></dd> <dt>ws</dt> <dd><p>The weight attributed to the sample. This argument is obligatory - if <code>object</code> has weights.</p></dd> +if <code>object</code> has weights.</p></dd> <dt>alpha</dt> -<dd><p>The error tolerance level for the confidence interval to be reported.</p></dd> +<dd><p>The error tolerance level for the confidence interval to be +reported.</p></dd> <dt>var.s</dt> -<dd><p>The estimated variance of the sample measurements. The default is to take - the residual standard error from the calibration and to adjust it - using <code>ws</code>, if applicable. This means that <code>var.s</code> - overrides <code>ws</code>.</p></dd> +<dd><p>The estimated variance of the sample measurements. The default +is to take the residual standard error from the calibration and to adjust it +using <code>ws</code>, if applicable. This means that <code>var.s</code> overrides +<code>ws</code>.</p></dd> </dl></div> <div id="value"> <h2>Value</h2> <p>A list containing the predicted x value, its standard error and a - confidence interval.</p> +confidence interval.</p> + </div> + <div id="details"> + <h2>Details</h2> + <p>This is an implementation of Equation (8.28) in the Handbook of Chemometrics +and Qualimetrics, Part A, Massart et al (1997), page 200, validated with +Example 8 on the same page, extended as specified in the package vignette</p> </div> <div id="note"> <h2>Note</h2> - <p>The function was validated with examples 7 and 8 from Massart et al. (1997). - Note that the behaviour of inverse.predict changed with chemCal version - 0.2.1. Confidence intervals for x values obtained from calibrations with - replicate measurements did not take the variation about the means into account. - Please refer to the vignette for details.</p> + <p>The function was validated with examples 7 and 8 from Massart et al. +(1997). Note that the behaviour of inverse.predict changed with chemCal +version 0.2.1. Confidence intervals for x values obtained from calibrations +with replicate measurements did not take the variation about the means into +account. Please refer to the vignette for details.</p> </div> <div id="references"> <h2>References</h2> - <p>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, - p. 200</p> + <p>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, p. 200</p> </div> <div id="ref-examples"> <h2>Examples</h2> - <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span class="co"># This is example 7 from Chapter 8 in Massart et al. (1997)</span></span> + <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"></span> +<span class="r-in"><span class="co"># This is example 7 from Chapter 8 in Massart et al. (1997)</span></span> <span class="r-in"><span class="va">m</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/stats/lm.html" class="external-link">lm</a></span><span class="op">(</span><span class="va">y</span> <span class="op">~</span> <span class="va">x</span>, data <span class="op">=</span> <span class="va">massart97ex1</span><span class="op">)</span></span> <span class="r-in"><span class="fu">inverse.predict</span><span class="op">(</span><span class="va">m</span>, <span class="fl">15</span><span class="op">)</span> <span class="co"># 6.1 +- 4.9</span></span> <span class="r-out co"><span class="r-pr">#></span> $Prediction</span> @@ -204,6 +218,7 @@ <span class="r-out co"><span class="r-pr">#></span> [1] 36.20523 51.91526</span> <span class="r-out co"><span class="r-pr">#></span> </span> <span class="r-in"></span> +<span class="r-in"></span> </code></pre></div> </div> </div> diff --git a/docs/reference/lod.html b/docs/reference/lod.html index a2d66ce..1fbae76 100644 --- a/docs/reference/lod.html +++ b/docs/reference/lod.html @@ -1,12 +1,12 @@ <!DOCTYPE html> <!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Estimate a limit of detection (LOD) — lod • chemCal</title><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"><script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><meta property="og:title" content="Estimate a limit of detection (LOD) — lod"><meta property="og:description" content="The decision limit (German: Nachweisgrenze) is defined as the signal or - analyte concentration that is significantly different from the blank signal - with a first order error alpha (one-sided significance test). - The detection limit, or more precise, the minimum detectable value - (German: Erfassungsgrenze), is then defined as the signal or analyte - concentration where the probability that the signal is not detected although - the analyte is present (type II or false negative error), is beta (also a - one-sided significance test)."><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]> +analyte concentration that is significantly different from the blank signal +with a first order error alpha (one-sided significance test). The detection +limit, or more precise, the minimum detectable value (German: +Erfassungsgrenze), is then defined as the signal or analyte concentration +where the probability that the signal is not detected although the analyte +is present (type II or false negative error), is beta (also a one-sided +significance test)."><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--></head><body data-spy="scroll" data-target="#toc"> @@ -54,76 +54,81 @@ <div class="col-md-9 contents"> <div class="page-header"> <h1>Estimate a limit of detection (LOD)</h1> - + <small class="dont-index">Source: <a href="https://github.com/jranke/chemCal/blob/HEAD/R/lod.R" class="external-link"><code>R/lod.R</code></a></small> <div class="hidden name"><code>lod.Rd</code></div> </div> <div class="ref-description"> <p>The decision limit (German: Nachweisgrenze) is defined as the signal or - analyte concentration that is significantly different from the blank signal - with a first order error alpha (one-sided significance test). - The detection limit, or more precise, the minimum detectable value - (German: Erfassungsgrenze), is then defined as the signal or analyte - concentration where the probability that the signal is not detected although - the analyte is present (type II or false negative error), is beta (also a - one-sided significance test).</p> +analyte concentration that is significantly different from the blank signal +with a first order error alpha (one-sided significance test). The detection +limit, or more precise, the minimum detectable value (German: +Erfassungsgrenze), is then defined as the signal or analyte concentration +where the probability that the signal is not detected although the analyte +is present (type II or false negative error), is beta (also a one-sided +significance test).</p> </div> <div id="ref-usage"> - <div class="sourceCode"><pre class="sourceCode r"><code><span class="fu">lod</span><span class="op">(</span><span class="va">object</span>, <span class="va">...</span>, alpha <span class="op">=</span> <span class="fl">0.05</span>, beta <span class="op">=</span> <span class="fl">0.05</span>, method <span class="op">=</span> <span class="st">"default"</span>, tol <span class="op">=</span> <span class="st">"default"</span><span class="op">)</span></code></pre></div> + <div class="sourceCode"><pre class="sourceCode r"><code><span class="fu">lod</span><span class="op">(</span> + <span class="va">object</span>, + <span class="va">...</span>, + alpha <span class="op">=</span> <span class="fl">0.05</span>, + beta <span class="op">=</span> <span class="fl">0.05</span>, + method <span class="op">=</span> <span class="st">"default"</span>, + tol <span class="op">=</span> <span class="st">"default"</span> +<span class="op">)</span></code></pre></div> </div> <div id="arguments"> <h2>Arguments</h2> <dl><dt>object</dt> -<dd><p>A univariate model object of class <code><a href="https://rdrr.io/r/stats/lm.html" class="external-link">lm</a></code> or - <code><a href="https://rdrr.io/pkg/MASS/man/rlm.html" class="external-link">rlm</a></code> - with model formula <code>y ~ x</code> or <code>y ~ x - 1</code>, - optionally from a weighted regression.</p></dd> +<dd><p>A univariate model object of class <code><a href="https://rdrr.io/r/stats/lm.html" class="external-link">lm</a></code> or +<code><a href="https://rdrr.io/pkg/MASS/man/rlm.html" class="external-link">rlm</a></code> with model formula <code>y ~ x</code> or <code>y ~ x - +1</code>, optionally from a weighted regression.</p></dd> <dt>...</dt> -<dd><p>Placeholder for further arguments that might be needed by - future implementations.</p></dd> +<dd><p>Placeholder for further arguments that might be needed by +future implementations.</p></dd> <dt>alpha</dt> <dd><p>The error tolerance for the decision limit (critical value).</p></dd> <dt>beta</dt> <dd><p>The error tolerance beta for the detection limit.</p></dd> <dt>method</dt> -<dd><p>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.</p></dd> +<dd><p>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.</p></dd> <dt>tol</dt> <dd><p>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.</p></dd> +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.</p></dd> </dl></div> <div id="value"> <h2>Value</h2> - <p>A list containig the corresponding x and y values of the estimated limit of - detection of a model used for calibration.</p> + <p>A list containig the corresponding x and y values of the estimated +limit of detection of a model used for calibration.</p> </div> <div id="note"> <h2>Note</h2> - <p>- The default values for alpha and beta are the ones 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). - - The calculation of a LOD from weighted calibration models requires - a weights argument for the internally used <code><a href="https://rdrr.io/r/stats/predict.lm.html" class="external-link">predict.lm</a></code> - function, which is currently not supported in R.</p> + <p>* The default values for alpha and beta are the ones 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). +* The calculation of a LOD from weighted calibration models requires a +weights argument for the internally used <code><a href="https://rdrr.io/r/stats/predict.lm.html" class="external-link">predict.lm</a></code> +function, which is currently not supported in R.</p> </div> <div id="references"> <h2>References</h2> - <p>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</p> + <p>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</p> <p>J. Inczedy, T. Lengyel, and A.M. Ure (2002) International Union of Pure and - Applied Chemistry Compendium of Analytical Nomenclature: Definitive Rules. - Web edition.</p> -<p>Currie, L. A. (1997) Nomenclature in evaluation of analytical methods including - detection and quantification capabilities (IUPAC Recommendations 1995). - Analytica Chimica Acta 391, 105 - 126.</p> +Applied Chemistry Compendium of Analytical Nomenclature: Definitive Rules. +Web edition.</p> +<p>Currie, L. A. (1997) Nomenclature in evaluation of analytical methods +including detection and quantification capabilities (IUPAC Recommendations +1995). Analytica Chimica Acta 391, 105 - 126.</p> </div> <div id="see-also"> <h2>See also</h2> @@ -132,7 +137,8 @@ <div id="ref-examples"> <h2>Examples</h2> - <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span class="va">m</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/stats/lm.html" class="external-link">lm</a></span><span class="op">(</span><span class="va">y</span> <span class="op">~</span> <span class="va">x</span>, data <span class="op">=</span> <span class="va">din32645</span><span class="op">)</span></span> + <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"></span> +<span class="r-in"><span class="va">m</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/stats/lm.html" class="external-link">lm</a></span><span class="op">(</span><span class="va">y</span> <span class="op">~</span> <span class="va">x</span>, data <span class="op">=</span> <span class="va">din32645</span><span class="op">)</span></span> <span class="r-in"><span class="fu">lod</span><span class="op">(</span><span class="va">m</span><span class="op">)</span> </span> <span class="r-out co"><span class="r-pr">#></span> $x</span> <span class="r-out co"><span class="r-pr">#></span> [1] 0.08655484</span> @@ -150,6 +156,7 @@ <span class="r-out co"><span class="r-pr">#></span> $y</span> <span class="r-out co"><span class="r-pr">#></span> [1] 3155.393</span> <span class="r-out co"><span class="r-pr">#></span> </span> +<span class="r-in"></span> </code></pre></div> </div> </div> diff --git a/docs/reference/loq.html b/docs/reference/loq.html index 0960251..86c8f43 100644 --- a/docs/reference/loq.html +++ b/docs/reference/loq.html @@ -1,11 +1,10 @@ <!DOCTYPE html> -<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Estimate a limit of quantification (LOQ) — loq • chemCal</title><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"><script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><meta property="og:title" content="Estimate a limit of quantification (LOQ) — loq"><meta property="og:description" content="The limit of quantification is the x value, where the relative error - of the quantification given the calibration model reaches a prespecified - value 1/k. Thus, it is the solution of the equation - $$L = k c(L)$$ - where c(L) is half of the length of the confidence interval at the limit L - (DIN 32645, equivalent to ISO 11843). c(L) is internally estimated by - inverse.predict, and L is obtained by iteration."><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]> +<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Estimate a limit of quantification (LOQ) — loq • chemCal</title><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"><script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><meta property="og:title" content="Estimate a limit of quantification (LOQ) — loq"><meta property="og:description" content="The limit of quantification is the x value, where the relative error of the +quantification given the calibration model reaches a prespecified value 1/k. +Thus, it is the solution of the equation $$L = k c(L)$$ +where c(L) is half of the length of the confidence interval at the limit L +(DIN 32645, equivalent to ISO 11843). c(L) is internally estimated by +inverse.predict, and L is obtained by iteration."><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--></head><body data-spy="scroll" data-target="#toc"> @@ -53,69 +52,75 @@ <div class="col-md-9 contents"> <div class="page-header"> <h1>Estimate a limit of quantification (LOQ)</h1> - + <small class="dont-index">Source: <a href="https://github.com/jranke/chemCal/blob/HEAD/R/loq.R" class="external-link"><code>R/loq.R</code></a></small> <div class="hidden name"><code>loq.Rd</code></div> </div> <div class="ref-description"> - <p>The limit of quantification is the x value, where the relative error - of the quantification given the calibration model reaches a prespecified - value 1/k. Thus, it is the solution of the equation - $$L = k c(L)$$ - where c(L) is half of the length of the confidence interval at the limit L - (DIN 32645, equivalent to ISO 11843). c(L) is internally estimated by - <code><a href="inverse.predict.html">inverse.predict</a></code>, and L is obtained by iteration.</p> + <p>The limit of quantification is the x value, where the relative error of the +quantification given the calibration model reaches a prespecified value 1/k. +Thus, it is the solution of the equation $$L = k c(L)$$ +where c(L) is half of the length of the confidence interval at the limit L +(DIN 32645, equivalent to ISO 11843). c(L) is internally estimated by +<code><a href="inverse.predict.html">inverse.predict</a></code>, and L is obtained by iteration.</p> </div> <div id="ref-usage"> - <div class="sourceCode"><pre class="sourceCode r"><code><span class="fu">loq</span><span class="op">(</span><span class="va">object</span>, <span class="va">...</span>, alpha <span class="op">=</span> <span class="fl">0.05</span>, k <span class="op">=</span> <span class="fl">3</span>, n <span class="op">=</span> <span class="fl">1</span>, w.loq <span class="op">=</span> <span class="st">"auto"</span>, - var.loq <span class="op">=</span> <span class="st">"auto"</span>, tol <span class="op">=</span> <span class="st">"default"</span><span class="op">)</span></code></pre></div> + <div class="sourceCode"><pre class="sourceCode r"><code><span class="fu">loq</span><span class="op">(</span> + <span class="va">object</span>, + <span class="va">...</span>, + alpha <span class="op">=</span> <span class="fl">0.05</span>, + k <span class="op">=</span> <span class="fl">3</span>, + n <span class="op">=</span> <span class="fl">1</span>, + w.loq <span class="op">=</span> <span class="st">"auto"</span>, + var.loq <span class="op">=</span> <span class="st">"auto"</span>, + tol <span class="op">=</span> <span class="st">"default"</span> +<span class="op">)</span></code></pre></div> </div> <div id="arguments"> <h2>Arguments</h2> <dl><dt>object</dt> -<dd><p>A univariate model object of class <code><a href="https://rdrr.io/r/stats/lm.html" class="external-link">lm</a></code> or - <code><a href="https://rdrr.io/pkg/MASS/man/rlm.html" class="external-link">rlm</a></code> - with model formula <code>y ~ x</code> or <code>y ~ x - 1</code>, - optionally from a weighted regression. If weights are specified - in the model, either <code>w.loq</code> or <code>var.loq</code> have to - be specified.</p></dd> -<dt>alpha</dt> -<dd><p>The error tolerance for the prediction of x values in the calculation.</p></dd> +<dd><p>A univariate model object of class <code><a href="https://rdrr.io/r/stats/lm.html" class="external-link">lm</a></code> or +<code><a href="https://rdrr.io/pkg/MASS/man/rlm.html" class="external-link">rlm</a></code> with model formula <code>y ~ x</code> or <code>y ~ x - +1</code>, optionally from a weighted regression. If weights are specified in the +model, either <code>w.loq</code> or <code>var.loq</code> have to be specified.</p></dd> <dt>...</dt> -<dd><p>Placeholder for further arguments that might be needed by - future implementations.</p></dd> +<dd><p>Placeholder for further arguments that might be needed by +future implementations.</p></dd> +<dt>alpha</dt> +<dd><p>The error tolerance for the prediction of x values in the +calculation.</p></dd> <dt>k</dt> -<dd><p>The inverse of the maximum relative error tolerated at the - desired LOQ.</p></dd> +<dd><p>The inverse of the maximum relative error tolerated at the desired +LOQ.</p></dd> <dt>n</dt> <dd><p>The number of replicate measurements for which the LOQ should be - specified.</p></dd> +specified.</p></dd> <dt>w.loq</dt> -<dd><p>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 <code><a href="massart97ex3.html">massart97ex3</a></code> for - an example how to take advantage of knowledge about the - variance function.</p></dd> +<dd><p>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 <code><a href="massart97ex3.html">massart97ex3</a></code> for an example how to take +advantage of knowledge about the variance function.</p></dd> <dt>var.loq</dt> -<dd><p>The approximate variance at the LOQ. The default value is - calculated from the model.</p></dd> +<dd><p>The approximate variance at the LOQ. The default value is +calculated from the model.</p></dd> <dt>tol</dt> -<dd><p>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.</p></dd> +<dd><p>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.</p></dd> </dl></div> <div id="value"> <h2>Value</h2> - <p>The estimated limit of quantification for a model used for calibration.</p> + <p>The estimated limit of quantification for a model used for +calibration.</p> </div> <div id="note"> <h2>Note</h2> - <p>- IUPAC recommends to base the LOQ on the standard deviation of the signal - where x = 0. - - The calculation of a LOQ based on weighted regression is non-standard - and therefore not tested. Feedback is welcome.</p> + <p>* IUPAC recommends to base the LOQ on the standard deviation of the +signal where x = 0. +* The calculation of a LOQ based on weighted regression is non-standard and +therefore not tested. Feedback is welcome.</p> </div> <div id="see-also"> <h2>See also</h2> @@ -124,7 +129,8 @@ <div id="ref-examples"> <h2>Examples</h2> - <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span class="va">m</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/stats/lm.html" class="external-link">lm</a></span><span class="op">(</span><span class="va">y</span> <span class="op">~</span> <span class="va">x</span>, data <span class="op">=</span> <span class="va">massart97ex1</span><span class="op">)</span></span> + <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"></span> +<span class="r-in"><span class="va">m</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/stats/lm.html" class="external-link">lm</a></span><span class="op">(</span><span class="va">y</span> <span class="op">~</span> <span class="va">x</span>, data <span class="op">=</span> <span class="va">massart97ex1</span><span class="op">)</span></span> <span class="r-in"><span class="fu">loq</span><span class="op">(</span><span class="va">m</span><span class="op">)</span></span> <span class="r-out co"><span class="r-pr">#></span> $x</span> <span class="r-out co"><span class="r-pr">#></span> [1] 13.97764</span> @@ -141,6 +147,7 @@ <span class="r-out co"><span class="r-pr">#></span> $y</span> <span class="r-out co"><span class="r-pr">#></span> [1] 22.68539</span> <span class="r-out co"><span class="r-pr">#></span> </span> +<span class="r-in"></span> </code></pre></div> </div> </div> diff --git a/docs/reference/massart97ex1.html b/docs/reference/massart97ex1.html index e5dd85a..a02dfe0 100644 --- a/docs/reference/massart97ex1.html +++ b/docs/reference/massart97ex1.html @@ -47,7 +47,7 @@ <div class="col-md-9 contents"> <div class="page-header"> <h1>Calibration data from Massart et al. (1997), example 1</h1> - + <small class="dont-index">Source: <a href="https://github.com/jranke/chemCal/blob/HEAD/R/chemCal-package.R" class="external-link"><code>R/chemCal-package.R</code></a></small> <div class="hidden name"><code>massart97ex1.Rd</code></div> </div> @@ -55,9 +55,6 @@ <p>Sample dataset from p. 175 to test the package.</p> </div> - <div id="ref-usage"> - <div class="sourceCode"><pre class="sourceCode r"><code><span class="fu"><a href="https://rdrr.io/r/utils/data.html" class="external-link">data</a></span><span class="op">(</span><span class="va">massart97ex1</span><span class="op">)</span></code></pre></div> - </div> <div id="format"> <h2>Format</h2> @@ -65,9 +62,9 @@ </div> <div id="source"> <h2>Source</h2> - <p>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 8.</p> + <p>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 8.</p> </div> </div> diff --git a/docs/reference/massart97ex3.html b/docs/reference/massart97ex3.html index 4196882..5cbdbd6 100644 --- a/docs/reference/massart97ex3.html +++ b/docs/reference/massart97ex3.html @@ -47,7 +47,7 @@ <div class="col-md-9 contents"> <div class="page-header"> <h1>Calibration data from Massart et al. (1997), example 3</h1> - + <small class="dont-index">Source: <a href="https://github.com/jranke/chemCal/blob/HEAD/R/chemCal-package.R" class="external-link"><code>R/chemCal-package.R</code></a></small> <div class="hidden name"><code>massart97ex3.Rd</code></div> </div> @@ -55,25 +55,23 @@ <p>Sample dataset from p. 188 to test the package.</p> </div> - <div id="ref-usage"> - <div class="sourceCode"><pre class="sourceCode r"><code><span class="va">massart97ex3</span></code></pre></div> - </div> <div id="format"> <h2>Format</h2> - <p>A dataframe containing 6 levels of x values with 5 - observations of y for each level.</p> + <p>A dataframe containing 6 levels of x values with 5 observations of y +for each level.</p> </div> <div id="source"> <h2>Source</h2> - <p>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 8.</p> + <p>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 8.</p> </div> <div id="ref-examples"> <h2>Examples</h2> - <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span class="co"># For reproducing the results for replicate standard measurements in example 8,</span></span> + <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"></span> +<span class="r-in"><span class="co"># For reproducing the results for replicate standard measurements in example 8,</span></span> <span class="r-in"><span class="co"># we need to do the calibration on the means when using chemCal > 0.2</span></span> <span class="r-in"><span class="va">weights</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/with.html" class="external-link">with</a></span><span class="op">(</span><span class="va">massart97ex3</span>, <span class="op">{</span></span> <span class="r-in"> <span class="va">yx</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/split.html" class="external-link">split</a></span><span class="op">(</span><span class="va">y</span>, <span class="va">x</span><span class="op">)</span></span> @@ -149,6 +147,7 @@ <span class="r-in"><span class="co"># The weight for the loq should therefore be derived at x = 7.3 instead</span></span> <span class="r-in"><span class="co"># of 15, but the graphical procedure of Massart (p. 201) to derive the </span></span> <span class="r-in"><span class="co"># variances on which the weights are based is quite inaccurate anyway. </span></span> +<span class="r-in"></span> </code></pre></div> </div> </div> diff --git a/docs/reference/rl95_cadmium.html b/docs/reference/rl95_cadmium.html index da9294d..4ddb8e4 100644 --- a/docs/reference/rl95_cadmium.html +++ b/docs/reference/rl95_cadmium.html @@ -1,5 +1,7 @@ <!DOCTYPE html> -<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Cadmium concentrations measured by AAS as reported by Rocke and Lorenzato (1995) — rl95_cadmium • chemCal</title><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"><script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><meta property="og:title" content="Cadmium concentrations measured by AAS as reported by Rocke and Lorenzato (1995) — rl95_cadmium"><meta property="og:description" content="Dataset reproduced from Table 1 in Rocke and Lorenzato (1995)."><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]> +<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Cadmium concentrations measured by AAS as reported by Rocke and Lorenzato +(1995) — rl95_cadmium • chemCal</title><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"><script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><meta property="og:title" content="Cadmium concentrations measured by AAS as reported by Rocke and Lorenzato +(1995) — rl95_cadmium"><meta property="og:description" content="Dataset reproduced from Table 1 in Rocke and Lorenzato (1995)."><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--></head><body data-spy="scroll" data-target="#toc"> @@ -46,8 +48,9 @@ </header><div class="row"> <div class="col-md-9 contents"> <div class="page-header"> - <h1>Cadmium concentrations measured by AAS as reported by Rocke and Lorenzato (1995)</h1> - + <h1>Cadmium concentrations measured by AAS as reported by Rocke and Lorenzato +(1995)</h1> + <small class="dont-index">Source: <a href="https://github.com/jranke/chemCal/blob/HEAD/R/chemCal-package.R" class="external-link"><code>R/chemCal-package.R</code></a></small> <div class="hidden name"><code>rl95_cadmium.Rd</code></div> </div> @@ -58,13 +61,13 @@ <div id="format"> <h2>Format</h2> - <p>A dataframe containing four replicate observations for each - of the six calibration standards.</p> + <p>A dataframe containing four replicate observations for each of the +six calibration standards.</p> </div> <div id="source"> <h2>Source</h2> - <p>Rocke, David M. und Lorenzato, Stefan (1995) A two-component model for - measurement error in analytical chemistry. Technometrics 37(2), 176-184.</p> + <p>Rocke, David M. und Lorenzato, Stefan (1995) A two-component model +for measurement error in analytical chemistry. Technometrics 37(2), 176-184.</p> </div> </div> diff --git a/docs/reference/rl95_toluene.html b/docs/reference/rl95_toluene.html index fb071e1..4c8c7d2 100644 --- a/docs/reference/rl95_toluene.html +++ b/docs/reference/rl95_toluene.html @@ -1,7 +1,7 @@ <!DOCTYPE html> <!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Toluene amounts measured by GC/MS as reported by Rocke and Lorenzato (1995) — rl95_toluene • chemCal</title><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"><script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><meta property="og:title" content="Toluene amounts measured by GC/MS as reported by Rocke and Lorenzato (1995) — rl95_toluene"><meta property="og:description" content="Dataset reproduced from Table 4 in Rocke and Lorenzato (1995). The toluene - amount in the calibration samples is given in picograms per 100 µL. - Presumably this is the volume that was injected into the instrument."><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]> +amount in the calibration samples is given in picograms per 100 µL. +Presumably this is the volume that was injected into the instrument."><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--></head><body data-spy="scroll" data-target="#toc"> @@ -49,26 +49,26 @@ <div class="col-md-9 contents"> <div class="page-header"> <h1>Toluene amounts measured by GC/MS as reported by Rocke and Lorenzato (1995)</h1> - + <small class="dont-index">Source: <a href="https://github.com/jranke/chemCal/blob/HEAD/R/chemCal-package.R" class="external-link"><code>R/chemCal-package.R</code></a></small> <div class="hidden name"><code>rl95_toluene.Rd</code></div> </div> <div class="ref-description"> <p>Dataset reproduced from Table 4 in Rocke and Lorenzato (1995). The toluene - amount in the calibration samples is given in picograms per 100 µL. - Presumably this is the volume that was injected into the instrument.</p> +amount in the calibration samples is given in picograms per 100 µL. +Presumably this is the volume that was injected into the instrument.</p> </div> <div id="format"> <h2>Format</h2> - <p>A dataframe containing four replicate observations for each - of the six calibration standards.</p> + <p>A dataframe containing four replicate observations for each of the +six calibration standards.</p> </div> <div id="source"> <h2>Source</h2> - <p>Rocke, David M. und Lorenzato, Stefan (1995) A two-component model for - measurement error in analytical chemistry. Technometrics 37(2), 176-184.</p> + <p>Rocke, David M. und Lorenzato, Stefan (1995) A two-component model +for measurement error in analytical chemistry. Technometrics 37(2), 176-184.</p> </div> </div> diff --git a/docs/reference/utstats14.html b/docs/reference/utstats14.html index 78d2604..1ffc224 100644 --- a/docs/reference/utstats14.html +++ b/docs/reference/utstats14.html @@ -1,6 +1,6 @@ <!DOCTYPE html> -<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Example data for calibration with replicates from University of Toronto — utstats14 • chemCal</title><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"><script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><meta property="og:title" content="Example data for calibration with replicates from University of Toronto — utstats14"><meta property="og:description" content="Dataset read into R from - https://sites.chem.utoronto.ca/chemistry/coursenotes/analsci/stats/files/example14.xls."><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]> +<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Example data for calibration with replicates from University of Toronto — utstats14 • chemCal</title><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"><script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><meta property="og:title" content="Example data for calibration with replicates from University of Toronto — utstats14"><meta property="og:description" content="Dataset read into R from +https://sites.chem.utoronto.ca/chemistry/coursenotes/analsci/stats/files/example14.xls."><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--></head><body data-spy="scroll" data-target="#toc"> @@ -48,26 +48,27 @@ <div class="col-md-9 contents"> <div class="page-header"> <h1>Example data for calibration with replicates from University of Toronto</h1> - + <small class="dont-index">Source: <a href="https://github.com/jranke/chemCal/blob/HEAD/R/chemCal-package.R" class="external-link"><code>R/chemCal-package.R</code></a></small> <div class="hidden name"><code>utstats14.Rd</code></div> </div> <div class="ref-description"> - <p>Dataset read into R from - <a href="https://sites.chem.utoronto.ca/chemistry/coursenotes/analsci/stats/files/example14.xls" class="external-link">https://sites.chem.utoronto.ca/chemistry/coursenotes/analsci/stats/files/example14.xls</a>.</p> + <p>Dataset read into R from +<a href="https://sites.chem.utoronto.ca/chemistry/coursenotes/analsci/stats/files/example14.xls" class="external-link">https://sites.chem.utoronto.ca/chemistry/coursenotes/analsci/stats/files/example14.xls</a>.</p> </div> <div id="format"> <h2>Format</h2> - <p>A tibble containing three replicate observations of the response for five - calibration concentrations.</p> + <p>A tibble containing three replicate observations of the response for +five calibration concentrations.</p> </div> <div id="source"> <h2>Source</h2> - <p>David Stone and Jon Ellis (2011) Statistics in Analytical Chemistry. Tutorial website - maintained by the Departments of Chemistry, University of Toronto. - <a href="https://sites.chem.utoronto.ca/chemistry/coursenotes/analsci/stats/index.html" class="external-link">https://sites.chem.utoronto.ca/chemistry/coursenotes/analsci/stats/index.html</a></p> + <p>David Stone and Jon Ellis (2011) Statistics in Analytical Chemistry. +Tutorial website maintained by the Departments of Chemistry, University of +Toronto. +<a href="https://sites.chem.utoronto.ca/chemistry/coursenotes/analsci/stats/index.html" class="external-link">https://sites.chem.utoronto.ca/chemistry/coursenotes/analsci/stats/index.html</a></p> </div> </div> diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 5d588da..01d9b26 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -19,6 +19,9 @@ <loc>/news/index.html</loc> </url> <url> + <loc>/reference/calplot.html</loc> + </url> + <url> <loc>/reference/calplot.lm.html</loc> </url> <url> diff --git a/man/calplot.Rd b/man/calplot.Rd new file mode 100644 index 0000000..440d469 --- /dev/null +++ b/man/calplot.Rd @@ -0,0 +1,73 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/calplot.R +\name{calplot} +\alias{calplot} +\alias{calplot.default} +\alias{calplot.lm} +\title{Plot calibration graphs from univariate linear models} +\usage{ +calplot( + object, + xlim = c("auto", "auto"), + ylim = c("auto", "auto"), + xlab = "Concentration", + ylab = "Response", + legend_x = "auto", + alpha = 0.05, + varfunc = NULL +) +} +\arguments{ +\item{object}{A univariate model object of class \code{\link{lm}} or +\code{\link[MASS:rlm]{rlm}} with model formula \code{y ~ x} or \code{y ~ x - +1}.} + +\item{xlim}{The limits of the plot on the x axis.} + +\item{ylim}{The limits of the plot on the y axis.} + +\item{xlab}{The label of the x axis.} + +\item{ylab}{The label of the y axis.} + +\item{legend_x}{An optional numeric value for adjusting the x coordinate of +the legend.} + +\item{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 \code{\link{lod}} (see note +below).} + +\item{varfunc}{The variance function for generating the weights in the +model. Currently, this argument is ignored (see note below).} +} +\value{ +A plot of the calibration data, of your fitted model as well as +lines showing the confidence limits. Prediction limits are only shown for +models from unweighted regression. +} +\description{ +Produce graphics of calibration data, the fitted model as well as +confidence, and, for unweighted regression, prediction bands. +} +\note{ +Prediction bands for models from weighted linear regression require +weights for the data, for which responses should be predicted. Prediction +intervals using weights e.g. from a variance function are currently not +supported by the internally used function \code{\link{predict.lm}}, +therefore, \code{calplot} does not draw prediction bands for such models. + +It is possible to compare the \code{\link{calplot}} prediction bands with +the \code{\link{lod}} values if the \code{lod()} alpha and beta parameters +are half the value of the \code{calplot()} alpha parameter. +} +\examples{ + +data(massart97ex3) +m <- lm(y ~ x, data = massart97ex3) +calplot(m) + +} +\author{ +Johannes Ranke +} diff --git a/man/calplot.lm.Rd b/man/calplot.lm.Rd deleted file mode 100644 index 39f20de..0000000 --- a/man/calplot.lm.Rd +++ /dev/null @@ -1,72 +0,0 @@ -\name{calplot} -\alias{calplot} -\alias{calplot.default} -\alias{calplot.lm} -\title{Plot calibration graphs from univariate linear models} -\description{ - Produce graphics of calibration data, the fitted model as well - as confidence, and, for unweighted regression, prediction bands. -} -\usage{ - calplot(object, xlim = c("auto", "auto"), ylim = c("auto", "auto"), - xlab = "Concentration", ylab = "Response", legend_x = "auto", - alpha=0.05, varfunc = NULL) -} -\arguments{ - \item{object}{ - A univariate model object of class \code{\link{lm}} or - \code{\link[MASS:rlm]{rlm}} - with model formula \code{y ~ x} or \code{y ~ x - 1}. - } - \item{xlim}{ - The limits of the plot on the x axis. - } - \item{ylim}{ - The limits of the plot on the y axis. - } - \item{xlab}{ - The label of the x axis. - } - \item{ylab}{ - The label of the y axis. - } - \item{legend_x}{ - An optional numeric value for adjusting the x coordinate of the legend. - } - \item{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 \code{\link{lod}} (see note below). - } - \item{varfunc}{ - The variance function for generating the weights in the model. - Currently, this argument is ignored (see note below). - } -} -\value{ - A plot of the calibration data, of your fitted model as well as lines showing - the confidence limits. Prediction limits are only shown for models from - unweighted regression. -} -\note{ - Prediction bands for models from weighted linear regression require weights - for the data, for which responses should be predicted. Prediction intervals - using weights e.g. from a variance function are currently not supported by - the internally used function \code{\link{predict.lm}}, therefore, - \code{calplot} does not draw prediction bands for such models. - - It is possible to compare the \code{\link{calplot}} prediction bands with the - \code{\link{lod}} values if the \code{lod()} alpha and beta parameters are - half the value of the \code{calplot()} alpha parameter. - -} -\examples{ -data(massart97ex3) -m <- lm(y ~ x, data = massart97ex3) -calplot(m) -} -\author{ - Johannes Ranke - \email{jranke@uni-bremen.de} -} -\keyword{regression} diff --git a/man/din32645.Rd b/man/din32645.Rd index ffcbaed..a8e6a31 100644 --- a/man/din32645.Rd +++ b/man/din32645.Rd @@ -1,15 +1,17 @@ -\name{din32645} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/chemCal-package.R \docType{data} +\name{din32645} \alias{din32645} \title{Calibration data from DIN 32645} -\description{ - Sample dataset to test the package. -} -\usage{data(din32645)} \format{ - A dataframe containing 10 rows of x and y values. +A dataframe containing 10 rows of x and y values. +} +\description{ +Sample dataset to test the package. } \examples{ + m <- lm(y ~ x, data = din32645) calplot(m) @@ -45,16 +47,17 @@ 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), Beuth Verlag, Berlin, 1994 +DIN 32645 (equivalent to ISO 11843), Beuth Verlag, Berlin, 1994 - 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. +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 - detection and quantification capabilities (IUPAC Recommendations 1995). - Analytica Chimica Acta 391, 105 - 126. +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/inverse.predict.Rd b/man/inverse.predict.Rd index 373623e..08c24d7 100644 --- a/man/inverse.predict.Rd +++ b/man/inverse.predict.Rd @@ -1,67 +1,72 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/inverse.predict.lm.R \name{inverse.predict} \alias{inverse.predict} \alias{inverse.predict.lm} \alias{inverse.predict.rlm} \alias{inverse.predict.default} \title{Predict x from y for a linear calibration} -\usage{inverse.predict(object, newdata, \dots, - ws, alpha=0.05, var.s = "auto") +\usage{ +inverse.predict( + object, + newdata, + ..., + ws = "auto", + alpha = 0.05, + var.s = "auto" +) } \arguments{ - \item{object}{ - A univariate model object of class \code{\link{lm}} or - \code{\link[MASS:rlm]{rlm}} - with model formula \code{y ~ x} or \code{y ~ x - 1}. - } - \item{newdata}{ - A vector of observed y values for one sample. - } - \item{\dots}{ - Placeholder for further arguments that might be needed by - future implementations. - } - \item{ws}{ - The weight attributed to the sample. This argument is obligatory - if \code{object} has weights. - } - \item{alpha}{ - The error tolerance level for the confidence interval to be reported. - } - \item{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 \code{ws}, if applicable. This means that \code{var.s} - overrides \code{ws}. - } +\item{object}{A univariate model object of class \code{\link{lm}} or +\code{\link[MASS:rlm]{rlm}} with model formula \code{y ~ x} or \code{y ~ x - +1}.} + +\item{newdata}{A vector of observed y values for one sample.} + +\item{\dots}{Placeholder for further arguments that might be needed by +future implementations.} + +\item{ws}{The weight attributed to the sample. This argument is obligatory +if \code{object} has weights.} + +\item{alpha}{The error tolerance level for the confidence interval to be +reported.} + +\item{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 \code{ws}, if applicable. This means that \code{var.s} overrides +\code{ws}.} } \value{ - A list containing the predicted x value, its standard error and a - confidence interval. +A list containing the predicted x value, its standard error and a +confidence interval. } \description{ - This function predicts x values using a univariate linear model that has been - generated for the purpose of calibrating a measurement method. Prediction - intervals are given at the specified confidence level. - The calculation method was taken from Massart et al. (1997). In particular, - Equations 8.26 and 8.28 were combined in order to yield a general treatment - of inverse prediction for univariate linear models, taking into account - weights that have been used to create the linear model, and at the same - time providing the possibility to specify a precision in sample measurements - differing from the precision in standard samples used for the calibration. - This is elaborated in the package vignette. +This function predicts x values using a univariate linear model that has +been generated for the purpose of calibrating a measurement method. +Prediction intervals are given at the specified confidence level. The +calculation method was taken from Massart et al. (1997). In particular, +Equations 8.26 and 8.28 were combined in order to yield a general treatment +of inverse prediction for univariate linear models, taking into account +weights that have been used to create the linear model, and at the same time +providing the possibility to specify a precision in sample measurements +differing from the precision in standard samples used for the calibration. +This is elaborated in the package vignette. +} +\details{ +This is an implementation of Equation (8.28) in the Handbook of Chemometrics +and Qualimetrics, Part A, Massart et al (1997), page 200, validated with +Example 8 on the same page, extended as specified in the package vignette } \note{ - The function was validated with examples 7 and 8 from Massart et al. (1997). - Note that the behaviour of inverse.predict changed with chemCal version - 0.2.1. Confidence intervals for x values obtained from calibrations with - replicate measurements did not take the variation about the means into account. - Please refer to the vignette for details.} -\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, - p. 200 +The function was validated with examples 7 and 8 from Massart et al. +(1997). Note that the behaviour of inverse.predict changed with chemCal +version 0.2.1. Confidence intervals for x values obtained from calibrations +with replicate measurements did not take the variation about the means into +account. Please refer to the vignette for details. } \examples{ + # This is example 7 from Chapter 8 in Massart et al. (1997) m <- lm(y ~ x, data = massart97ex1) inverse.predict(m, 15) # 6.1 +- 4.9 @@ -84,5 +89,10 @@ m3.means <- lm(y ~ x, w = weights, data = massart97ex3.means) inverse.predict(m3.means, 15, ws = 1.67) # 5.9 +- 2.5 inverse.predict(m3.means, 90, ws = 0.145) # 44.1 +- 7.9 + +} +\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, p. 200 } -\keyword{manip} @@ -1,3 +1,5 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/lod.R \name{lod} \alias{lod} \alias{lod.lm} @@ -5,83 +7,82 @@ \alias{lod.default} \title{Estimate a limit of detection (LOD)} \usage{ - lod(object, \dots, alpha = 0.05, beta = 0.05, method = "default", tol = "default") +lod( + object, + ..., + alpha = 0.05, + beta = 0.05, + method = "default", + tol = "default" +) } \arguments{ - \item{object}{ - A univariate model object of class \code{\link{lm}} or - \code{\link[MASS:rlm]{rlm}} - with model formula \code{y ~ x} or \code{y ~ x - 1}, - optionally from a weighted regression. - } - \item{\dots}{ - Placeholder for further arguments that might be needed by - future implementations. - } - \item{alpha}{ - The error tolerance for the decision limit (critical value). - } - \item{beta}{ - The error tolerance beta for the detection limit. - } - \item{method}{ - The \dQuote{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 \dQuote{din} method uses the prediction interval at - x = 0 as an approximation. - } - \item{tol}{ - When the \dQuote{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. - } +\item{object}{A univariate model object of class \code{\link{lm}} or +\code{\link[MASS:rlm]{rlm}} with model formula \code{y ~ x} or \code{y ~ x - +1}, optionally from a weighted regression.} + +\item{\dots}{Placeholder for further arguments that might be needed by +future implementations.} + +\item{alpha}{The error tolerance for the decision limit (critical value).} + +\item{beta}{The error tolerance beta for the detection limit.} + +\item{method}{The \dQuote{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 \dQuote{din} method +uses the prediction interval at x = 0 as an approximation.} + +\item{tol}{When the \dQuote{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.} } \value{ - A list containig the corresponding x and y values of the estimated limit of - detection of a model used for calibration. +A list containig the corresponding x and y values of the estimated +limit of detection of a model used for calibration. } \description{ - The decision limit (German: Nachweisgrenze) is defined as the signal or - analyte concentration that is significantly different from the blank signal - with a first order error alpha (one-sided significance test). - The detection limit, or more precise, the minimum detectable value - (German: Erfassungsgrenze), is then defined as the signal or analyte - concentration where the probability that the signal is not detected although - the analyte is present (type II or false negative error), is beta (also a - one-sided significance test). +The decision limit (German: Nachweisgrenze) is defined as the signal or +analyte concentration that is significantly different from the blank signal +with a first order error alpha (one-sided significance test). The detection +limit, or more precise, the minimum detectable value (German: +Erfassungsgrenze), is then defined as the signal or analyte concentration +where the probability that the signal is not detected although 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 the ones 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). - - The calculation of a LOD from weighted calibration models requires - a weights argument for the internally used \code{\link{predict.lm}} - function, which is currently not supported in R. -} -\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. +* The default values for alpha and beta are the ones 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). +* The calculation of a LOD from weighted calibration models requires a +weights argument for the internally used \code{\link{predict.lm}} +function, which is currently not supported in R. } \examples{ + m <- lm(y ~ x, data = din32645) 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) + +} +\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. } \seealso{ - Examples for \code{\link{din32645}} +Examples for \code{\link{din32645}} } -\keyword{manip} @@ -1,3 +1,5 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/loq.R \name{loq} \alias{loq} \alias{loq.lm} @@ -5,76 +7,74 @@ \alias{loq.default} \title{Estimate a limit of quantification (LOQ)} \usage{ - loq(object, \dots, alpha = 0.05, k = 3, n = 1, w.loq = "auto", - var.loq = "auto", tol = "default") +loq( + object, + ..., + alpha = 0.05, + k = 3, + n = 1, + w.loq = "auto", + var.loq = "auto", + tol = "default" +) } \arguments{ - \item{object}{ - A univariate model object of class \code{\link{lm}} or - \code{\link[MASS:rlm]{rlm}} - with model formula \code{y ~ x} or \code{y ~ x - 1}, - optionally from a weighted regression. If weights are specified - in the model, either \code{w.loq} or \code{var.loq} have to - be specified. - } - \item{alpha}{ - The error tolerance for the prediction of x values in the calculation. - } - \item{\dots}{ - Placeholder for further arguments that might be needed by - future implementations. - } - \item{k}{ - The inverse of the maximum relative error tolerated at the - desired LOQ. - } - \item{n}{ - The number of replicate measurements for which the LOQ should be - specified. - } - \item{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 \code{\link{massart97ex3}} for - an example how to take advantage of knowledge about the - variance function. - } - \item{var.loq}{ - The approximate variance at the LOQ. The default value is - calculated from the model. - } - \item{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. - } +\item{object}{A univariate model object of class \code{\link{lm}} or +\code{\link[MASS:rlm]{rlm}} with model formula \code{y ~ x} or \code{y ~ x - +1}, optionally from a weighted regression. If weights are specified in the +model, either \code{w.loq} or \code{var.loq} have to be specified.} + +\item{\dots}{Placeholder for further arguments that might be needed by +future implementations.} + +\item{alpha}{The error tolerance for the prediction of x values in the +calculation.} + +\item{k}{The inverse of the maximum relative error tolerated at the desired +LOQ.} + +\item{n}{The number of replicate measurements for which the LOQ should be +specified.} + +\item{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 \code{\link{massart97ex3}} for an example how to take +advantage of knowledge about the variance function.} + +\item{var.loq}{The approximate variance at the LOQ. The default value is +calculated from the model.} + +\item{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.} } \value{ - The estimated limit of quantification for a model used for calibration. +The estimated limit of quantification for a model used for +calibration. } \description{ - The limit of quantification is the x value, where the relative error - of the quantification given the calibration model reaches a prespecified - value 1/k. Thus, it is the solution of the equation - \deqn{L = k c(L)}{L = k * c(L)} - where c(L) is half of the length of the confidence interval at the limit L - (DIN 32645, equivalent to ISO 11843). c(L) is internally estimated by - \code{\link{inverse.predict}}, and L is obtained by iteration. +The limit of quantification is the x value, where the relative error of the +quantification given the calibration model reaches a prespecified value 1/k. +Thus, it is the solution of the equation \deqn{L = k c(L)}{L = k * c(L)} +where c(L) is half of the length of the confidence interval at the limit L +(DIN 32645, equivalent to ISO 11843). c(L) is internally estimated by +\code{\link{inverse.predict}}, and L is obtained by iteration. } \note{ - - IUPAC recommends to base the LOQ on the standard deviation of the signal - where x = 0. - - The calculation of a LOQ based on weighted regression is non-standard - and therefore not tested. Feedback is welcome. +* IUPAC recommends to base the LOQ on the standard deviation of the +signal where x = 0. +* The calculation of a LOQ based on weighted regression is non-standard and +therefore not tested. Feedback is welcome. } \examples{ + m <- lm(y ~ x, data = massart97ex1) loq(m) # We can get better by using replicate measurements loq(m, n = 3) + } \seealso{ - Examples for \code{\link{din32645}} +Examples for \code{\link{din32645}} } -\keyword{manip} diff --git a/man/massart97ex1.Rd b/man/massart97ex1.Rd index 44e1b85..d154a9c 100644 --- a/man/massart97ex1.Rd +++ b/man/massart97ex1.Rd @@ -1,17 +1,18 @@ -\name{massart97ex1} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/chemCal-package.R \docType{data} +\name{massart97ex1} \alias{massart97ex1} \title{Calibration data from Massart et al. (1997), example 1} -\description{ - Sample dataset from p. 175 to test the package. -} -\usage{data(massart97ex1)} \format{ - A dataframe containing 6 observations of x and y data. +A dataframe containing 6 observations of x and y data. } \source{ - 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 8. +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 8. +} +\description{ +Sample dataset from p. 175 to test the package. } \keyword{datasets} diff --git a/man/massart97ex3.Rd b/man/massart97ex3.Rd index d7f8d00..284a435 100644 --- a/man/massart97ex3.Rd +++ b/man/massart97ex3.Rd @@ -1,16 +1,23 @@ -\name{massart97ex3} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/chemCal-package.R \docType{data} +\name{massart97ex3} \alias{massart97ex3} \title{Calibration data from Massart et al. (1997), example 3} -\description{ - Sample dataset from p. 188 to test the package. -} -\usage{massart97ex3} \format{ - A dataframe containing 6 levels of x values with 5 - observations of y for each level. +A dataframe containing 6 levels of x values with 5 observations of y +for each level. +} +\source{ +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 8. +} +\description{ +Sample dataset from p. 188 to test the package. } \examples{ + # For reproducing the results for replicate standard measurements in example 8, # we need to do the calibration on the means when using chemCal > 0.2 weights <- with(massart97ex3, { @@ -45,10 +52,6 @@ loq(m3.means, w.loq = 1.67) # The weight for the loq should therefore be derived at x = 7.3 instead # of 15, but the graphical procedure of Massart (p. 201) to derive the # variances on which the weights are based is quite inaccurate anyway. -} -\source{ - 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 8. + } \keyword{datasets} diff --git a/man/rl95_cadmium.Rd b/man/rl95_cadmium.Rd index 7ee4222..8e0b02c 100644 --- a/man/rl95_cadmium.Rd +++ b/man/rl95_cadmium.Rd @@ -1,16 +1,19 @@ -\name{rl95_cadmium} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/chemCal-package.R \docType{data} +\name{rl95_cadmium} \alias{rl95_cadmium} -\title{Cadmium concentrations measured by AAS as reported by Rocke and Lorenzato (1995)} -\description{ - Dataset reproduced from Table 1 in Rocke and Lorenzato (1995). -} +\title{Cadmium concentrations measured by AAS as reported by Rocke and Lorenzato +(1995)} \format{ - A dataframe containing four replicate observations for each - of the six calibration standards. +A dataframe containing four replicate observations for each of the +six calibration standards. } \source{ - Rocke, David M. und Lorenzato, Stefan (1995) A two-component model for - measurement error in analytical chemistry. Technometrics 37(2), 176-184. +Rocke, David M. und Lorenzato, Stefan (1995) A two-component model +for measurement error in analytical chemistry. Technometrics 37(2), 176-184. +} +\description{ +Dataset reproduced from Table 1 in Rocke and Lorenzato (1995). } \keyword{datasets} diff --git a/man/rl95_toluene.Rd b/man/rl95_toluene.Rd index 21fea0f..1f8836a 100644 --- a/man/rl95_toluene.Rd +++ b/man/rl95_toluene.Rd @@ -1,18 +1,20 @@ -\name{rl95_toluene} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/chemCal-package.R \docType{data} +\name{rl95_toluene} \alias{rl95_toluene} \title{Toluene amounts measured by GC/MS as reported by Rocke and Lorenzato (1995)} -\description{ - Dataset reproduced from Table 4 in Rocke and Lorenzato (1995). The toluene - amount in the calibration samples is given in picograms per 100 µL. - Presumably this is the volume that was injected into the instrument. -} \format{ - A dataframe containing four replicate observations for each - of the six calibration standards. +A dataframe containing four replicate observations for each of the +six calibration standards. } \source{ - Rocke, David M. und Lorenzato, Stefan (1995) A two-component model for - measurement error in analytical chemistry. Technometrics 37(2), 176-184. +Rocke, David M. und Lorenzato, Stefan (1995) A two-component model +for measurement error in analytical chemistry. Technometrics 37(2), 176-184. +} +\description{ +Dataset reproduced from Table 4 in Rocke and Lorenzato (1995). The toluene +amount in the calibration samples is given in picograms per 100 µL. +Presumably this is the volume that was injected into the instrument. } \keyword{datasets} diff --git a/man/utstats14.Rd b/man/utstats14.Rd index ec41bd5..1b739d4 100644 --- a/man/utstats14.Rd +++ b/man/utstats14.Rd @@ -1,18 +1,21 @@ -\name{utstats14} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/chemCal-package.R \docType{data} +\name{utstats14} \alias{utstats14} \title{Example data for calibration with replicates from University of Toronto} -\description{ - Dataset read into R from - \url{https://sites.chem.utoronto.ca/chemistry/coursenotes/analsci/stats/files/example14.xls}. -} \format{ - A tibble containing three replicate observations of the response for five - calibration concentrations. +A tibble containing three replicate observations of the response for +five calibration concentrations. } \source{ - David Stone and Jon Ellis (2011) Statistics in Analytical Chemistry. Tutorial website - maintained by the Departments of Chemistry, University of Toronto. - \url{https://sites.chem.utoronto.ca/chemistry/coursenotes/analsci/stats/index.html} +David Stone and Jon Ellis (2011) Statistics in Analytical Chemistry. +Tutorial website maintained by the Departments of Chemistry, University of +Toronto. +\url{https://sites.chem.utoronto.ca/chemistry/coursenotes/analsci/stats/index.html} +} +\description{ +Dataset read into R from +\url{https://sites.chem.utoronto.ca/chemistry/coursenotes/analsci/stats/files/example14.xls}. } \keyword{datasets} |