aboutsummaryrefslogtreecommitdiff
path: root/inst/doc/chemCal.Rnw
diff options
context:
space:
mode:
Diffstat (limited to 'inst/doc/chemCal.Rnw')
-rw-r--r--inst/doc/chemCal.Rnw31
1 files changed, 26 insertions, 5 deletions
diff --git a/inst/doc/chemCal.Rnw b/inst/doc/chemCal.Rnw
index 2c902ab..26b224f 100644
--- a/inst/doc/chemCal.Rnw
+++ b/inst/doc/chemCal.Rnw
@@ -20,7 +20,7 @@ inverse prediction method given in \cite{massart97} would be implemented,
since it also covers the case of weighted regression.
At the moment, the package only consists of two functions, working
-on univariate linear models of class \texttt{lm}.
+on univariate linear models of class \texttt{lm} or \texttt{rlm}.
When calibrating an analytical method, the first task is to generate
a suitable model. If we want to use the \chemCal{} functions, we
@@ -59,9 +59,9 @@ given by the user in the case of weighted regression. By default,
the mean of the weights used in the linear regression is used.
\section*{Theory}
-Equation 8.28 in \cite{massart97} gives a general equation for predicting x
-from measurements of y according to the linear calibration function
-$ y = b_0 + b_1 \cdot x$:
+Equation 8.28 in \cite{massart97} gives a general equation for predicting the
+standard error $s_{\hat{x_s}}$ for an x value predicted from measurements of y
+according to the linear calibration function $ y = b_0 + b_1 \cdot x$:
\begin{equation}
s_{\hat{x_s}} = \frac{s_e}{b_1} \sqrt{\frac{1}{w_s m} + \frac{1}{\sum{w_i}} +
@@ -72,9 +72,30 @@ s_{\hat{x_s}} = \frac{s_e}{b_1} \sqrt{\frac{1}{w_s m} + \frac{1}{\sum{w_i}} +
with
\begin{equation}
-s_e = \sqrt{ \frac{\sum w_i (y_i - \hat{y})^2}{n - 2}}
+s_e = \sqrt{ \frac{\sum w_i (y_i - \hat{y_i})^2}{n - 2}}
\end{equation}
+where $w_i$ is the weight for calibration standard $i$, $y_i$ is the mean $y$
+value (!) observed for standard $i$, $\hat{y_i}$ is the estimated value for
+standard $i$, $n$ is the number calibration standards, $w_s$ is the weight
+attributed to the sample $s$, $m$ is the number of replicate measurements of
+sample $s$, $\bar{y_s}$ is the mean response for the sample,
+$\bar{y_w} = \frac{\sum{w_i y_i}}{\sum{w_i}}$ is the weighted mean of responses
+$y_i$, and $x_i$ is the given $x$ value for standard $i$.
+
+The weight $w_s$ for the sample should be estimated or calculated in accordance
+to the weights used in the linear regression.
+
+I adjusted the above equation in order to be able to take a different precisions
+in standards and samples into account. In analogy to Equation 8.26 from \cite{massart97}
+we get
+
+\begin{equation}
+s_{\hat{x_s}} = \frac{1}{b_1} \sqrt{\frac{{s_s}^2}{w_s m} +
+ {s_e}^2 \left( \frac{1}{\sum{w_i}} +
+ \frac{(\bar{y_s} - \bar{y_w})^2 \sum{w_i}}
+ {{b_1}^2 \left( \sum{w_i} \sum{w_i {x_i}^2} - {\left( \sum{ w_i x_i } \right)}^2 \right) } \right) }
+\end{equation}
\begin{thebibliography}{1}
\bibitem{massart97}

Contact - Imprint