



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Linear Regression (Review)
Recall the study to relate birthweight to the estriol level of pregnant women.
Estriol (mg / 24 hr)
Birthweight (g / 100)
6 8 10 12 14 16 18 20 22 24 26 28
23
25
27
29
31
33
35
37
39
41
43
45
Linear Regression - Summary of Assumptions:
3 Linear Regression - Notation:
We have been using capital X or Y to denote a random variable and x or y to denote the values that the respective random variables could assume. In linear regression, we assume that values of X are fixed (not random). The notation above is consistent with this idea. Many books follow this notation. At the same time, many books (including your text) do not. We will follow the notation in your book.
The full linear regression model takes the following form
y = α + βx + ,
where is a normally distributed random variable with mean 0 and variance σ^2.
(xi, yi) denote data values. There are 31 (xi, yi) pairs shown in the scatterplot.
4 How do we get estimates of β and α? We would like the line to be as close to the data as possible. The line is given in general by α + βx. For a fixed xi, the corresponding point on the line would be defined as
α + βxi Consider measuring the distance from the data point yi to the line.
yi − α − βxi
The distance from the data point yi to the value of the line for a given xi is
yi − α − βxi
We could sum up all of the differences. As always, it’s a good idea to square the differences so that they don’t cancel out.
S denotes the sum of squared differences (distances) between data points and the line
S = ∑n i= (yi − α − βxi)^2
The least squares line, or estimated regression line, is the line that minimizes S.
Finding the least squares line means finding the values of α and β that minimize S.
With a little calculus, you can show that these values are
βˆ =
∑n i=1 ∑(nxi^ −^ ¯x)(yi^ −^ y¯) i=1(xi^ −^ ¯x)^2
and ˆα = ¯y − βˆ x¯
When we estimate α and β based on data ((xi, yi) pairs), the estimates, ˆα and βˆ, are called estimated regression coefficients or just regression coefficients.
7
Once estimates αˆ and βˆ of α and β have been computed, the predicted value of yi given xi is obtained from the estimated regression line.
yˆi = ˆα + βxˆi,
where ˆyi is the prediction of the true value of yi, for observation i, i = 1... n. In our example, n = 31, and
βˆ =
∑ni=1(xi − ¯x)(yi − y¯) ∑n i=1(xi^ −^ ¯x)^2
and αˆ = ¯y − βˆ x¯ = 21. 52
The estimated regression line is
ˆyi = 21.52 + 0. 608 xi
8 The estimated regression line (ˆyi = 21.52 + 0. 608 xi) is shown along with the data below.
Estriol (mg / 24 hr)
Birthweight (g / 100)
6 8 10 12 14 16 18 20 22 24 26 28
23
25
27
29
31
33
35
37
39
41
43
45
For that data, ˆα = 3.9143, βˆ = 0.7801, and so
ˆy = 3.9143 + 0. 7801 x.
In the context of this example, we know that the prediction of the mean head circumference at age 29 weeks is given by ˆy.
Question: How accurate is this prediction?
Answer: It depends on whether we are making predictions for the mean value of all infants that are 29 gestational weeks or one specific infant at age 29 weeks.
The first answer might be useful to a researcher interested in the relationship between head circumference and age at 29 weeks over a large population of infants; the second answer might be useful to an MD interested in assessing the head circumference of a particular infant.
We would like to construct a confidence interval around the true mean for a fixed value of x (E[y|x] = μy|x) and a confidence interval (most commonly called a prediction interval) for a future value (new value) of y, again for a fixed x. A 100(1 − α∗) confidence interval for the mean value of y for a fixed x (μy|x) is: ( ˆy − tn− 2 ,α∗/ 2 seˆ(ˆy), yˆ + tn− 2 ,α∗/ 2 seˆ(ˆy)
)
where ˆy is the predicted mean of the normally distributed outcomes. The standard error of ˆy is given by:
A 100(1 − α∗) confidence interval for a (predicted) future value of y (denoted by ˜y) for a given x is: ( ˜y − tn− 2 ,α∗/ 2 seˆ(˜y), y˜ + tn− 2 ,α∗/ 2 seˆ(˜y)
)
The standard error of ˜y is always bigger than the standard error of yˆ since an extra source of variability is being considered.
15
Using these formulas, we could show that for gestational age fixed at 29 weeks, a 95 % confidence interval for the mean value of y is
(26. 23 , 26 .85)
Similarly we could show that for gestational age fixed at 29 weeks, a 95 % prediction interval for an individual value of y is
(23. 38 , 29 .70)
Using this interval, we can identify individuals that look unusual.
16 Nenana Ice Classice - Alaska’s coolest lottery See http://www.nenanaakiceclassic.com
•••
- - - - - - - - - - - - - - - - • - - - - - - - - - - - - - - - - • - - - - - - - - - - - ••••
Year
Time
1916 1928 1940 1952 1964 1976 1988 2000
19
21
23
25
27
29
1
3
5
7
9
11
13
15
17
19
•••
- - - - - - - - - - - - - - - - • - - - - - - - - - - - - - - - - • - - - - - - - - - - - ••••
Year
Time
1916 1928 1940 1952 1964 1976 1988 2000
19
21
23
25
27
29
1
3
5
7
9
11
13
15
17
19
0 10 20 30 40 50 60 70 80
-^
5
15
-20 -10 0 10
0
5
10
20
fit$residuals