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/reference/inverse.predict.html | 101 +++++++++++++++++++----------------- 1 file changed, 52 insertions(+), 49 deletions(-) (limited to 'docs/reference/inverse.predict.html') 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 @@ #>
- + + + -- cgit v1.2.1