MyNixOS website logo
Description

Calibration Functions for Analytical Chemistry.

Simple functions for plotting linear calibration functions and estimating standard errors for measurements according to the Handbook of Chemometrics and Qualimetrics: Part A by Massart et al. (1997) There are also functions estimating the limit of detection (LOD) and limit of quantification (LOQ). The functions work on model objects from - optionally weighted - linear regression (lm) or robust linear regression ('rlm' from the 'MASS' package).

chemCal - Calibration functions for analytical chemistry

Build Status codecov

Overview

chemCal is an R package providing some basic functions for conveniently working with linear calibration curves with one explanatory variable.

Installation

From within R, get the official chemCal release using

install.packages("chemCal")

Usage

chemCal works with univariate linear models of class lm. Working with one of the datasets coming with chemCal, we can produce a calibration plot using the calplot function:

Plotting a calibration

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

LOD and LOQ

If you use unweighted regression, as in the above example, we can calculate a Limit Of Detection (LOD) from the calibration data.

lod(m0)
#> $x
#> [1] 5.407085
#> 
#> $y
#> [1] 13.63911

This is the minimum detectable value (German: Erfassungsgrenze), i.e. the value where the probability that the signal is not detected although the analyte is present is below a specified error tolerance beta (default is 0.05 following the IUPAC recommendation).

You can also calculate the decision limit (German: Nachweisgrenze), i.e. the value that is significantly different from the blank signal with an error tolerance alpha (default is 0.05, again following IUPAC recommendations) by setting beta to 0.5.

lod(m0, beta = 0.5)
#> $x
#> [1] 2.720388
#> 
#> $y
#> [1] 8.314841

Furthermore, you can calculate the Limit Of Quantification (LOQ), being defined as the value where the relative error of the quantification given the calibration model reaches a prespecified value (default is 1/3).

loq(m0)
#> $x
#> [1] 9.627349
#> 
#> $y
#> [1] 22.00246

Confidence intervals for measured values

Finally, you can get a confidence interval for the values measured using the calibration curve, i.e. for the inverse predictions using the function inverse.predict.

inverse.predict(m0, 90)
#> $Prediction
#> [1] 43.93983
#> 
#> $`Standard Error`
#> [1] 1.576985
#> 
#> $Confidence
#> [1] 3.230307
#> 
#> $`Confidence Limits`
#> [1] 40.70952 47.17014

If you have replicate measurements of the same sample, you can also give a vector of numbers.

inverse.predict(m0, c(91, 89, 87, 93, 90))
#> $Prediction
#> [1] 43.93983
#> 
#> $`Standard Error`
#> [1] 0.796884
#> 
#> $Confidence
#> [1] 1.632343
#> 
#> $`Confidence Limits`
#> [1] 42.30749 45.57217

Reference

You can use the R help system to view documentation, or you can have a look at the online documentation.

Metadata

Version

0.2.3

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows