Introduction to Regression Analysis: Predictions, Equations, and Error
Introduction for Regression Analysis
- Context within the Course: Regression is the follow-up topic to Correlation (Chapter 13). It is considered one of the more challenging topics to adapt to an online format because the presentation often varies based on student questions and feedback.
- Prerequisites for Success:
- Slope-Intercept Form: Students must have a solid grasp of the algebraic concept of a line (). Reviewing this for 10-20 minutes is essential to avoid wasting time during the 90-minute to two-hour regression lecture.
- Concept of Deviations: A refresher of deviations from Chapter 4 is highly recommended, as regression concepts (like residuals) are analogous to deviations from the mean.
- The Example Case: This lecture continues the example used in Chapter 13: the relationship between playing violent video games (Variable ) and aggressive behavior (Variable , measured in fights per week).
The Purpose and Logic of Regression
- Prediction: The primary purpose of regression is to predict specific values of based on given values of . While correlation tells us the strength and direction of a relationship, regression allows us to make concrete estimates.
- The Best Fit Line (Regression Line):
- In a scatter plot, we can visualize a line running through the points.
- If points go up and to the right, there is a positive correlation; if they go down and to the right, it is a negative correlation. If the points are a "blob," there is no correlation.
- Regression uses a precise mathematical procedure to find the single best line that fits the data better than any other possible line. This is also known as the "best fit line."
- Predicting Heights (): On a graph, the regression line allows us to find an value on the horizontal axis, look up to the height of the line at that point, and find the corresponding prediced value on the vertical axis.
Regression Notation and Symbols
- Y-Hat (): Predicted values of are given the symbol . It is read aloud as "y-hat."
- Metaphor: Think of the symbol as a "wizard's hat." This indicates the value is a prediction (magic/foresight) rather than an actual observed data point.
- Algebra vs. Statistics Notation:
- Algebra: (where = slope and = intercept).
- Statistics (Regression): .
- In stats, is the symbol for slope (changing from ).
- In stats, is the symbol for the intercept (changing from ).
- Note of Confusion: The letter represents the intercept in algebra but represents the slope in regression statistics.
- Variables vs. Constants:
- and are variables. You can plug in any to get a corresponding .
- (slope) and (intercept) are constants. For a specific dataset, these numbers are calculated once and do not change for that problem.
Solving for Slope and Intercept
To find the equation of the regression line, you use data already calculated for correlation (, , , , and ).
- Formula for Slope ():
- Formula for Intercept ():
- Restriction: You must always solve for slope () first because it is a required component of the intercept () formula.
Example Calculation (Video Games and Aggression)
Using values from the Chapter 13 example:
- (Average hours of games per week)
- (Average fights per week)
- Calculate :
- Calculate :
- The Regression Equation:
Interpreting Slope and Intercept
- General Interpretation of Slope (): It tells you how many units of increase occur in the predicted () for each one-unit increase in .
- Example Case: For every one additional hour of violent video games played per week (), we predict the child will get into more fights per week ().
- General Interpretation of Intercept (): It tells you the predicted value of when .
- Example Case: If a child plays zero hours of violent video games per week, we predict they will get into fights per week. (This accounts for other factors that might cause aggression besides games).
Using the Equation to Generate Predictions
We plug actual observed values into the equation to see how well the line predicts the actual values (fights).
- Child 1: (Actual )
- Child 2: (Actual )
- Child 3: (Actual )
- Child 4: (Actual )
- Child 5: (Actual )
Note: Prediction models are rarely perfect. The value of regression is being able to predict outcomes for a new child () even when we don't have their fight data ().
Residuals (Error of Prediction)
- Definition: A residual is the difference between an actual observed value () and a predicted value ().
- Formula:
- Interpretation of the Sign:
- Positive Residual: The person scored higher than the prediction. The point is above the line.
- Negative Residual: The person scored lower than the prediction. The point is below the line.
- Mathematical Property: The sum of all residuals in a dataset is always zero (), much like the sum of deviations from the mean.
- Visual Representation: Residuals are the vertical distances between the points on a scatter plot and the regression line.
Defining the "Best Fit"
- Least Squares Criterion: The regression line is called the "best fit" because it minimizes the total vertical distance between the line and all data points.
- Sum of Squared Residuals (): Because residuals add up to zero, we square them to make them all positive before summing them.
- The regression line is the line that results in the smallest possible .
- If you tweak the slope or intercept even slightly, the will increase.
Standard Error of the Estimate
- Definition: The standard error of the estimate is the "average residual." It measures the average vertical distance between the actual data points and the regression line.
- Analogy: It is to the regression line what standard deviation is to the mean.
- Notation: In this course, we use the abbreviation "Standard Error of the Estimate."
- Formula:
- Note on Degrees of Freedom: We use because we are dealing with two variables ( and ).
- Computational Shortcut for :
- Using the example:
- Final Calculation for Example:
- Meaning: On average, our predictions of fights per week are off by fights.
Relationship Between Correlation and Standard Error
- Inverse Relationship: As the correlation () gets stronger (closer to or ), the standard error of the estimate gets smaller.
- High Correlation = Small Error: If education and income are highly correlated, knowing education allows for very accurate (low error) predictions of income.
- Low Correlation = High Error: If IQ and shoe size have a near-zero correlation, using IQ to predict shoe size will result in massive errors, performing no better than random guessing.