From 43d58935483e0d9dda7a74c029e7d7d2adad9ed7 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 20 May 2020 08:44:47 +0200 Subject: Static documentation rebuilt by pkgdown::build_site() --- docs/404.html | 151 +++++++++++++++++++ docs/articles/chemCal.html | 80 +++++----- .../figure-html/unnamed-chunk-1-1.png | Bin 92097 -> 91822 bytes .../figure-html/unnamed-chunk-2-1.png | Bin 54434 -> 55415 bytes docs/articles/index.html | 51 +++++-- docs/authors.html | 46 ++++-- docs/bootstrap-toc.css | 60 ++++++++ docs/bootstrap-toc.js | 159 ++++++++++++++++++++ docs/index.html | 38 +++-- docs/news/index.html | 70 +++++---- docs/pkgdown.css | 161 +++++++++++++++++++-- docs/pkgdown.js | 15 +- docs/pkgdown.yml | 3 +- docs/reference/calplot.lm-1.png | Bin 73353 -> 73061 bytes docs/reference/calplot.lm.html | 85 +++++------ docs/reference/din32645-1.png | Bin 71727 -> 71417 bytes docs/reference/din32645.html | 82 ++++++----- docs/reference/index.html | 58 +++++--- docs/reference/inverse.predict.html | 101 ++++++------- docs/reference/lod.html | 88 +++++------ docs/reference/loq.html | 85 +++++------ docs/reference/massart97ex1.html | 68 +++++---- docs/reference/massart97ex3.html | 84 ++++++----- docs/reference/rl95_cadmium.html | 66 +++++---- docs/reference/rl95_toluene.html | 74 ++++++---- docs/reference/utstats14.html | 66 +++++---- 26 files changed, 1178 insertions(+), 513 deletions(-) create mode 100644 docs/404.html create mode 100644 docs/bootstrap-toc.css create mode 100644 docs/bootstrap-toc.js (limited to 'docs') diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 0000000..d27a5a3 --- /dev/null +++ b/docs/404.html @@ -0,0 +1,151 @@ + + + + + + + + +Page not found (404) • chemCal + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +Content not found. Please use links in the navbar. + +
+ + + +
+ + + +
+ + +
+

Site built with pkgdown 1.5.1.

+
+ +
+
+ + + + + + + + diff --git a/docs/articles/chemCal.html b/docs/articles/chemCal.html index e301880..ce745fb 100644 --- a/docs/articles/chemCal.html +++ b/docs/articles/chemCal.html @@ -6,18 +6,19 @@ Introduction to chemCal • chemCal - - - + + + + + - - + - +
@@ -61,15 +69,16 @@ +
@@ -90,25 +99,25 @@ Usage

When calibrating an analytical method, the first task is to generate a suitable model. If we want to use the chemCal functions, we have to restrict ourselves to univariate, possibly weighted, linear regression so far.

Once such a model has been created, the calibration can be graphically shown by using the calplot function:

-
library(chemCal)
-m0 <- lm(y ~ x, data = massart97ex3)
-calplot(m0)
+
library(chemCal)
+m0 <- lm(y ~ x, data = massart97ex3)
+calplot(m0)

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:

-
plot(m0, which=3)
+
plot(m0, which=3)

Therefore, in Example 8 in Massart et al. (1997), weighted regression is proposed which can be reproduced by the following code. Note that we are building the model on the mean values for each standard in order to be able to reproduce the results given in the book with the current version of chemCal.

-
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)
-
-m <- lm(y ~ x, w = weights, data = massart97ex3.means)
+
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)
+
+m <- lm(y ~ x, w = weights, data = massart97ex3.means)

If we now want to predict a new x value from measured y values, we use the inverse.predict function:

-
inverse.predict(m, 15, ws=1.67)
+
inverse.predict(m, 15, ws=1.67)
## $Prediction
 ## [1] 5.865367
 ## 
@@ -120,7 +129,7 @@
 ## 
 ## $`Confidence Limits`
 ## [1] 3.387082 8.343652
-
inverse.predict(m, 90, ws = 0.145)
+
inverse.predict(m, 90, ws = 0.145)
## $Prediction
 ## [1] 44.06025
 ## 
@@ -178,32 +187,29 @@ s_{\hat{x_s}} = \frac{1}{b_1} \sqrt{\frac{{s_s}^2}{w_s m} +
 
- +
-

Site built with pkgdown 1.3.0.

+

Site built with pkgdown 1.5.1.

+
+ diff --git a/docs/articles/chemCal_files/figure-html/unnamed-chunk-1-1.png b/docs/articles/chemCal_files/figure-html/unnamed-chunk-1-1.png index 62c95ca..e0199c3 100644 Binary files a/docs/articles/chemCal_files/figure-html/unnamed-chunk-1-1.png and b/docs/articles/chemCal_files/figure-html/unnamed-chunk-1-1.png differ diff --git a/docs/articles/chemCal_files/figure-html/unnamed-chunk-2-1.png b/docs/articles/chemCal_files/figure-html/unnamed-chunk-2-1.png index 464048c..86a8f43 100644 Binary files a/docs/articles/chemCal_files/figure-html/unnamed-chunk-2-1.png and b/docs/articles/chemCal_files/figure-html/unnamed-chunk-2-1.png differ diff --git a/docs/articles/index.html b/docs/articles/index.html index afee34b..dc6cbba 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -8,21 +8,29 @@ Articles • chemCal + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,12 @@ + + @@ -44,9 +54,10 @@ + - +
@@ -92,6 +107,7 @@
+
@@ -104,26 +120,31 @@

All vignettes

- +
+
Introduction to chemCal
+
+
+
-

Site built with pkgdown 1.3.0.

+

Site built with pkgdown 1.5.1.

+
+ + diff --git a/docs/authors.html b/docs/authors.html index 82ea4db..ad1c893 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -8,21 +8,29 @@ Authors • chemCal + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,12 @@ + + @@ -44,9 +54,10 @@ + - +
@@ -92,6 +107,7 @@
+
@@ -102,7 +118,7 @@
  • -

    Johannes Ranke. Author, maintainer, copyright holder. ORCID +

    Johannes Ranke. Author, maintainer, copyright holder.

@@ -112,19 +128,23 @@
+
-

Site built with pkgdown 1.3.0.

+

Site built with pkgdown 1.5.1.

+
+ + diff --git a/docs/bootstrap-toc.css b/docs/bootstrap-toc.css new file mode 100644 index 0000000..5a85941 --- /dev/null +++ b/docs/bootstrap-toc.css @@ -0,0 +1,60 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ + +/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ + +/* All levels of nav */ +nav[data-toggle='toc'] .nav > li > a { + display: block; + padding: 4px 20px; + font-size: 13px; + font-weight: 500; + color: #767676; +} +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 19px; + color: #563d7c; + text-decoration: none; + background-color: transparent; + border-left: 1px solid #563d7c; +} +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 18px; + font-weight: bold; + color: #563d7c; + background-color: transparent; + border-left: 2px solid #563d7c; +} + +/* Nav: second level (shown on .active) */ +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} +nav[data-toggle='toc'] .nav .nav > li > a { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 30px; + font-size: 12px; + font-weight: normal; +} +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 29px; +} +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 28px; + font-weight: 500; +} + +/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ +nav[data-toggle='toc'] .nav > .active > ul { + display: block; +} diff --git a/docs/bootstrap-toc.js b/docs/bootstrap-toc.js new file mode 100644 index 0000000..1cdd573 --- /dev/null +++ b/docs/bootstrap-toc.js @@ -0,0 +1,159 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ +(function() { + 'use strict'; + + window.Toc = { + helpers: { + // return all matching elements in the set, or their descendants + findOrFilter: function($el, selector) { + // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ + // http://stackoverflow.com/a/12731439/358804 + var $descendants = $el.find(selector); + return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); + }, + + generateUniqueIdBase: function(el) { + var text = $(el).text(); + var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); + return anchor || el.tagName.toLowerCase(); + }, + + generateUniqueId: function(el) { + var anchorBase = this.generateUniqueIdBase(el); + for (var i = 0; ; i++) { + var anchor = anchorBase; + if (i > 0) { + // add suffix + anchor += '-' + i; + } + // check if ID already exists + if (!document.getElementById(anchor)) { + return anchor; + } + } + }, + + generateAnchor: function(el) { + if (el.id) { + return el.id; + } else { + var anchor = this.generateUniqueId(el); + el.id = anchor; + return anchor; + } + }, + + createNavList: function() { + return $(''); + }, + + createChildNavList: function($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }, + + generateNavEl: function(anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $('
  • '); + $li.append($a); + return $li; + }, + + generateNavItem: function(headingEl) { + var anchor = this.generateAnchor(headingEl); + var $heading = $(headingEl); + var text = $heading.data('toc-text') || $heading.text(); + return this.generateNavEl(anchor, text); + }, + + // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). + getTopLevel: function($scope) { + for (var i = 1; i <= 6; i++) { + var $headings = this.findOrFilter($scope, 'h' + i); + if ($headings.length > 1) { + return i; + } + } + + return 1; + }, + + // returns the elements for the top level, and the next below it + getHeadings: function($scope, topLevel) { + var topSelector = 'h' + topLevel; + + var secondaryLevel = topLevel + 1; + var secondarySelector = 'h' + secondaryLevel; + + return this.findOrFilter($scope, topSelector + ',' + secondarySelector); + }, + + getNavLevel: function(el) { + return parseInt(el.tagName.charAt(1), 10); + }, + + populateNav: function($topContext, topLevel, $headings) { + var $context = $topContext; + var $prevNav; + + var helpers = this; + $headings.each(function(i, el) { + var $newNav = helpers.generateNavItem(el); + var navLevel = helpers.getNavLevel(el); + + // determine the proper $context + if (navLevel === topLevel) { + // use top level + $context = $topContext; + } else if ($prevNav && $context === $topContext) { + // create a new level of the tree and switch to it + $context = helpers.createChildNavList($prevNav); + } // else use the current $context + + $context.append($newNav); + + $prevNav = $newNav; + }); + }, + + parseOps: function(arg) { + var opts; + if (arg.jquery) { + opts = { + $nav: arg + }; + } else { + opts = arg; + } + opts.$scope = opts.$scope || $(document.body); + return opts; + } + }, + + // accepts a jQuery object, or an options object + init: function(opts) { + opts = this.helpers.parseOps(opts); + + // ensure that the data attribute is in place for styling + opts.$nav.attr('data-toggle', 'toc'); + + var $topContext = this.helpers.createChildNavList(opts.$nav); + var topLevel = this.helpers.getTopLevel(opts.$scope); + var $headings = this.helpers.getHeadings(opts.$scope, topLevel); + this.helpers.populateNav($topContext, topLevel, $headings); + } + }; + + $(function() { + $('nav[data-toggle="toc"]').each(function(i, el) { + var $nav = $(el); + Toc.init($nav); + }); + }); +})(); diff --git a/docs/index.html b/docs/index.html index f6b5c52..53401d4 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,9 +6,11 @@ Calibration Functions for Analytical Chemistry • chemCal - - - + + + + + - + regression (lm) or robust linear regression (rlm from the MASS package)."> - +
    @@ -67,22 +75,26 @@ +
    +

    Static documentation of this R package can be found at https://pkgdown.jrwb.de/chemCal

    - + diff --git a/docs/news/index.html b/docs/news/index.html index 1976391..4fc042b 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -8,21 +8,29 @@ Changelog • chemCal + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,12 @@ + + @@ -44,9 +54,10 @@ + - +
    @@ -92,17 +107,18 @@
    +
    -

    +

    chemCal 0.2.2 Unreleased

      @@ -110,7 +126,7 @@
    -

    +

    chemCal 0.2.1 2018-07-17

      @@ -123,7 +139,7 @@
    -

    +

    chemCal 0.1-37 2015-10-08

      @@ -131,7 +147,7 @@
    -

    +

    chemCal 0.1-34 2014-04-25

      @@ -141,33 +157,31 @@
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.5.1.

    +
    + + diff --git a/docs/pkgdown.css b/docs/pkgdown.css index c03fb08..c01e592 100644 --- a/docs/pkgdown.css +++ b/docs/pkgdown.css @@ -17,12 +17,14 @@ html, body { height: 100%; } +body { + position: relative; +} + body > .container { display: flex; height: 100%; flex-direction: column; - - padding-top: 60px; } body > .container .row { @@ -69,6 +71,10 @@ summary { margin-top: calc(-60px + 1em); } +dd { + margin-left: 3em; +} + /* Section anchors ---------------------------------*/ a.anchor { @@ -102,37 +108,135 @@ a.anchor { margin-top: -40px; } -/* Static header placement on mobile devices */ -@media (max-width: 767px) { - .navbar-fixed-top { - position: absolute; - } - .navbar { - padding: 0; - } +/* Navbar submenu --------------------------*/ + +.dropdown-submenu { + position: relative; } +.dropdown-submenu>.dropdown-menu { + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + border-radius: 0 6px 6px 6px; +} + +.dropdown-submenu:hover>.dropdown-menu { + display: block; +} + +.dropdown-submenu>a:after { + display: block; + content: " "; + float: right; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 0 5px 5px; + border-left-color: #cccccc; + margin-top: 5px; + margin-right: -10px; +} + +.dropdown-submenu:hover>a:after { + border-left-color: #ffffff; +} + +.dropdown-submenu.pull-left { + float: none; +} + +.dropdown-submenu.pull-left>.dropdown-menu { + left: -100%; + margin-left: 10px; + border-radius: 6px 0 6px 6px; +} /* Sidebar --------------------------*/ -#sidebar { +#pkgdown-sidebar { margin-top: 30px; + position: -webkit-sticky; + position: sticky; + top: 70px; } -#sidebar h2 { + +#pkgdown-sidebar h2 { font-size: 1.5em; margin-top: 1em; } -#sidebar h2:first-child { +#pkgdown-sidebar h2:first-child { margin-top: 0; } -#sidebar .list-unstyled li { +#pkgdown-sidebar .list-unstyled li { margin-bottom: 0.5em; } +/* bootstrap-toc tweaks ------------------------------------------------------*/ + +/* All levels of nav */ + +nav[data-toggle='toc'] .nav > li > a { + padding: 4px 20px 4px 6px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; +} + +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 5px; + color: inherit; + border-left: 1px solid #878787; +} + +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 5px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; + border-left: 2px solid #878787; +} + +/* Nav: second level (shown on .active) */ + +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} + +nav[data-toggle='toc'] .nav .nav > li > a { + padding-left: 16px; + font-size: 1.35rem; +} + +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 15px; +} + +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 15px; + font-weight: 500; + font-size: 1.35rem; +} + +/* orcid ------------------------------------------------------------------- */ + .orcid { - height: 16px; + font-size: 16px; + color: #A6CE39; + /* margins are required by official ORCID trademark and display guidelines */ + margin-left:4px; + margin-right:4px; vertical-align: middle; } @@ -222,6 +326,19 @@ a.sourceLine:hover { visibility: visible; } +/* headroom.js ------------------------ */ + +.headroom { + will-change: transform; + transition: transform 200ms linear; +} +.headroom--pinned { + transform: translateY(0%); +} +.headroom--unpinned { + transform: translateY(-100%); +} + /* mark.js ----------------------------*/ mark { @@ -234,3 +351,17 @@ mark { .html-widget { margin-bottom: 10px; } + +/* fontawesome ------------------------ */ + +.fab { + font-family: "Font Awesome 5 Brands" !important; +} + +/* don't display links in code chunks when printing */ +/* source: https://stackoverflow.com/a/10781533 */ +@media print { + code a:link:after, code a:visited:after { + content: ""; + } +} diff --git a/docs/pkgdown.js b/docs/pkgdown.js index eb7e83d..7e7048f 100644 --- a/docs/pkgdown.js +++ b/docs/pkgdown.js @@ -2,18 +2,11 @@ (function($) { $(function() { - $("#sidebar") - .stick_in_parent({offset_top: 40}) - .on('sticky_kit:bottom', function(e) { - $(this).parent().css('position', 'static'); - }) - .on('sticky_kit:unbottom', function(e) { - $(this).parent().css('position', 'relative'); - }); + $('.navbar-fixed-top').headroom(); - $('body').scrollspy({ - target: '#sidebar', - offset: 60 + $('body').css('padding-top', $('.navbar').height() + 10); + $(window).resize(function(){ + $('body').css('padding-top', $('.navbar').height() + 10); }); $('[data-toggle="tooltip"]').tooltip(); diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 8d2bc22..ece837b 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,6 +1,7 @@ pandoc: 2.2.1 -pkgdown: 1.3.0 +pkgdown: 1.5.1 pkgdown_sha: ~ articles: chemCal: chemCal.html +last_built: 2020-05-20T06:44Z diff --git a/docs/reference/calplot.lm-1.png b/docs/reference/calplot.lm-1.png index aa0286d..4d620ee 100644 Binary files a/docs/reference/calplot.lm-1.png and b/docs/reference/calplot.lm-1.png differ diff --git a/docs/reference/calplot.lm.html b/docs/reference/calplot.lm.html index 18ce82f..7822b7e 100644 --- a/docs/reference/calplot.lm.html +++ b/docs/reference/calplot.lm.html @@ -8,21 +8,29 @@ Plot calibration graphs from univariate linear models — calplot • chemCal + - + - - + + + + + + + - + + - + - - + + + @@ -30,11 +38,11 @@ - + - + @@ -48,9 +56,10 @@ + - +
    @@ -96,6 +109,7 @@
    +
    @@ -107,22 +121,20 @@
    -

    Produce graphics of calibration data, the fitted model as well as confidence, and, for unweighted regression, prediction bands.

    -
    -
    calplot(object, xlim = c("auto", "auto"), ylim = c("auto", "auto"),
    +    
    calplot(object, xlim = c("auto", "auto"), ylim = c("auto", "auto"),
         xlab = "Concentration", ylab = "Response", alpha=0.05, varfunc = NULL)
    - +

    Arguments

    - @@ -153,61 +165,52 @@ Currently, this argument is ignored (see note below).

    object

    A univariate model object of class lm or - rlm +

    A univariate model object of class lm or + rlm with model formula y ~ x or y ~ x - 1.

    - +

    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 predict.lm, therefore, + the internally used function predict.lm, therefore, calplot does not draw prediction bands for such models.

    It is possible to compare the calplot prediction bands with the lod values if the lod() alpha and beta parameters are half the value of the calplot() alpha parameter.

    -

    Examples

    -
    data(massart97ex3) -m <- lm(y ~ x, data = massart97ex3) +
    data(massart97ex3) +m <- lm(y ~ x, data = massart97ex3) calplot(m)
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.5.1.

    +
    + + diff --git a/docs/reference/din32645-1.png b/docs/reference/din32645-1.png index 9dc7295..cee27e9 100644 Binary files a/docs/reference/din32645-1.png and b/docs/reference/din32645-1.png differ diff --git a/docs/reference/din32645.html b/docs/reference/din32645.html index 8d46c24..6af5152 100644 --- a/docs/reference/din32645.html +++ b/docs/reference/din32645.html @@ -8,21 +8,29 @@ Calibration data from DIN 32645 — din32645 • chemCal + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,10 @@ - + - + @@ -47,9 +55,10 @@ + - +
    @@ -95,6 +108,7 @@
    +
    @@ -106,17 +120,15 @@
    -

    Sample dataset to test the package.

    -
    -
    data(din32645)
    - +
    data(din32645)
    + +

    Format

    A dataframe containing 10 rows of x and y values.

    -

    References

    DIN 32645 (equivalent to ISO 11843), Beuth Verlag, Berlin, 1994

    @@ -126,66 +138,62 @@

    Currie, L. A. (1997) Nomenclature in evaluation of analytical methods including detection and quantification capabilities (IUPAC Recommendations 1995). Analytica Chimica Acta 391, 105 - 126.

    -

    Examples

    -
    m <- lm(y ~ x, data = din32645) +
    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)
    #> [1] 0.07434
    +round(prediction$Confidence, 5)
    #> [1] 0.07434
    ## 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)
    #> [1] 0.07
    # and according to Dintest test data, we should get 0.0698 from -round(crit$x, 4)
    #> [1] 0.0698
    +round(crit$x, 2)
    #> [1] 0.07
    # and according to Dintest test data, we should get 0.0698 from +round(crit$x, 4)
    #> [1] 0.0698
    ## 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)
    #> [1] 0.14
    +round(lod.din$x, 2)
    #> [1] 0.14
    ## Limit of quantification # This accords to the test data coming with the test data from Dintest again, # except for the last digits of the value cited for Procontrol 3.1 (0.2121) loq <- loq(m, alpha = 0.01) -round(loq$x, 4)
    #> [1] 0.212
    +round(loq$x, 4)
    #> [1] 0.212
    # A similar value is obtained using the approximation # LQ = 3.04 * LC (Currie 1999, p. 120) 3.04 * lod(m, alpha = 0.01, beta = 0.5)$x
    #> [1] 0.2122306
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.5.1.

    +
    + + diff --git a/docs/reference/index.html b/docs/reference/index.html index 0be3f99..d68dbd9 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -8,21 +8,29 @@ Function reference • chemCal + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,12 @@ + + @@ -44,9 +54,10 @@ + - +
    @@ -92,6 +107,7 @@
    +
    @@ -115,6 +131,11 @@

    + + + + + @@ -180,27 +201,30 @@
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.5.1.

    +
    + + diff --git a/docs/reference/inverse.predict.html b/docs/reference/inverse.predict.html index 4ea9a75..3c4c867 100644 --- a/docs/reference/inverse.predict.html +++ b/docs/reference/inverse.predict.html @@ -8,21 +8,29 @@ Predict x from y for a linear calibration — inverse.predict • chemCal + - + - - + + + + + + + - + + - + - - + + + @@ -30,8 +38,8 @@ - + - + @@ -56,9 +64,10 @@ + - +
    @@ -104,6 +117,7 @@
    +
    @@ -115,7 +129,6 @@
    -

    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. @@ -126,19 +139,18 @@ 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.

    -
    -
    inverse.predict(object, newdata, …,
    -  ws, alpha=0.05, var.s = "auto")
    - +
    inverse.predict(object, newdata, ...,
    +  ws, alpha=0.05, var.s = "auto")
    +

    Arguments

    - @@ -146,7 +158,7 @@ - + @@ -167,12 +179,11 @@ overrides ws.

    object

    A univariate model object of class lm or - rlm +

    A univariate model object of class lm or + rlm with model formula y ~ x or y ~ x - 1.

    A vector of observed y values for one sample.

    ...

    Placeholder for further arguments that might be needed by future implementations.

    - +

    Value

    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). @@ -180,17 +191,15 @@ 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

    -

    Examples

    # This is example 7 from Chapter 8 in Massart et al. (1997) -m <- lm(y ~ x, data = massart97ex1) +m <- lm(y ~ x, data = massart97ex1) inverse.predict(m, 15) # 6.1 +- 4.9
    #> $Prediction #> [1] 6.09381 #> @@ -213,7 +222,7 @@ #> #> $`Confidence Limits` #> [1] 39.03178 48.84788 -#>
    inverse.predict(m, rep(90,5)) # 43.9 +- 3.2
    #> $Prediction +#>
    inverse.predict(m, rep(90,5)) # 43.9 +- 3.2
    #> $Prediction #> [1] 43.93983 #> #> $`Standard Error` @@ -227,16 +236,16 @@ #>
    # 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) +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) +massart97ex3.means <- aggregate(y ~ x, massart97ex3, mean) -m3.means <- lm(y ~ x, w = weights, data = massart97ex3.means) +m3.means <- lm(y ~ x, w = weights, data = massart97ex3.means) inverse.predict(m3.means, 15, ws = 1.67) # 5.9 +- 2.5
    #> $Prediction #> [1] 5.865367 @@ -263,36 +272,30 @@ #>
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.5.1.

    +
    + + diff --git a/docs/reference/lod.html b/docs/reference/lod.html index dcde1b3..e5a1158 100644 --- a/docs/reference/lod.html +++ b/docs/reference/lod.html @@ -8,21 +8,29 @@ Estimate a limit of detection (LOD) — lod • chemCal + - + - - + + + + + + + - + + - + - - + + + @@ -30,8 +38,8 @@ - + - + @@ -54,9 +62,10 @@ + - +
    @@ -102,6 +115,7 @@
    +
    @@ -113,7 +127,6 @@
    -

    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). @@ -122,23 +135,22 @@ 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).

    -
    -
    lod(object, …, alpha = 0.05, beta = 0.05, method = "default", tol = "default")
    - +
    lod(object, ..., alpha = 0.05, beta = 0.05, method = "default", tol = "default")
    +

    Arguments

    - - + @@ -165,12 +177,11 @@ divided by 1000. Can be set to a numeric value to override this.

    object

    A univariate model object of class lm or - rlm +

    A univariate model object of class lm or + rlm with model formula y ~ x or y ~ x - 1, optionally from a weighted regression.

    ...

    Placeholder for further arguments that might be needed by future implementations.

    - +

    Value

    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. @@ -178,9 +189,8 @@ 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 predict.lm + a weights argument for the internally used 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., @@ -192,14 +202,12 @@

    Currie, L. A. (1997) Nomenclature in evaluation of analytical methods including detection and quantification capabilities (IUPAC Recommendations 1995). Analytica Chimica Acta 391, 105 - 126.

    -

    See also

    Examples for din32645

    -

    Examples

    -
    m <- lm(y ~ x, data = din32645) +
    m <- lm(y ~ x, data = din32645) lod(m)
    #> $x #> [1] 0.08655484 #> @@ -215,38 +223,30 @@ #> [1] 3155.393 #>
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.5.1.

    +
    + + diff --git a/docs/reference/loq.html b/docs/reference/loq.html index c159638..2c7dc6a 100644 --- a/docs/reference/loq.html +++ b/docs/reference/loq.html @@ -8,21 +8,29 @@ Estimate a limit of quantification (LOQ) — loq • chemCal + - + - - + + + + + + + - + + - + - - + + + @@ -30,8 +38,8 @@ - + - + @@ -53,9 +61,10 @@ + - +
    @@ -101,6 +114,7 @@
    +
    @@ -112,7 +126,6 @@
    -

    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 @@ -120,19 +133,18 @@ 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.

    -
    -
    loq(object, …, 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

    - - + @@ -177,25 +189,22 @@ numeric value to override this.

    object

    A univariate model object of class lm or - rlm +

    A univariate model object of class lm or + rlm with model formula y ~ x or y ~ x - 1, optionally from a weighted regression. If weights are specified in the model, either w.loq or var.loq have to @@ -143,7 +155,7 @@

    The error tolerance for the prediction of x values in the calculation.

    ...

    Placeholder for further arguments that might be needed by future implementations.

    - +

    Value

    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.

    -

    See also

    Examples for din32645

    -

    Examples

    -
    m <- lm(y ~ x, data = massart97ex1) +
    m <- lm(y ~ x, data = massart97ex1) loq(m)
    #> $x #> [1] 13.97764 #> @@ -210,36 +219,30 @@ #> [1] 22.68539 #>
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.5.1.

    +
    + + diff --git a/docs/reference/massart97ex1.html b/docs/reference/massart97ex1.html index d9deb36..95e6b3f 100644 --- a/docs/reference/massart97ex1.html +++ b/docs/reference/massart97ex1.html @@ -8,21 +8,29 @@ Calibration data from Massart et al. (1997), example 1 — massart97ex1 • chemCal + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,10 @@ - + - + @@ -47,9 +55,10 @@ + - +
    @@ -95,6 +108,7 @@
    +
    @@ -106,50 +120,46 @@
    -

    Sample dataset from p. 175 to test the package.

    -
    -
    data(massart97ex1)
    - +
    data(massart97ex1)
    + +

    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.

    - - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.5.1.

    +
    + + diff --git a/docs/reference/massart97ex3.html b/docs/reference/massart97ex3.html index c1bbbc2..a1efeba 100644 --- a/docs/reference/massart97ex3.html +++ b/docs/reference/massart97ex3.html @@ -8,21 +8,29 @@ Calibration data from Massart et al. (1997), example 3 — massart97ex3 • chemCal + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,10 @@ - + - + @@ -47,9 +55,10 @@ + - +
    @@ -95,6 +108,7 @@
    +
    @@ -106,38 +120,35 @@
    -

    Sample dataset from p. 188 to test the package.

    -
    massart97ex3
    - + +

    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.

    -

    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) +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) +massart97ex3.means <- aggregate(y ~ x, massart97ex3, mean) -m3.means <- lm(y ~ x, w = weights, data = massart97ex3.means) +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
    #> $Prediction @@ -165,7 +176,7 @@ #>
    # The LOD is only calculated for models from unweighted regression # with this version of chemCal -m0 <- lm(y ~ x, data = massart97ex3) +m0 <- lm(y ~ x, data = massart97ex3) lod(m0)
    #> $x #> [1] 5.407085 #> @@ -194,33 +205,30 @@ # variances on which the weights are based is quite inaccurate anyway.
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.5.1.

    +
    + + diff --git a/docs/reference/rl95_cadmium.html b/docs/reference/rl95_cadmium.html index 6678817..509a0ab 100644 --- a/docs/reference/rl95_cadmium.html +++ b/docs/reference/rl95_cadmium.html @@ -8,21 +8,29 @@ Cadmium concentrations measured by AAS as reported by Rocke and Lorenzato (1995) — rl95_cadmium • chemCal + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,10 @@ - + - + @@ -47,9 +55,10 @@ + - +
    @@ -95,6 +108,7 @@
    +
    @@ -106,49 +120,45 @@
    -

    Dataset reproduced from Table 1 in Rocke and Lorenzato (1995).

    -
    - + +

    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.

    - - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.5.1.

    +
    + + diff --git a/docs/reference/rl95_toluene.html b/docs/reference/rl95_toluene.html index 805249f..f295d6d 100644 --- a/docs/reference/rl95_toluene.html +++ b/docs/reference/rl95_toluene.html @@ -8,21 +8,29 @@ Toluene amounts measured by GC/MS as reported by Rocke and Lorenzato (1995) — rl95_toluene • chemCal + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,12 @@ + + - - @@ -47,9 +57,10 @@ + - +
    @@ -95,6 +110,7 @@
    +
    @@ -106,49 +122,47 @@
    - -

    Dataset reproduced from Table 4 in 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.

    - + +

    Format

    -

    A dataframe containing four replicate observations for each +

    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.

    - - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.5.1.

    +
    + + diff --git a/docs/reference/utstats14.html b/docs/reference/utstats14.html index 1385339..c15f06d 100644 --- a/docs/reference/utstats14.html +++ b/docs/reference/utstats14.html @@ -8,21 +8,29 @@ Example data for calibration with replicates from University of Toronto — utstats14 • chemCal + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,10 @@ - + - + @@ -47,9 +55,10 @@ + - +
    @@ -95,6 +108,7 @@
    +
    @@ -106,50 +120,46 @@
    - + +

    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. http://www.chem.utoronto.ca/coursenotes/analsci/stats/index.html

    - - + + + -- cgit v1.2.1