









































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!










































James H. Steiger
Department of Psychology and Human Development Vanderbilt University
(^1) Introduction 2 The Simple Linear Regression Model 3 Statistical Notation in ALR 4 Ordinary Least Squares Estimation Fitted Values and Residuals The Least Squares Criterion Analyzing the Forbes Data 5 Properties of Least Squares Estimators (^6) Comparing Models: The Analysis of Variance Interpreting p-values Power Calculations The Coefficient of Determination R^2 Revisiting Power Calculation (^7) Confidence Intervals and Tests Introduction The Intercept β 0 The Slope β 1 A Predicted Value from a New Data Point A Fitted Value (Conditional Mean) Plotting Confidence Intervals 8 Residuals
The Simple Linear Regression Model
Because there is conditional variability in Y , the scores on Y cannot generally be perfectly predicted from those on X , and so, to account for this, we say
yi = E(Y |X = xi ) + ei (3) = β 0 + β 1 xi + ei (4)
As we pointed out in Psychology 310, the “statistical errors” ei are defined tautologically as
ei = yi − (β 0 + β 1 xi ) (5)
However, since we do not know the population β 1 and β 0 , the statistical errors are unknown and can only be estimated.
The Simple Linear Regression Model
We make two important assumptions concerning the errors:
(^1) We assume that E(ei |xi ) = 0, so if we could draw a scatterplot of the ei versus the xi , we would have a null scatterplot, with no patterns. (^2) We assume the errors are all independent, meaning that the value of the error for one case gives no information about the value of the error for another case.
Under these assumptions, if the population is bivariate normal, the errors will be normally distributed.
The Simple Linear Regression Model
Statistical Notation in ALR
ALR uses a notation in Chapter 2 that is a mixture of standard and not-quite-so-standard notation, but adjustment to it should be easy. Table 2.1 in ALR shows the standard symbols. 2.1 ORDINARY LEAST SQUARES ESTIMATION
Table 2.1 Definitions of Symbolsa Quantity
y sxx
SDx SYY
SDy SXY Sxy rxy
2.x;ln 2.y;ln
Definition
2.(x; - :X)^2 = 2.(x; - x)x; SXX/(n - 'sxx/(n-1) 2.(y; - y)2 = 2.(y; -Y)y; SYY/(n -1) '1sYY/(n-1) 2.(x; -:X)(y; - Y) = 2.(x; -x)y; SXY/(n -1) sx/(SDxSDy)
Description Sample average of x Sample average of y Sum of squares for the xs Sample variance of the xs
23
Sample standard deviation of the xs Sum of squares for the ys Sample variance of the ys Sample standard deviation of the ys Sum of cross-products Sample covariance Sample correlation aln each equation, the symbol I means to add over all n values or pairs of. values in the data.
Ordinary Least Squares Estimation Fitted Values and Residuals
The sample-based estimates of β 0 and β 1 are denoted βˆ 0 and βˆ 1 , respectively. The fitted value for case i is given ˆE(Y |X = xi ), for which we use the shorthand notation ˆyi , ˆyi = ˆE(Y |X = xi ) = ˆβ 0 + ˆβ 1 xi (6)
In other words, the fitted values are obtained by applying the sample regression equation to the sample data.
Ordinary Least Squares Estimation Fitted Values and Residuals
In a similar vein, we define the sample residuals: for the ith case, we have
ˆei = yi − ˆyi (7)
Ordinary Least Squares Estimation The Least Squares Criterion
Consider any conceivable estimates of β 0 and β 1 , and call them β∗ 0 ∗ and β 1 ∗. The residual sum of squares (RSS) for a given β 0 ∗ , β 1 ∗ , is the sum of squares of the sample residuals around the regression line defined by that particular pair of values, i.e.,
RSS(β∗ 0 , β∗ 1 ) =
∑^ n
i= 1
[yi − (β∗ 0 + β∗ 1 xi)]^2 (8)
The OLS estimates βˆ 0 , βˆ 1 are the values that minimize RSS. There are several well-known identities useful in computing RSS in OLS regression. For example:
RSS( β^ 0 , β^ 1 ) = SYY −
= SYY − β^ 12 SXX (10)
Ordinary Least Squares Estimation The Least Squares Criterion
A solution to the “least squares problem” is given in ALR appendix A.3. The actual solution, as you know from Psychology 310, is
βˆ 1 = SXY SXX
= ryx
SDy SDx
βˆ 0 = y − βˆ 1 x (12)
In computing the sample residuals, we utilize the two estimates given above, so an unbiased estimate of σ^2 has n − 2 in its denominator, i.e.,
σˆ^2 =
n − 2
Ordinary Least Squares Estimation Analyzing the Forbes Data
We can use the capabilities of R to perform the computational formulas as given in ALR.
X <- BoilingPoint Y <- LogPressure SXY <- sum((X-mean(X))*(Y-mean(Y))) SXX <- sum((X-mean(X))^2 ) SYY <- sum((Y-mean(Y))^2 ) beta.hat.1 <- SXY/SXX beta.hat.0 <- mean(Y) - beta.hat.1 * mean(X) e.hat <- Y - (beta.hat.0 + beta.hat.1 * X) RSS <- sum(e.hat^2) n <- length(Y) sigma.hat.squared <- RSS / (n-2) sigma.hat <- sqrt(sigma.hat.squared)
Ordinary Least Squares Estimation Analyzing the Forbes Data
Here are the results:
SYY [1] 0. SXX [1] 530. SXY [1] 10. beta.hat. [1] 0. beta.hat. [1] -0. RSS [1] 0. sigma.hat.squared [1] 7.622099e- sigma.hat [1] 0.
Properties of Least Squares Estimators
The estimates are unbiased, i.e.,
E( ˆβ 0 ) = β 0 (14) E( ˆβ 1 ) = β 1 (15) E(ˆσ^2 ) = σ^2 (16)
Properties of Least Squares Estimators
If we assume that errors have constant variance and are uncorrelated, then
Var( ˆβ 0 ) = σ^2
n
x^2 SXX
Var( ˆβ 1 ) =
σ^2 SXX
Var(ˆσ^2 ) =
2 σ^4 n − 2
Cov( ˆβ 0 , βˆ 1 ) = −σ^2
x SXX