diff options
Diffstat (limited to 'docs/reference')
-rw-r--r-- | docs/reference/calplot-2.png | bin | 0 -> 21681 bytes | |||
-rw-r--r-- | docs/reference/calplot.lm.html | 177 | ||||
-rw-r--r-- | docs/reference/chemCal-package.html | 115 | ||||
-rw-r--r-- | docs/reference/din32645-2.png | bin | 0 -> 19858 bytes | |||
-rw-r--r-- | docs/reference/din32645.html | 175 | ||||
-rw-r--r-- | docs/reference/index.html | 146 | ||||
-rw-r--r-- | docs/reference/inverse.predict.html | 211 | ||||
-rw-r--r-- | docs/reference/lod.html | 210 | ||||
-rw-r--r-- | docs/reference/loq.html | 205 | ||||
-rw-r--r-- | docs/reference/massart97ex1.html | 118 | ||||
-rw-r--r-- | docs/reference/massart97ex3-5.png | bin | 0 -> 16419 bytes | |||
-rw-r--r-- | docs/reference/massart97ex3.html | 188 |
12 files changed, 1545 insertions, 0 deletions
diff --git a/docs/reference/calplot-2.png b/docs/reference/calplot-2.png Binary files differnew file mode 100644 index 0000000..7e40a4b --- /dev/null +++ b/docs/reference/calplot-2.png diff --git a/docs/reference/calplot.lm.html b/docs/reference/calplot.lm.html new file mode 100644 index 0000000..f66e636 --- /dev/null +++ b/docs/reference/calplot.lm.html @@ -0,0 +1,177 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html> + <head> + <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://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> +<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> + +<!-- Font Awesome icons --> +<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"> + + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../jquery.sticky-kit.min.js"></script> +<script src="../pkgdown.js"></script> + +<!-- mathjax --> +<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></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> + <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"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="../index.html">chemCal</a> + </div> + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Reference</a> +</li> +<li> + <a href="../articles/index.html">Articles</a> +</li> + </ul> + + <ul class="nav navbar-nav navbar-right"> + + </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> + </div> + + + <p>Produce graphics of calibration data, the fitted model as well + as confidence, and, for unweighted regression, prediction bands.</p> + + + <pre><span class='fu'>calplot</span>(<span class='no'>object</span>, <span class='kw'>xlim</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='st'>"auto"</span>, <span class='st'>"auto"</span>), <span class='kw'>ylim</span> <span class='kw'>=</span> <span class='fu'>c</span>(<span class='st'>"auto"</span>, <span class='st'>"auto"</span>), + <span class='kw'>xlab</span> <span class='kw'>=</span> <span class='st'>"Concentration"</span>, <span class='kw'>ylab</span> <span class='kw'>=</span> <span class='st'>"Response"</span>, <span class='kw'>alpha</span><span class='kw'>=</span><span class='fl'>0.05</span>, <span class='kw'>varfunc</span> <span class='kw'>=</span> <span class='kw'>NULL</span>)</pre> + + <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a> Arguments</h2> + <dl class="dl-horizontal"> + <dt>object</dt> + <dd> + A univariate model object of class <code>lm</code> or + <code><a href='http://www.rdocumentation.org/packages/MASS/topics/rlm'>rlm</a></code> + with model formula <code>y ~ x</code> or <code>y ~ x - 1</code>. + </dd> + <dt>xlim</dt> + <dd> + The limits of the plot on the x axis. + </dd> + <dt>ylim</dt> + <dd> + The limits of the plot on the y axis. + </dd> + <dt>xlab</dt> + <dd> + The label of the x axis. + </dd> + <dt>ylab</dt> + <dd> + The label of the y axis. + </dd> + <dt>alpha</dt> + <dd> + 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). + </dd> + <dt>varfunc</dt> + <dd> + The variance function for generating the weights in the model. + Currently, this argument is ignored (see note below). + </dd> + </dl> + + <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>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> + + <h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>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>predict.lm</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>lod()</code> alpha and beta parameters are + half the value of the <code>calplot()</code> alpha parameter.</p> + + + <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> + <pre class="examples"><div class='input'><span class='fu'>data</span>(<span class='no'>massart97ex3</span>) +<span class='no'>m</span> <span class='kw'><-</span> <span class='fu'>lm</span>(<span class='no'>y</span> ~ <span class='no'>x</span>, <span class='kw'>data</span> <span class='kw'>=</span> <span class='no'>massart97ex3</span>) +<span class='fu'>calplot</span>(<span class='no'>m</span>)</div><img src='calplot-2.png' alt='' width='540' height='400' /></pre> + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> + <h2>Contents</h2> + <ul class="nav nav-pills nav-stacked"> + <li><a href="#arguments">Arguments</a></li> + + <li><a href="#value">Value</a></li> + + <li><a href="#note">Note</a></li> + + <li><a href="#examples">Examples</a></li> + </ul> + + <h2>Author</h2> + + Johannes Ranke + <a href='mailto:jranke@uni-bremen.de'>jranke@uni-bremen.de</a> + <a href = 'http://www.uft.uni-bremen.de/chemie/ranke'>http://www.uft.uni-bremen.de/chemie/ranke</a> + + </div> +</div> + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="http://hadley.github.io/pkgdown/">pkgdown</a>.</p> +</div> + + </footer> + </div> + + </body> +</html> diff --git a/docs/reference/chemCal-package.html b/docs/reference/chemCal-package.html new file mode 100644 index 0000000..18e3822 --- /dev/null +++ b/docs/reference/chemCal-package.html @@ -0,0 +1,115 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html> + <head> + <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> + — chemCal-package • chemCal</title> + +<!-- jquery --> +<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> +<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> + +<!-- Font Awesome icons --> +<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"> + + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../jquery.sticky-kit.min.js"></script> +<script src="../pkgdown.js"></script> + +<!-- mathjax --> +<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></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> + <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"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="../index.html">chemCal</a> + </div> + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Reference</a> +</li> +<li> + <a href="../articles/index.html">Articles</a> +</li> + </ul> + + <ul class="nav navbar-nav navbar-right"> + + </ul> + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + </header> + + <div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1> +</h1> + </div> + + + <p>See <a href = '../DESCRIPTION'>../DESCRIPTION</a></p> + + + + <h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2> + + <p>There is a package vignette located in <a href = '../doc/chemCal.pdf'>../doc/chemCal.pdf</a>.</p> + + + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> + <h2>Contents</h2> + <ul class="nav nav-pills nav-stacked"> + + <li><a href="#details">Details</a></li> + </ul> + + <h2>Author</h2> + + Author and Maintainer: Johannes Ranke <jranke@uni-bremen.de> + + </div> +</div> + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="http://hadley.github.io/pkgdown/">pkgdown</a>.</p> +</div> + + </footer> + </div> + + </body> +</html> diff --git a/docs/reference/din32645-2.png b/docs/reference/din32645-2.png Binary files differnew file mode 100644 index 0000000..1d1e8ab --- /dev/null +++ b/docs/reference/din32645-2.png diff --git a/docs/reference/din32645.html b/docs/reference/din32645.html new file mode 100644 index 0000000..1b64592 --- /dev/null +++ b/docs/reference/din32645.html @@ -0,0 +1,175 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html> + <head> + <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>Calibration data from DIN 32645 — din32645 • chemCal</title> + +<!-- jquery --> +<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> +<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> + +<!-- Font Awesome icons --> +<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"> + + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../jquery.sticky-kit.min.js"></script> +<script src="../pkgdown.js"></script> + +<!-- mathjax --> +<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></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> + <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"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="../index.html">chemCal</a> + </div> + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Reference</a> +</li> +<li> + <a href="../articles/index.html">Articles</a> +</li> + </ul> + + <ul class="nav navbar-nav navbar-right"> + + </ul> + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + </header> + + <div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Calibration data from DIN 32645</h1> + </div> + + + <p>Sample dataset to test the package.</p> + + + <pre><span class='fu'>data</span>(<span class='no'>din32645</span>)</pre> + + <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> + + <p>A dataframe containing 10 rows of x and y values.</p> + + <h2 class="hasAnchor" id="references"><a class="anchor" href="#references"></a>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> + + + <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> + <pre class="examples"><div class='input'><span class='fu'>data</span>(<span class='no'>din32645</span>) +<span class='no'>m</span> <span class='kw'><-</span> <span class='fu'>lm</span>(<span class='no'>y</span> ~ <span class='no'>x</span>, <span class='kw'>data</span> <span class='kw'>=</span> <span class='no'>din32645</span>) +<span class='fu'><a href='calplot.html'>calplot</a></span>(<span class='no'>m</span>)</div><img src='din32645-2.png' alt='' width='540' height='400' /><div class='input'> +<span class='co'>## Prediction of x with confidence interval</span> +(<span class='no'>prediction</span> <span class='kw'><-</span> <span class='fu'><a href='inverse.predict.html'>inverse.predict</a></span>(<span class='no'>m</span>, <span class='fl'>3500</span>, <span class='kw'>alpha</span> <span class='kw'>=</span> <span class='fl'>0.01</span>))</div><div class='output co'>#> $Prediction +#> [1] 0.1054792 +#> +#> $`Standard Error` +#> [1] 0.02215619 +#> +#> $Confidence +#> [1] 0.07434261 +#> +#> $`Confidence Limits` +#> [1] 0.03113656 0.17982178 +#> </div><div class='input'> +<span class='co'># This should give 0.07434 according to test data from Dintest, which </span> +<span class='co'># was collected from Procontrol 3.1 (isomehr GmbH) in this case</span> +<span class='fu'>round</span>(<span class='no'>prediction</span>$<span class='no'>Confidence</span>,<span class='fl'>5</span>)</div><div class='output co'>#> [1] 0.07434</div><div class='input'> +<span class='co'>## Critical value:</span> +(<span class='no'>crit</span> <span class='kw'><-</span> <span class='fu'><a href='lod.html'>lod</a></span>(<span class='no'>m</span>, <span class='kw'>alpha</span> <span class='kw'>=</span> <span class='fl'>0.01</span>, <span class='kw'>beta</span> <span class='kw'>=</span> <span class='fl'>0.5</span>))</div><div class='output co'>#> $x +#> [1] 0.0698127 +#> +#> $y +#> 1 +#> 3155.393 +#> </div><div class='input'> +<span class='co'># According to DIN 32645, we should get 0.07 for the critical value</span> +<span class='co'># (decision limit, "Nachweisgrenze")</span> +<span class='fu'>round</span>(<span class='no'>crit</span>$<span class='no'>x</span>, <span class='fl'>2</span>)</div><div class='output co'>#> [1] 0.07</div><div class='input'><span class='co'># and according to Dintest test data, we should get 0.0698 from</span> +<span class='fu'>round</span>(<span class='no'>crit</span>$<span class='no'>x</span>, <span class='fl'>4</span>)</div><div class='output co'>#> [1] 0.0698</div><div class='input'> +<span class='co'>## Limit of detection (smallest detectable value given alpha and beta)</span> +<span class='co'># In German, the smallest detectable value is the "Erfassungsgrenze", and we</span> +<span class='co'># should get 0.14 according to DIN, which we achieve by using the method </span> +<span class='co'># described in it:</span> +<span class='no'>lod.din</span> <span class='kw'><-</span> <span class='fu'><a href='lod.html'>lod</a></span>(<span class='no'>m</span>, <span class='kw'>alpha</span> <span class='kw'>=</span> <span class='fl'>0.01</span>, <span class='kw'>beta</span> <span class='kw'>=</span> <span class='fl'>0.01</span>, <span class='kw'>method</span> <span class='kw'>=</span> <span class='st'>"din"</span>) +<span class='fu'>round</span>(<span class='no'>lod.din</span>$<span class='no'>x</span>, <span class='fl'>2</span>)</div><div class='output co'>#> [1] 0.14</div><div class='input'> +<span class='co'>## Limit of quantification</span> +<span class='co'># This accords to the test data coming with the test data from Dintest again, </span> +<span class='co'># except for the last digits of the value cited for Procontrol 3.1 (0.2121)</span> +(<span class='no'>loq</span> <span class='kw'><-</span> <span class='fu'><a href='loq.html'>loq</a></span>(<span class='no'>m</span>, <span class='kw'>alpha</span> <span class='kw'>=</span> <span class='fl'>0.01</span>))</div><div class='output co'>#> $x +#> [1] 0.2119575 +#> +#> $y +#> 1 +#> 4528.787 +#> </div><div class='input'><span class='fu'>round</span>(<span class='no'>loq</span>$<span class='no'>x</span>,<span class='fl'>4</span>)</div><div class='output co'>#> [1] 0.212</div><div class='input'> +<span class='co'># A similar value is obtained using the approximation </span> +<span class='co'># LQ = 3.04 * LC (Currie 1999, p. 120)</span> +<span class='fl'>3.04</span> * <span class='fu'><a href='lod.html'>lod</a></span>(<span class='no'>m</span>,<span class='kw'>alpha</span> <span class='kw'>=</span> <span class='fl'>0.01</span>, <span class='kw'>beta</span> <span class='kw'>=</span> <span class='fl'>0.5</span>)$<span class='no'>x</span></div><div class='output co'>#> [1] 0.2122306</div></pre> + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> + <h2>Contents</h2> + <ul class="nav nav-pills nav-stacked"> + + <li><a href="#format">Format</a></li> + + <li><a href="#references">References</a></li> + + <li><a href="#examples">Examples</a></li> + </ul> + + </div> +</div> + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="http://hadley.github.io/pkgdown/">pkgdown</a>.</p> +</div> + + </footer> + </div> + + </body> +</html> diff --git a/docs/reference/index.html b/docs/reference/index.html new file mode 100644 index 0000000..b55336a --- /dev/null +++ b/docs/reference/index.html @@ -0,0 +1,146 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html> + <head> + <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>Function reference • chemCal</title> + +<!-- jquery --> +<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> +<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> + +<!-- Font Awesome icons --> +<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"> + + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../jquery.sticky-kit.min.js"></script> +<script src="../pkgdown.js"></script> + +<!-- mathjax --> +<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></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> + <div class="container template-reference-index"> + <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"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="../index.html">chemCal</a> + </div> + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Reference</a> +</li> +<li> + <a href="../articles/index.html">Articles</a> +</li> + </ul> + + <ul class="nav navbar-nav navbar-right"> + + </ul> + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + </header> + + <div class="row"> + <div class="col-md-9"> + <div class="page-header"> + <h1>Function reference</h1> + <h4>version 0.1-37.9000</h4> + </div> + + <div class="contents"> + <h2 id="section-all-functions" class="hasAnchor"><a href="#section-all-functions" class="anchor"></a>All functions</h2> + <p class="section-desc"></p> + + + <p><a href="calplot.lm.html">Plot calibration graphs from univariate linear models</a></p> + <ul> + <li><code><a href="calplot.lm.html">calplot</a></code></li><li><code><a href="calplot.lm.html">calplot.default</a></code></li><li><code><a href="calplot.lm.html">calplot.lm</a></code></li> + </ul> + + <p><a href="chemCal-package.html"> +</a></p> + <ul> + <li><code><a href="chemCal-package.html">chemCal-package</a></code></li> + </ul> + + <p><a href="din32645.html">Calibration data from DIN 32645</a></p> + <ul> + <li><code><a href="din32645.html">din32645</a></code></li> + </ul> + + <p><a href="inverse.predict.html">Predict x from y for a linear calibration</a></p> + <ul> + <li><code><a href="inverse.predict.html">inverse.predict</a></code></li><li><code><a href="inverse.predict.html">inverse.predict.lm</a></code></li><li><code><a href="inverse.predict.html">inverse.predict.rlm</a></code></li><li><code><a href="inverse.predict.html">inverse.predict.default</a></code></li> + </ul> + + <p><a href="lod.html">Estimate a limit of detection (LOD)</a></p> + <ul> + <li><code><a href="lod.html">lod</a></code></li><li><code><a href="lod.html">lod.lm</a></code></li><li><code><a href="lod.html">lod.rlm</a></code></li><li><code><a href="lod.html">lod.default</a></code></li> + </ul> + + <p><a href="loq.html">Estimate a limit of quantification (LOQ)</a></p> + <ul> + <li><code><a href="loq.html">loq</a></code></li><li><code><a href="loq.html">loq.lm</a></code></li><li><code><a href="loq.html">loq.rlm</a></code></li><li><code><a href="loq.html">loq.default</a></code></li> + </ul> + + <p><a href="massart97ex1.html">Calibration data from Massart et al. (1997), example 1</a></p> + <ul> + <li><code><a href="massart97ex1.html">massart97ex1</a></code></li> + </ul> + + <p><a href="massart97ex3.html">Calibration data from Massart et al. (1997), example 3</a></p> + <ul> + <li><code><a href="massart97ex3.html">massart97ex3</a></code></li> + </ul> + + </div> + </div> + + <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> + <h2>Contents</h2> + <ul class="nav nav-pills nav-stacked"> + <li><a href="#section-all-functions">All functions</a></li> + </ul> + </div> +</div> + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="http://hadley.github.io/pkgdown/">pkgdown</a>.</p> +</div> + + </footer> + </div> + + </body> +</html> diff --git a/docs/reference/inverse.predict.html b/docs/reference/inverse.predict.html new file mode 100644 index 0000000..60d169c --- /dev/null +++ b/docs/reference/inverse.predict.html @@ -0,0 +1,211 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html> + <head> + <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://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> +<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> + +<!-- Font Awesome icons --> +<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"> + + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../jquery.sticky-kit.min.js"></script> +<script src="../pkgdown.js"></script> + +<!-- mathjax --> +<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></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> + <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"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="../index.html">chemCal</a> + </div> + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Reference</a> +</li> +<li> + <a href="../articles/index.html">Articles</a> +</li> + </ul> + + <ul class="nav navbar-nav navbar-right"> + + </ul> + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + </header> + + <div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Predict x from y for a linear calibration</h1> + </div> + + + <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> + + + <pre>inverse.predict(object, newdata, …, + ws, alpha=0.05, var.s = "auto")</pre> + + <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a> Arguments</h2> + <dl class="dl-horizontal"> + <dt>object</dt> + <dd> + A univariate model object of class <code>lm</code> or + <code><a href='http://www.rdocumentation.org/packages/MASS/topics/rlm'>rlm</a></code> + with model formula <code>y ~ x</code> or <code>y ~ x - 1</code>. + </dd> + <dt>newdata</dt> + <dd> + A vector of observed y values for one sample. + </dd> + <dt>…</dt> + <dd> + Placeholder for further arguments that might be needed by + future implementations. + </dd> + <dt>ws</dt> + <dd> + The weight attributed to the sample. This argument is obligatory + if <code>object</code> has weights. + </dd> + <dt>alpha</dt> + <dd> + The error tolerance level for the confidence interval to be reported. + </dd> + <dt>var.s</dt> + <dd> + 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>. + </dd> + </dl> + + <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> + + <p>A list containing the predicted x value, its standard error and a + confidence interval.</p> + + <h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2> + + <p>The function was validated with examples 7 and 8 from Massart et al. (1997).</p> + + <h2 class="hasAnchor" id="references"><a class="anchor" href="#references"></a>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> + + + <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> + <pre class="examples"><div class='input'><span class='co'># This is example 7 from Chapter 8 in Massart et al. (1997)</span> +<span class='fu'>data</span>(<span class='no'>massart97ex1</span>) +<span class='no'>m</span> <span class='kw'><-</span> <span class='fu'>lm</span>(<span class='no'>y</span> ~ <span class='no'>x</span>, <span class='kw'>data</span> <span class='kw'>=</span> <span class='no'>massart97ex1</span>) +<span class='fu'>inverse.predict</span>(<span class='no'>m</span>, <span class='fl'>15</span>) <span class='co'># 6.1 +- 4.9</span></div><div class='output co'>#> $Prediction +#> [1] 6.09381 +#> +#> $`Standard Error` +#> [1] 1.767278 +#> +#> $Confidence +#> [1] 4.906751 +#> +#> $`Confidence Limits` +#> [1] 1.187059 11.000561 +#> </div><div class='input'><span class='fu'>inverse.predict</span>(<span class='no'>m</span>, <span class='fl'>90</span>) <span class='co'># 43.9 +- 4.9</span></div><div class='output co'>#> $Prediction +#> [1] 43.93983 +#> +#> $`Standard Error` +#> [1] 1.767747 +#> +#> $Confidence +#> [1] 4.908053 +#> +#> $`Confidence Limits` +#> [1] 39.03178 48.84788 +#> </div><div class='input'><span class='fu'>inverse.predict</span>(<span class='no'>m</span>, <span class='fu'>rep</span>(<span class='fl'>90</span>,<span class='fl'>5</span>)) <span class='co'># 43.9 +- 3.2</span></div><div class='output co'>#> $Prediction +#> [1] 43.93983 +#> +#> $`Standard Error` +#> [1] 1.141204 +#> +#> $Confidence +#> [1] 3.168489 +#> +#> $`Confidence Limits` +#> [1] 40.77134 47.10832 +#> </div></pre> + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> + <h2>Contents</h2> + <ul class="nav nav-pills nav-stacked"> + <li><a href="#arguments">Arguments</a></li> + + <li><a href="#value">Value</a></li> + + <li><a href="#note">Note</a></li> + + <li><a href="#references">References</a></li> + + <li><a href="#examples">Examples</a></li> + </ul> + + </div> +</div> + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="http://hadley.github.io/pkgdown/">pkgdown</a>.</p> +</div> + + </footer> + </div> + + </body> +</html> diff --git a/docs/reference/lod.html b/docs/reference/lod.html new file mode 100644 index 0000000..7c33d47 --- /dev/null +++ b/docs/reference/lod.html @@ -0,0 +1,210 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html> + <head> + <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://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> +<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> + +<!-- Font Awesome icons --> +<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"> + + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../jquery.sticky-kit.min.js"></script> +<script src="../pkgdown.js"></script> + +<!-- mathjax --> +<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></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> + <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"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="../index.html">chemCal</a> + </div> + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Reference</a> +</li> +<li> + <a href="../articles/index.html">Articles</a> +</li> + </ul> + + <ul class="nav navbar-nav navbar-right"> + + </ul> + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + </header> + + <div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Estimate a limit of detection (LOD)</h1> + </div> + + + <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> + + + <pre>lod(object, …, alpha = 0.05, beta = 0.05, method = "default", tol = "default")</pre> + + <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a> Arguments</h2> + <dl class="dl-horizontal"> + <dt>object</dt> + <dd> + A univariate model object of class <code>lm</code> or + <code><a href='http://www.rdocumentation.org/packages/MASS/topics/rlm'>rlm</a></code> + with model formula <code>y ~ x</code> or <code>y ~ x - 1</code>, + optionally from a weighted regression. + </dd> + <dt>…</dt> + <dd> + Placeholder for further arguments that might be needed by + future implementations. + </dd> + <dt>alpha</dt> + <dd> + The error tolerance for the decision limit (critical value). + </dd> + <dt>beta</dt> + <dd> + The error tolerance beta for the detection limit. + </dd> + <dt>method</dt> + <dd> + 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. + </dd> + <dt>tol</dt> + <dd> + 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. + </dd> + </dl> + + <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>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> + + <h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>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>predict.lm</code> + function, which is currently not supported in R.</p> + + <h2 class="hasAnchor" id="references"><a class="anchor" href="#references"></a>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>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> + + <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> + + <p>Examples for <code><a href='din32645.html'>din32645</a></code></p> + + + <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> + <pre class="examples"><div class='input'><span class='fu'>data</span>(<span class='no'>din32645</span>) +<span class='no'>m</span> <span class='kw'><-</span> <span class='fu'>lm</span>(<span class='no'>y</span> ~ <span class='no'>x</span>, <span class='kw'>data</span> <span class='kw'>=</span> <span class='no'>din32645</span>) +<span class='fu'>lod</span>(<span class='no'>m</span>)</div><div class='output co'>#> $x +#> [1] 0.08655484 +#> +#> $y +#> 1 +#> 3317.154 +#> </div><div class='input'> +<span class='co'># The critical value (decision limit, German Nachweisgrenze) can be obtained</span> +<span class='co'># by using beta = 0.5:</span> +<span class='fu'>lod</span>(<span class='no'>m</span>, <span class='kw'>alpha</span> <span class='kw'>=</span> <span class='fl'>0.01</span>, <span class='kw'>beta</span> <span class='kw'>=</span> <span class='fl'>0.5</span>)</div><div class='output co'>#> $x +#> [1] 0.0698127 +#> +#> $y +#> 1 +#> 3155.393 +#> </div></pre> + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> + <h2>Contents</h2> + <ul class="nav nav-pills nav-stacked"> + <li><a href="#arguments">Arguments</a></li> + + <li><a href="#value">Value</a></li> + + <li><a href="#note">Note</a></li> + + <li><a href="#references">References</a></li> + + <li><a href="#see-also">See also</a></li> + + <li><a href="#examples">Examples</a></li> + </ul> + + </div> +</div> + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="http://hadley.github.io/pkgdown/">pkgdown</a>.</p> +</div> + + </footer> + </div> + + </body> +</html> diff --git a/docs/reference/loq.html b/docs/reference/loq.html new file mode 100644 index 0000000..bc62e75 --- /dev/null +++ b/docs/reference/loq.html @@ -0,0 +1,205 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html> + <head> + <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://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> +<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> + +<!-- Font Awesome icons --> +<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"> + + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../jquery.sticky-kit.min.js"></script> +<script src="../pkgdown.js"></script> + +<!-- mathjax --> +<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></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> + <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"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="../index.html">chemCal</a> + </div> + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Reference</a> +</li> +<li> + <a href="../articles/index.html">Articles</a> +</li> + </ul> + + <ul class="nav navbar-nav navbar-right"> + + </ul> + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + </header> + + <div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Estimate a limit of quantification (LOQ)</h1> + </div> + + + <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> + + + <pre>loq(object, …, alpha = 0.05, k = 3, n = 1, w.loq = "auto", + var.loq = "auto", tol = "default")</pre> + + <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a> Arguments</h2> + <dl class="dl-horizontal"> + <dt>object</dt> + <dd> + A univariate model object of class <code>lm</code> or + <code><a href='http://www.rdocumentation.org/packages/MASS/topics/rlm'>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. + </dd> + <dt>alpha</dt> + <dd> + The error tolerance for the prediction of x values in the calculation. + </dd> + <dt>…</dt> + <dd> + Placeholder for further arguments that might be needed by + future implementations. + </dd> + <dt>k</dt> + <dd> + The inverse of the maximum relative error tolerated at the + desired LOQ. + </dd> + <dt>n</dt> + <dd> + The number of replicate measurements for which the LOQ should be + specified. + </dd> + <dt>w.loq</dt> + <dd> + 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. + </dd> + <dt>var.loq</dt> + <dd> + The approximate variance at the LOQ. The default value is + calculated from the model. + </dd> + <dt>tol</dt> + <dd> + 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. + </dd> + </dl> + + <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2> + + <p>The estimated limit of quantification for a model used for calibration.</p> + + <h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>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> + + <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> + + <p>Examples for <code><a href='din32645.html'>din32645</a></code></p> + + + <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> + <pre class="examples"><div class='input'><span class='fu'>data</span>(<span class='no'>massart97ex3</span>) +<span class='fu'>attach</span>(<span class='no'>massart97ex3</span>) +<span class='no'>m</span> <span class='kw'><-</span> <span class='fu'>lm</span>(<span class='no'>y</span> ~ <span class='no'>x</span>) +<span class='fu'>loq</span>(<span class='no'>m</span>)</div><div class='output co'>#> $x +#> [1] 13.97764 +#> +#> $y +#> 1 +#> 30.6235 +#> </div><div class='input'> +<span class='co'># We can get better by using replicate measurements</span> +<span class='fu'>loq</span>(<span class='no'>m</span>, <span class='kw'>n</span> <span class='kw'>=</span> <span class='fl'>3</span>)</div><div class='output co'>#> $x +#> [1] 9.971963 +#> +#> $y +#> 1 +#> 22.68539 +#> </div></pre> + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> + <h2>Contents</h2> + <ul class="nav nav-pills nav-stacked"> + <li><a href="#arguments">Arguments</a></li> + + <li><a href="#value">Value</a></li> + + <li><a href="#note">Note</a></li> + + <li><a href="#see-also">See also</a></li> + + <li><a href="#examples">Examples</a></li> + </ul> + + </div> +</div> + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="http://hadley.github.io/pkgdown/">pkgdown</a>.</p> +</div> + + </footer> + </div> + + </body> +</html> diff --git a/docs/reference/massart97ex1.html b/docs/reference/massart97ex1.html new file mode 100644 index 0000000..9b95a5f --- /dev/null +++ b/docs/reference/massart97ex1.html @@ -0,0 +1,118 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html> + <head> + <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>Calibration data from Massart et al. (1997), example 1 — massart97ex1 • chemCal</title> + +<!-- jquery --> +<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> +<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> + +<!-- Font Awesome icons --> +<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"> + + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../jquery.sticky-kit.min.js"></script> +<script src="../pkgdown.js"></script> + +<!-- mathjax --> +<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></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> + <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"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="../index.html">chemCal</a> + </div> + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Reference</a> +</li> +<li> + <a href="../articles/index.html">Articles</a> +</li> + </ul> + + <ul class="nav navbar-nav navbar-right"> + + </ul> + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + </header> + + <div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Calibration data from Massart et al. (1997), example 1</h1> + </div> + + + <p>Sample dataset from p. 175 to test the package.</p> + + + <pre><span class='fu'>data</span>(<span class='no'>massart97ex1</span>)</pre> + + <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> + + <p>A dataframe containing 6 observations of x and y data.</p> + + <h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>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> + + + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> + <h2>Contents</h2> + <ul class="nav nav-pills nav-stacked"> + + <li><a href="#format">Format</a></li> + + <li><a href="#source">Source</a></li> + </ul> + + </div> +</div> + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="http://hadley.github.io/pkgdown/">pkgdown</a>.</p> +</div> + + </footer> + </div> + + </body> +</html> diff --git a/docs/reference/massart97ex3-5.png b/docs/reference/massart97ex3-5.png Binary files differnew file mode 100644 index 0000000..c6c080e --- /dev/null +++ b/docs/reference/massart97ex3-5.png diff --git a/docs/reference/massart97ex3.html b/docs/reference/massart97ex3.html new file mode 100644 index 0000000..2ec8f6f --- /dev/null +++ b/docs/reference/massart97ex3.html @@ -0,0 +1,188 @@ +<!-- Generated by pkgdown: do not edit by hand --> +<!DOCTYPE html> +<html> + <head> + <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>Calibration data from Massart et al. (1997), example 3 — massart97ex3 • chemCal</title> + +<!-- jquery --> +<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script> +<!-- Bootstrap --> + +<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> +<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> + +<!-- Font Awesome icons --> +<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"> + + +<!-- pkgdown --> +<link href="../pkgdown.css" rel="stylesheet"> +<script src="../jquery.sticky-kit.min.js"></script> +<script src="../pkgdown.js"></script> + +<!-- mathjax --> +<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></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> + <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"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="../index.html">chemCal</a> + </div> + <div id="navbar" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li> + <a href="../reference/index.html">Reference</a> +</li> +<li> + <a href="../articles/index.html">Articles</a> +</li> + </ul> + + <ul class="nav navbar-nav navbar-right"> + + </ul> + </div><!--/.nav-collapse --> + </div><!--/.container --> +</div><!--/.navbar --> + + + </header> + + <div class="row"> + <div class="col-md-9 contents"> + <div class="page-header"> + <h1>Calibration data from Massart et al. (1997), example 3</h1> + </div> + + + <p>Sample dataset from p. 188 to test the package.</p> + + + <pre><span class='fu'>data</span>(<span class='no'>massart97ex3</span>)</pre> + + <h2 class="hasAnchor" id="format"><a class="anchor" href="#format"></a>Format</h2> + + <p>A dataframe containing 6 levels of x values with 5 + observations of y for each level.</p> + + <h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>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> + + + <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> + <pre class="examples"><div class='input'><span class='fu'>data</span>(<span class='no'>massart97ex3</span>) +<span class='fu'>attach</span>(<span class='no'>massart97ex3</span>)</div><div class='output co'>#> <span class='message'>The following objects are masked from massart97ex3 (pos = 3):</span> +#> <span class='message'></span> +#> <span class='message'> x, y</span></div><div class='input'><span class='no'>yx</span> <span class='kw'><-</span> <span class='fu'>split</span>(<span class='no'>y</span>, <span class='no'>x</span>) +<span class='no'>ybar</span> <span class='kw'><-</span> <span class='fu'>sapply</span>(<span class='no'>yx</span>, <span class='no'>mean</span>) +<span class='no'>s</span> <span class='kw'><-</span> <span class='fu'>round</span>(<span class='fu'>sapply</span>(<span class='no'>yx</span>, <span class='no'>sd</span>), <span class='kw'>digits</span> <span class='kw'>=</span> <span class='fl'>2</span>) +<span class='no'>w</span> <span class='kw'><-</span> <span class='fu'>round</span>(<span class='fl'>1</span> / (<span class='no'>s</span>^<span class='fl'>2</span>), <span class='kw'>digits</span> <span class='kw'>=</span> <span class='fl'>3</span>) +<span class='no'>weights</span> <span class='kw'><-</span> <span class='no'>w</span>[<span class='fu'>factor</span>(<span class='no'>x</span>)] +<span class='no'>m</span> <span class='kw'><-</span> <span class='fu'>lm</span>(<span class='no'>y</span> ~ <span class='no'>x</span>, <span class='kw'>w</span> <span class='kw'>=</span> <span class='no'>weights</span>) +<span class='fu'><a href='calplot.html'>calplot</a></span>(<span class='no'>m</span>)</div><div class='output co'>#> <span class='warning'>Warning: Assuming constant prediction variance even though model fit is weighted</span></div><img src='massart97ex3-5.png' alt='' width='540' height='400' /><div class='input'> +<span class='co'># The following concords with the book p. 200</span> +<span class='fu'><a href='inverse.predict.html'>inverse.predict</a></span>(<span class='no'>m</span>, <span class='fl'>15</span>, <span class='kw'>ws</span> <span class='kw'>=</span> <span class='fl'>1.67</span>) <span class='co'># 5.9 +- 2.5</span></div><div class='output co'>#> $Prediction +#> [1] 5.865367 +#> +#> $`Standard Error` +#> [1] 0.8926109 +#> +#> $Confidence +#> [1] 2.478285 +#> +#> $`Confidence Limits` +#> [1] 3.387082 8.343652 +#> </div><div class='input'><span class='fu'><a href='inverse.predict.html'>inverse.predict</a></span>(<span class='no'>m</span>, <span class='fl'>90</span>, <span class='kw'>ws</span> <span class='kw'>=</span> <span class='fl'>0.145</span>) <span class='co'># 44.1 +- 7.9</span></div><div class='output co'>#> $Prediction +#> [1] 44.06025 +#> +#> $`Standard Error` +#> [1] 2.829162 +#> +#> $Confidence +#> [1] 7.855012 +#> +#> $`Confidence Limits` +#> [1] 36.20523 51.91526 +#> </div><div class='input'> +<span class='co'># The LOD is only calculated for models from unweighted regression</span> +<span class='co'># with this version of chemCal</span> +<span class='no'>m0</span> <span class='kw'><-</span> <span class='fu'>lm</span>(<span class='no'>y</span> ~ <span class='no'>x</span>) +<span class='fu'><a href='lod.html'>lod</a></span>(<span class='no'>m0</span>)</div><div class='output co'>#> $x +#> [1] 5.407085 +#> +#> $y +#> 1 +#> 13.63911 +#> </div><div class='input'> +<span class='co'># Limit of quantification from unweighted regression</span> +<span class='fu'><a href='loq.html'>loq</a></span>(<span class='no'>m0</span>)</div><div class='output co'>#> $x +#> [1] 13.97764 +#> +#> $y +#> 1 +#> 30.6235 +#> </div><div class='input'> +<span class='co'># For calculating the limit of quantification from a model from weighted</span> +<span class='co'># regression, we need to supply weights, internally used for inverse.predict</span> +<span class='co'># If we are not using a variance function, we can use the weight from</span> +<span class='co'># the above example as a first approximation (x = 15 is close to our</span> +<span class='co'># loq approx 14 from above).</span> +<span class='fu'><a href='loq.html'>loq</a></span>(<span class='no'>m</span>, <span class='kw'>w.loq</span> <span class='kw'>=</span> <span class='fl'>1.67</span>)</div><div class='output co'>#> $x +#> [1] 7.346195 +#> +#> $y +#> 1 +#> 17.90777 +#> </div><div class='input'><span class='co'># The weight for the loq should therefore be derived at x = 7.3 instead</span> +<span class='co'># of 15, but the graphical procedure of Massart (p. 201) to derive the </span> +<span class='co'># variances on which the weights are based is quite inaccurate anyway. </span></div></pre> + </div> + <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> + <h2>Contents</h2> + <ul class="nav nav-pills nav-stacked"> + + <li><a href="#format">Format</a></li> + + <li><a href="#source">Source</a></li> + + <li><a href="#examples">Examples</a></li> + </ul> + + </div> +</div> + + <footer> + <div class="copyright"> + <p>Developed by Johannes Ranke.</p> +</div> + +<div class="pkgdown"> + <p>Site built with <a href="http://hadley.github.io/pkgdown/">pkgdown</a>.</p> +</div> + + </footer> + </div> + + </body> +</html> |