









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!










The objective of simple linear regression (SLR or SLREG) is to determine if an output y is linearly related to an input x. The SLREG model
Regression Versus Correlation Levels of x are fixed (x, y) is a bivariate random vector As an example, the tensile strength (TS) of paper is thought to be linearly related to the amount of hardwood concentration in the pulp. In a pilot plant, 10 sample pairs (xi , yi ), i = 1, 2, …, 10, were produced leading to the following data: xi : 10 15 15 20 20 20 25 25 28 30% yi : 160 171 175 182 184 181 188 193 195 200 psi where x = Hardwood Concentration, and y = Paper TS.
The objective is to estimate the unknown parameters β 0 and β 1 such that the least squares function (LSF) n 2 n 2 L( β 0 (^) , β (^) 1 ) = (^) ∑ i = 1 ∈ i (^) = (^) ∑ i = 1 (y (^) i − β 0 (^) − β 1 x )i (58)
is minimized wrt (with respect to) β 0 and β 1. For example, at (x 1 = 10, y = y 1 ), the expression for the error before experimentation is given by ∈ 1 = y 1 −
been gathered, as shown above, the LSF in Eq. (58) reduces to:
In order to minimize the LSF in Eq. (58) wrt β 0 and β 1 , we partially differentiate and require that its partial derivatives to equal zero in order to obtain the optimum point.
The above 2 equations simplify to
After some algebra, these last two equations reduce to
n i 1 i
y − n β ˆ (^) 0 − β ˆ 1
10 i i 1
=
∑ = 0
n i ∑ = 1^ x yi^ i −^ β ˆ^0
10 i ∑ = 1^ xi −^ β ˆ^1
(^10 ) i ∑ = 1^ xi = 0. The above heterogeneous system of 2 equations with 2 unknowns when written as
10 i ∑ = 1^ xi =
n i i 1
=
∑ →^10 β ˆ^ 0 +^ β ˆ 1^ (208) =1829, and
10 i ∑ = 1^ xi +^ β ˆ^1
(^10 ) i ∑ = 1^ xi =
n i ∑ = 1^ x yi^ i →^ β ˆ^^0 (208) +^ β ˆ^1^ (4684) = 38715, is called the LS (least squares) normal equations. The 1st^ equation gives
zero, then the best fit for each yi is (^) y.
0 for all statistical models. For example, in the case of SLREG
n i ∑ = 1^ ei = The
sum of all n residuals =
n i i i 1
=
∑ −^ =
n i 1 i i 1
=
∑ −^ − β^ −^ ≡0 because^ yˆi
n i i 1
=
∑ −^ ≡ and
n i i 1
=
∑ −^ ≡0.
A test of Significance in Regression is 1st^ conducted thru an ANOVA Table. To this end, we compute the SS’s for the ANOVA.
USS =
n (^2) i i 1
=
∑ = 335825 (with n = 10 df), CF = (
n i i 1
=
∑ )^2 /n =
= 1829^2 /10 = 334524.10 (with 1 df) → SST = USS − CF
SS(Total) =
n (^2) i i 1
=
∑ − = USS^ −^ CF = 1300.90 (with n^ −1 = 9 df).
SS(Residuals) =
n (^2) i i 1
=
∑ = 38.83277405 (with n^ −2 = 8 df because there are 2
constraints; try to determine what they are for bonus points).
Now, SS(Residuals) =
n (^2) i i 1
=
∑ =
n (^2) i i i 1
=
∑ − =
n (^2) i 1 i i 1
=
∑ −^ − β^ − =
n (^2) i i 1
=
∑ − −^2 β ˆ 1
n i i i 1
=
∑ −^ − +^ β ˆ 12
n (^2) i i 1
=
∑ − =
Exercise 108. Show that
SST =
n (^2) i i 1
=
∑ − =
n (^2) i i i i 1
=
∑ −^ +^ − =
n (^2) i i i 1
=
∑ − +
n (^2) i i 1
=
∑ − = SSRES^ + SSREG,
and as a result SSREG = SS(Model) =
n (^2) i ∑ = 1^ (yˆi^ − y ) =^ β ˆ^1^ Sxy^.
that SSREG + SSRES = 1262.0672 + 38.8328 = 1300.90 = SSTotal = SST. The ANOVA Table is given below.
Source df SS MS F 0 Total 9 1300. Model or Regression 1 1262.06723 1262.06723 260. Residuals 8 38.83277 4.8541 F0.01,1,8 = 11.
Since the P-value of the F-test is almost zero, then strongly reject H 0 : β 1 = 0. The regressor variable x accounts for 97.015% of variability in the response y.
ordered pairs (xi , yi ), we proceed as follows: SS(Pure Error) = (171^2 + 175^2 − 3462 /2) + (182^2 + 184^2 +181^2 − 5472 /3) + (188^2
Source df SS MS F 0 Total 9 1300. Model 1 1262.06723 1262.06723 260. Residuals 8 38.83277 4.8541 F (^) 0.01,1,8 = 11. Pure Error (PE) 4 25.16667 6. Lack of Fit (LOF) 4 13.66611 3.41653 0.
studying the remaining of these notes, obtain the 95% CIs for β 0 , β 1 and E(Y⏐x = 2.5). xi 1.0 1.5 1.5 1.5 2.0 2.0 2. yi 101.4 117.4 117.1 106.2 131.9 146.9 146. xi 2.4 2.8 2.8 3.0 3.0 3.2 3. yi 133.9 135.1 145.2 134.3 144.5 143.7 146.
Exercise 112. Show that in SLR with ni observations at m distinct levels
SSRES =
m n i 2 i ∑ ∑ = 1 j 1 =^ (y^ ij^ − y )ˆi =
m n i 2 i ∑ ∑ = 1 j 1 =^ [(y^ ij^ −^ y^ i.^ )^ +^ (yi.^ − y )]ˆi =
=
m n i 2 i ∑ ∑ = 1 j 1 =^ (y^ ij^ − y^ i.) +
m (^2) i ∑ = 1^ n (yi^ i^ − y )ˆi = SS(PE) + SS(LOF).
Note that the terminology regression is due to Francis Galton who first observed (in the late 19 th^ century) that the height of sons tended to be closer to the mean height of species than their fathers, i.e., the height of off-springs tended to regress back toward the mean height of the entire species, no matter what the height of fathers were.
Recall that if a rv is N(μ, unknown σ^2 ), then the statistic [rv − E(rv) ]/ se (rv) ~ Tν, where ν is the df of the se (rv).
Therefore, to test H 0 : β 1 = 0 VS H 1 : β 1 ≠ 0, we may use the fact that
1 1 1
1
RES xx
has a Student’s t-distribution with ν = n −2 df. We now apply this t-test to the regression model of the Example on page 181.
be zero, then our null test statistic becomes
t 0 =^1 RES xx
which far exceeds t0.025,8 = 2.3060, and hence the null hypothesis of zero slope must be strongly rejected. Note that (t 0 ) 2 = F 0 = 260.0004 of the ANOVA Table on page 185 of these notes. The discrepancy in the 4th decimal is strictly due to rounding. The next SI (statistical inference) is to obtain either a 95% or 99% CI
for β 1. Figure 27 shows the sampling distribution (SMD) of^1 RES xx
for confidence level of 1 − α = 0.95. Figure 1 clearly shows that the Pr( −2.3060 ≤ T 8 ≤ 2.3060)
−2.3060 0 2.
0.025 0.
Figure 27. The SMD of ( β ˆ 1 (^) − β 1 ) / se ( β ˆ 1 )
Example on page 181 of these notes. Suppose we are to make N (the most common value of N is one observation in the future) observations at x 0 =
observation (not yet obtained). Clearly, the best single point forecast from
variance of forecast error at N = 1 is given by
0 2 xx
(^0) RES xx
[1 (^) n S ]
has a student’s t-distribution with (n − 2) df. Therefore, with N = 1 future observation at x 0 = 22 we obtain the following 95% prediction Pr statement:
Pr[ −2.3060 ≤^0 (^0) RES xx
Rearranging the inequality inside the brackets yields the 95% PI (prediction interval) for y 0.
To obtain the actual 95% PI, we 1st^ compute the se ( ψ ).
statement.
Finally, rearranging the inequality inside the above brackets results in
The length of the above prediction band is 10.6766. Note that, unlike a CI, the above PI actually has a Pr of 0.95 to contain a future observation because y 0 is still a random variable, as it has not yet been observed. Further, the length of the 95% PI is always larger than the corresponding 95% CI.
Regression is generally applicable if the regressor (or independent) variable can be controlled by the experimenter so that V(X) = 0. In studies where both variables x and y have to be measured from the same sampling unit, i.e., the (x, y) pair form a bivariate random vector, then it is best to conduct a correlation analysis than regressing y on x. To this end, let [x
coefficient between x and y is defined as
ρxy = X Y
xy X Y
where σxy = E[(X − μx )×(Y − μy)] = E(XY) − E(X)×E(Y) is the covariance between the random variables X and Y. It can be proven that − 1 ≤ ρ ≤ 1, or | ρ | ≤ 1, which you will be asked to do in the following Bonus Exercise.
There are two different tests that can be conducted on the parameter ρ: (1) H 0 : ρ = 0, (2) H 0 : ρ = ρ 0 , where ρ 0 ≠ 0.
H 1 : ρ < 0, or H 1 : ρ > 0. Recall that statistical inference on a parameter is conducted using the sampling distribution of the point estimator. The point estimator of ρ is the sample correlation coefficient r. It can be shown that the sampling distribution (SMD) of the statistic
follows a Student’s t-distribution with (n − 2) df. For the example 45 above, the most appropriate alternative is H 1 : ρ > 0. Therefore, the critical region for testing H 0 : ρ = 0 at the LOS α = 0.05 is (1.771, ∞). The value of our test
t (^) 0.05,13 = 1.771, leading to the rejection of zero correlation between X and Y.
which is less than 0.05 as expected because H 0 was rejected at the 5% level of significance. If the assumption of joint bivariate normal density for the 2 ×1 vector [X Y]T^ is indeed tenable, then the rejection of H 0 : ρ = 0 implies that X and Y are not independent; otherwise, the rejection of H 0 implies that X and Y are linearly related.
Exercise 114. Use results from regression to show that the statistic
2
has a Student’s t sampling distribution. Hint: First refer to an
ANOVA table for the regression of Y on a single regressor X and then use
LOS α = 0.05. The t 0 given in equation (60) cannot be used to test H 0 : ρ = 0.50 because the expression for t 0 is free of ρ. It has been shown, however, in statistical literature that the sampling distribution (SMD) of the statistic
1/(n −3). For the Example 45 above, the SMD of Z is depicted in Figure 28,
SE (Z) = 1/ n − 3 =
0.
0.
AL Au
Figure 28. The SMD of Z under H 0
Figure 29 clearly shows that the
Pr[− 0.82791 − 1.96× SE (Z) ≤ −μZ ≤ − 0.82791 + 1.96× SE (Z)] = 0 or 1. Pr[− 0.82791 − 0.56580 ≤ −μZ ≤ − 0.82791 + 0.56580 ] = 0 or 1. Pr[0.82791 − 0.56580 ≤ μZ ≤ 0.82791 + 0.56580 ] = 0 or 1.
1.68912(1−ρ) ≤ 1 + ρ ≤ 16.23904(1−ρ). These last two inequalities when solved separately from the left yield ρL = 0.25626 and from the right yield ρu= 0.88398, and hence the 95% CI for population correlation coefficient is given by 0.256263 ≤ ρ ≤ 0.883985. The above CI interval could also have been obtained by recognizing
inequality (61), i.e., tanh(0.26210) ≤ ρ ≤ tanh(1.39371) → 0.25626 ≤ ρ ≤ 0.88398, which agrees with the above CI for ρ. As expected, the above CI does include the value of ρ = 0.50 because the null hypothesis H 0 : ρ = 0.50 could not be rejected at the 5% level.
Exercise 115. Repeat the above correlation analysis for the data of Exercise 62 on page 493 of Devore. Check your answer for the 95% CI on ρ by using the formulas
x x x x
− −
and
(b) For the data of Exercise 62 p. 493 of Devore, obtain the 95% lower one- sided CI for ρ. The Microsoft Excel functions for arctanh = tanh-1^ and hyperbolic tangent are ATANH and TANH, respectively.
Exercise 116 (10 Bonus Points). (a) Show that the inverse function
x x x x
− −
, where − 1 ≤
tanh(x) ≤ 1. (b) Use your results in part (a) to derive the following 95% CI for ρ:
], where