aboutsummaryrefslogtreecommitdiff
path: root/inst/web/inverse.predict.html
blob: a513357f20e34ecfb39cef686cc123389f0b9a1e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
<title>inverse.predict. chemCal 0.1-37</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="">

<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<link href="css/highlight.css" rel="stylesheet">
<link href="css/staticdocs.css" rel="stylesheet">

<!--[if lt IE 9]>
  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    tex2jax: {
      inlineMath: [ ['$','$'], ["\\(","\\)"] ],
      processEscapes: true
    }
  });
</script>
<script type="text/javascript"
  src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
  </head>

  <body>
    <div class="navbar">
  <div class="navbar-inner">
    <div class="container">
      <a class="brand" href="#">chemCal 0.1-37</a>
      <div class="nav">
        <ul class="nav">
          <li><a href="index.html"><i class="icon-home icon-white"></i> Index</a></li>
        </ul>
      </div>
    </div>
  </div>
</div>

    <div class="container">
      <header>
        
      </header>
      
      <h1>Predict x from y for a linear calibration</h1>

<div class="row">
  <div class="span8">
    <h2>Usage</h2>
    <pre><div>inverse.predict(object, newdata, ..., ws, alpha=0.05, var.s&nbsp;=&nbsp;"auto")</div></pre>
    
    <h2>Arguments</h2>
    <dl>
      <dt>object</dt>
      <dd>
    A univariate model object of class <code><a href='http://www.inside-r.org/r-doc/stats/lm'>lm</a></code> or 
    <code><a href='http://www.inside-r.org/r-doc/MASS/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>
    
    <div class="Value">
      <h2>Value</h2>

      <p><dl>
  A list containing the predicted x value, its standard error and a
  confidence interval.
</dl></p>
  
    </div>

    <div class="Description">
      <h2>Description</h2>

      <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>
  
    </div>

    <div class="Note">
      <h2>Note</h2>

      <p>The function was validated with examples 7 and 8 from Massart et al. (1997).</p>
  
    </div>

    <div class="References">
      <h2>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>
  
    </div>
    
    <h2 id="examples">Examples</h2>
    <pre class="examples"><div class='input'># This is example 7 from Chapter 8 in Massart et al. (1997)
data(massart97ex1)
m &lt;- lm(y ~ x, data = massart97ex1)
inverse.predict(m, 15)        #  6.1 +- 4.9
</div>
<div class='output'>$Prediction
[1] 6.09381

$`Standard Error`
[1] 1.767278

$Confidence
[1] 4.906751

$`Confidence Limits`
[1]  1.187059 11.000561

</div>
<div class='input'>inverse.predict(m, 90)        # 43.9 +- 4.9
</div>
<div class='output'>$Prediction
[1] 43.93983

$`Standard Error`
[1] 1.767747

$Confidence
[1] 4.908053

$`Confidence Limits`
[1] 39.03178 48.84788

</div>
<div class='input'>inverse.predict(m, rep(90,5)) # 43.9 +- 3.2
</div>
<div class='output'>$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="span4">
    <!-- <ul>
      <li>inverse.predict</li><li>inverse.predict.lm</li><li>inverse.predict.rlm</li><li>inverse.predict.default</li>
    </ul>
    <ul>
      <li>manip</li>
    </ul> -->
      
        
  </div>
</div>
      
      <footer>
      <p class="pull-right"><a href="#">Back to top</a></p>
<p>Built by <a href="https://github.com/hadley/staticdocs">staticdocs</a>. Styled with <a href="http://twitter.github.com/bootstrap">bootstrap</a>.</p>
      </footer>
    </div>
  </body>
</html>

Contact - Imprint