licensed under a . Your use of this Creative Commons Attribution-NonCommercial-ShareAlike License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike License. Your use of this
material constitutes acceptance of that license and the conditions of use of materials on this site.
Copyright 2006, The Johns Hopkins University and Karl W. Broman. All rights reserved. Use of these materials
permitted only in accordance with license rights granted. Materials provided “AS IS”; no representations or
warranties provided. User assumes all responsibility for use, and all liability related thereto, and must independently
review all materials for accuracy and efficacy. May contain materials owned by others. User is responsible for
obtaining permissions for use from third parties as needed.
Estimating the mean response
pf3d7
Y = 0.353 − 0.0039X
0.35
OD
0.30
0.25
0.218
0.20
0.15
0
10
25
35
50
H2O2 concentration
We can use the regression results to predict the expected response for a new
concentration of hydrogen peroxide. But what is its variability?
Variability of the mean response
Let ŷ be the predicted mean for some x, i. e.
ŷ = β̂0 + β̂1x
Then
E(ŷ) = β0 + β1 x
2
var(ŷ) = σ 2
1 (x − x̄)
+
n
SXX
where y is the true mean response.
!
Why?
E(ŷ) = E(β̂0 + β̂1 x)
= E(β̂0) + x E(β̂1)
= β0 + x β1
var(ŷ) = var(β̂0 + β̂1 x)
= var(β̂0) + var(β̂1 x) + 2 cov(β̂0, β̂1 x)
= var(β̂0) + x2 var(β̂1) + 2 x cov(β̂0, β̂1)
!
2 2
1
x̄
x
2 x x̄ σ 2
2
2
= σ
+
+σ
−
n SXX
SXX
SXX
2
(
x
−
x̄
)
1
+
= σ2
n
SXX
Confidence intervals
Hence
ŷ ± t(1 – α2 ),n – 2 × σ̂ ×
s
1 (x − x̄)2
+
n
SXX
is a (1 – α)×100% confidence interval for the mean response
given x.
pf3d7 − 95% confidence limits for the mean response
0.35
OD
0.30
0.25
0.20
0.15
0
10
25
50
H2O2 concentration
Prediction
Now assume that we want to calculate an interval for the predicted
response y⋆ for a value of x.
There are two sources of uncertainty:
(a) the mean response
(b) the natural variation σ 2
⋆
The variance of ŷ is
⋆
var(ŷ ) = σ 2 + σ 2
2
1 (x − x̄)
+
n
SXX
!
2
= σ2 1 +
1 (x − x̄)
+
n
SXX
!
Prediction intervals
Hence
⋆
ŷ ± t(1 – α2 ),n – 2 × σ̂ ×
s
1 (x − x̄)2
1+ +
n
SXX
is a (1 – α)×100% prediction interval for the predicted response
given x.
Note: When n is very large, we get just
⋆
ŷ ± t(1 – α2 ),n – 2 × σ̂
pf3d7
95% confidence limits for the mean response
0.35
95% confidence limits for the prediction
OD
0.30
0.25
0.20
0.15
0
10
25
H2O2 concentration
50
Span and height
75
Height (inches)
70
65
60
60
65
70
75
80
Span (inches)
With just 100 individuals
75
Height (inches)
70
65
60
60
65
70
Span (inches)
75
80
Regression for calibration
That prediction interval is for the case that the x’s are known without error while
y = β0 + β1 x + ǫ
where ǫ = error
A more common situation:
We have a number of pairs (x,y) to get a calibration line/curve.
x’s basically without error; y’s have measurement error
We obtain a new value, y⋆, and want to estimate the
corresponding x⋆.
y⋆ = β0 + β1 x⋆ + ǫ
Example
180
Fluorescence
160
140
120
100
0
5
10
15
20
[Quinine]
25
30
35
Another example
180
Fluorescence
160
140
120
100
0
5
10
15
20
25
30
35
[Quinine]
Regression for calibration
Data:
(xi,yi) for i = 1,. . . ,n
with yi = β0 + β1 xi + ǫi, ǫi ∼ iid Normal(0, σ)
y⋆j for j = 1,. . . ,m
with y⋆j = β0 + β1 x⋆ + ǫ⋆j , ǫ⋆j ∼ iid Normal(0, σ)
for some x⋆
Goal:
Estimate x⋆ and give a 95% confidence interval.
Obtain β̂0 and β̂1 by regressing the yi on the xi.
The estimate:
⋆
Let x̂ = (ȳ⋆ − β̂0)/β̂1
where ȳ⋆ =
⋆
j yj /m
P
95% CI for x̂⋆
Let T denote the 97.5th percentile of the t distr’n with n–2 d.f.
√
√
Let g = T / [|β̂1| / (σ̂/ SXX)] = (T σ̂) / (|β̂1| SXX)
If g ≥ 1,
we would fail to reject H0 : β1 = 0!
⋆
In this case, the 95% CI for x̂ is (−∞, ∞).
If g < 1, our 95% CI is the following:
q
⋆
(x̂ − x̄) g2 + (T σ̂ / |β̂1|) (x̂ − x̄)2/SXX + (1 − g2) ( m1 + 1n )
⋆
⋆
x̂ ±
1 − g2
For very large n, this reduces to
√
⋆
x̂ ± (T σ̂) / (|β̂1| m)
Example
180
Fluorescence
160
140
120
100
0
5
10
15
20
[Quinine]
25
30
35
Another example
180
Fluorescence
160
140
120
100
0
5
10
15
20
25
30
35
25
30
35
[Quinine]
Infinite m
180
Fluorescence
160
140
120
100
0
5
10
15
20
[Quinine]
Infinite n
180
Fluorescence
160
140
120
100
0
5
10
15
20
[Quinine]
25
30
35