PSYC 3070K - Quantitative Methods: Linear Regression
PSYC 3070K Quantitative Methods Linear Regression: Part 1
Learning Objectives
Define linear regression.
Identify errors of prediction in a scatter plot with a regression line.
Vocabulary
Regression: Predicting scores on one variable (criterion variable) from the values of others (predictor variables).
Linear Regression Models: Utilize the equation of a straight line to fit the data. Other types of regression do not assume linear relationships.
Simple Linear Regression: A linear regression model with only one predictor variable.
Linear Regression
Like Pearson’s $r$, linear regression fits a straight line through a set of points.
The equation of the line can be used to predict the value of the criterion variable (Y) from the predictor variable (X).
The Equation of a Line
The general form of the equation is:
In a specific example, the equation can look like:
Components of the Regression Equation
Y': Predicted value of the criterion variable.
X: Predictor variable.
b: Represents the association between X and Y.
A: The y-intercept, a constant value.
Prediction errors (or residuals) are the differences between each actual point (Y) and the predicted point (Y').
Best-fitting Line: Most commonly determined by minimizing the sum of squared prediction errors:
ext{Sum of Squared Errors} = extstyle egin{pmatrix} ext{Sum} \ (Y - Y')^2 ext{, where } Y' ext{ is the predicted value}
ewline ext{and } Y ext{ is the actual value} ext{.} ightspace ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{below } ext{ } ext{ } ext{} ext{ } ext{} ext{ } ext{} ext{ } ext{} ext{ } ext{} ext{} ext{} \ ext{best-fit line} ext{ assumes some linear relationships. } ext{ This point should still be written in full.} ext{ } ext{ } ext{ } ext{ } ext{ . } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } ext{} ext{ } ext{ } ext{ } ext{ } ext{ } ext{ } } ext{ ext{ }}}
Example of Computing the Regression Line
Given values:
Regression equation can be formulated as:
Where:
Participation Example
To predict a woman's shoe size from height, information gathered includes:
Mean height: 64 inches
Standard deviation of height: 2 inches
Mean shoe size: 8
Standard deviation of shoe size: 1
Correlation (height & shoe size): 0.5
Find the equation of the regression line.
Standardized Residuals
If variables X and Y are standardized (converted to z-scores), the regression equation changes to:
Where there is no y-intercept.
The slope of the regression line equals the correlation coefficient (r).
Unstandardized b vs. Standardized Beta
Unstandardized Coefficient (b): Computed from the original measurement units of the predictor variable (e.g., dollars, centimeters).
Example in Ride-Share:
Total cost equation:
Units for the slope = dollars per mile.
Standardized Coefficient (β or Beta): Computed from units of standard deviation (when X and Y are converted to z-scores).
For ride-share, the equation becomes:
Implication: A standard deviation increase in distance relates to a β standard deviations increase in cost.
Reporting Unstandardized b vs. Standardized Beta
Unstandardized units are more intuitive to the public (e.g., dollars per mile).
In cases of multiple regression with more than one predictor, standardized slopes (β) are preferable for comparison across different measurement units, highlighting predictor importance.
Example Correlation
Given:
Pearson’s r for correlation = -0.134
Unstandardized regression equation:
Regression Table
Predictors with coefficients:
Predictor
b
P-value
Intercept
3.729
<0.001
Neuroticism
-0.104
0.003
Regression equation can be presented as:
Regression Table with Standardized Beta
Predictor
Unstandardized b
Standardized Beta
P-value
Intercept
3.729
-
<0.001
Neuroticism
-0.104
-0.134
0.003
The standardized Beta correlates to the correlation coefficient with one predictor variable.
Regression equation can be represented under standardized terms:
Example for University GPA Prediction
To predict University GPA from High School GPA, an unstandardized regression example:
Example calculation given High School GPA = 3.0:
JASP Outputs for Linear Regression
When using linear regression software like JASP, expect:
Model Summary: Comparison of fit across different models.
ANOVA: General test for significant variance explanation by predictors.
Coefficients: Values of b, Beta, t-statistics, and p-values for each effect overview.
Example Output from JASP Analysis
Linear Regression detailing elements such as the model fit:
Describing dependent variables, methods, and regression results.
Model
R
R²
Adjusted R²
RMSE
(Complete results here)
APA Style Reporting of Results
Example reporting the simple linear regression result:
"A simple linear regression was calculated to predict college GPA from High School GPA. High School GPA explained a significant proportion of variance in College GPA, R² = .608, F(1, 103) = 159.57, p < .001. High School GPA was positively associated with College GPA, b = .675, t(103) = 12.632, p < .001."
Learning Objectives for Next Section
Compute the sum of squares Y.
Convert raw scores to deviation scores.
Compute predicted scores from a regression equation.
Partition sum of squares Y into sum of squares predicted and sum of squares error.
Define R² and compute the standard error of the estimate based on prediction errors.
Compute standard error using Pearson's correlation.
Partitioning the Sums of Squares
Regression analyses partition variability into different sources.
Total Variability: Includes Explained (from predictor variable) and Error (unexplained variability).
Relationship: Total = Explained + Error.
Concept of Sum of Squared Deviations
SSY (Total Variability): The sum of squared deviation scores for the criterion variable Y.
Notation for Variability
Table formatting to reveal the notation on variations:
Y = observed outcome
$y = ext{deviation score} (Y - M_y)$
$y^2 = ext{squared deviation scores}$
Explained vs. Unexplained Variability
$y' = ext{deviance of predicted scores}$
Total variability formulated as:
SSY = extstyle egin{pmatrix} ext{Total Variability} \ ext{Explained (SSY')} \ ext{Unexplained (SSE)} \ \ ext{Measured as: } ext{ Expl = } ext{(predicted scores)}^2, ext{Unexpl = } ((Y - Y')^2) ext{ for total measure.}\ ext{ } ext{ ext{Sum of errors is such }}}
R-Squared Calculation
R-squared (R²): The percentage of the criterion variable explained by predictors (0 to 1).
In simple linear regression with one predictor: R² is the square of the correlation coefficient.
R² derives from the ratio:
R-squared Calculation Example
For this calculation:
Standard Error of the Estimate
Indicates accuracy in regression predictions.
Example highlighting more prediction error observed in one dataset compared to another (e.g., Figure 1A vs. Figure 1B).
Definition of Standard Error of the Estimate
Measures: The standard deviation of prediction errors closely linked with the sum of squares error (SSE).
Formulas: To compute standard error of the estimate:
For the population:%
For the sample:
Where $Y$ = actual score, $Y'$ = predicted score, $N$ = number of score pairs.
Participation Exercise
Analyze a provided graph displaying a regression line to quantify the standard error of the estimate based on the visual prediction errors for Y.
Using Pearson’s Correlation for Standard Error of the Estimate
Equations that indicate the derivation of standard error estimates using Pearson’s correlation: $ρ$ (population correlation) and $r$ (sample correlation).
Variance measures addressed through calculations involving the sum of squares total (SSY) relative to pairs of scores (N).