![Page 1: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/1.jpg)
PS 225Lecture 20
Linear Regression Equation and Prediction
![Page 2: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/2.jpg)
Adding Regression Line
![Page 3: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/3.jpg)
Dependence
What if two variables are correlated? What if the mean of a variable is
dependent on the value of another variable? Is it dependent? How much is it dependent? How can we express the dependence
algebraically?
![Page 4: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/4.jpg)
Examples of Dependence
The distance traveled at a given speed
= x The cost of a bag of bulk mixed nuts with a
given price per pound
= x
Distance Speed Time
Cost WeightPrice
Linear Relationship
s
![Page 5: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/5.jpg)
Types of Relationships
Deterministic Relationship One variable totally determines the value of
another variable with perfect accuracy Algebraic linear relationship Previous examples
Variable One variable affects the value of another
variable with some element of variability Example: Height and weight
![Page 6: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/6.jpg)
Using SPSS to Determine a Linear Relationship Is there a relationship?
![Page 7: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/7.jpg)
Linear Regression Form of a Line Algebraic Form of Line:
A is the y-intercept B is the slope
Linear Regression Meaning of the Line A is the ‘constant’ B is a ‘coefficient’
bxay
![Page 8: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/8.jpg)
SPSS Output for A Regression Line
Y = -18331.2 + 3909.907*x
X = Education Level
Y = Current Salary
![Page 9: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/9.jpg)
Interpreting the Constant
Only has meaning if:
• Data present to validate
• Can naturally occur
![Page 10: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/10.jpg)
Interpreting the Coefficient
Change in dependent variable for each unit change in the independent variable
![Page 11: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/11.jpg)
2-Step Hypothesis Process
Test Overall Linear Relationship Test Contribution of Each Component
Similar to 2-Way ANOVA
![Page 12: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/12.jpg)
Step 1: Overall Test
Is there a linear relationship? Ho: Means are the same at all values of
x (No relationship) Ha: There is a linear relationship
between x and y
If significance<.05 conclude relationship Otherwise, stop analysis
![Page 13: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/13.jpg)
Step 2: Component Tests
Is the component significant? Intercept Coefficient
Ho: Not Significant Ha: Significant
If significance<.05 conclude significant Otherwise, eliminate from analysis and
recreate model
![Page 14: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/14.jpg)
Line of Best Fit Regression line that minimizes the
distance to data points SPSS calculations
![Page 15: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/15.jpg)
Sum of Squares Sum of squared differences for each data
point Regression- Difference between overall
mean and regression line Residual- Difference Between the
regression line and data points
Regression lines minimize the residual sum of squares
![Page 16: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/16.jpg)
Deviations
![Page 17: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/17.jpg)
Sum of Squares
![Page 18: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/18.jpg)
Predicting Values from a Linear Regression
Write equation for the regression line ‘Plug in’ independent variable Gain a prediction for the dependent
variable
The relationship between the values of the independent variable and the prediction are deterministic
![Page 19: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/19.jpg)
Accuracy of Predictions
The BEST guess Probably not exact due to variability Correct on average
![Page 20: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/20.jpg)
Quality of Prediction
Predicted values must be within the range of the data
Relationship must be linear over the entire range of the data
Line must not depend too strongly on one point
![Page 21: PS 225 Lecture 20 Linear Regression Equation and Prediction](https://reader036.vdocuments.site/reader036/viewer/2022062721/56649f275503460f94c3f14f/html5/thumbnails/21.jpg)
SPSS AssignmentLast class we answered the following questions:
Does the number of years of education an individual has affect the hours of television a person watches?
Does age affect the hours of television a person watches?
This class: Use SPSS to find the regression equation that best represents each relationship. Write the full regression equation. Make a prediction for yourself with each regression
equation How different is each prediction from the number of hours
you watch? If the equation under predicts, report your answer as a negative number. If it over predicts report your answer as a positive number. Add your prediction error to the class data.