LU4 Lecture Notes
📚 LU4 Lecture Notes.pdf
Brief overview
This document introduces statistical concepts for analyzing relationships between variables. It focuses on understanding and quantifying these relationships for prediction and interpretation. Mastering these techniques is crucial for drawing meaningful conclusions from data.
Key points
- Understanding dependent and independent variables and their roles in relationships.
- Visualizing variable relationships using scatterplots and identifying patterns.
- Quantifying linear association strength and direction with Pearson's correlation coefficient.
- Modeling predictive relationships with simple linear regression and the least squares method.
- Interpreting the goodness-of-fit of regression models using the coefficient of determination.
1. Understanding variables in relationships
1.1 Roles of variables
- Dependent variable (Y): Its value relies on other variables.
- Independent variable (X): It influences the dependent variable's value.
📝 Example: Advertising expenditure (X) impacts a company's product sales (Y). Sales are dependent, advertising is independent 3.
1.2 Visualizing relationships: scatterplots
- A scatterplot shows the link between two numerical variables.
- The independent variable goes on the x-axis. The dependent variable goes on the y-axis.
- This plot reveals if the relationship is:
- Linear (positive or negative)
- Non-linear
- Non-existent 5.
1.3 Quantifying linear relationships: Pearson's correlation coefficient
- The correlation coefficient measures how strong a relationship is.
- Pearson's Product Moment Correlation Coefficient (r) is common 6.
- It ranges from -1 to +1.
🔑 Important: The roles of X and Y are interchangeable for calculating r. If X correlates with Y, then Y correlates with X.
1.3.1 Interpretation of r
Pearson's r indicates the strength and direction of a linear link.
| Value of r | Interpretation |
|---|---|
| r=−1 | Perfect negative linear relationship |
| r close to −1 | Strong negative linear relationship |
| r far from −1 and far from 0 | Moderate negative linear relationship |
| r negative and relatively close to 0 | Weak negative linear relationship |
| r=0 | No linear relationship |
| r positive and relatively close to 0 | Weak positive linear relationship |
| r far from 0 and far from +1 | Moderate positive linear relationship |
| r close to +1 | Strong positive linear relationship |
| r=+1 | Perfect positive linear relationship |
- A value of r near 0 means a weak linear link.
- r = 0 means no linear link, but a non-linear one might exist.
- Outliers can greatly affect the value of r.
🔑 Important: Positive correlation means high values go with high values, and low with low. 🔑 Important: Negative correlation means high values go with low values, and vice versa 7.
1.4 Calculator steps for correlation coefficient
Use these steps to find r on your calculator.
- SETUP → arrow down → 3:STAT → 2:OFF
- MODE → 2:STAT → A + BX
- Enter independent variable values in column X and dependent variable values in column Y.
- AC
- SHIFT STAT → 5:REG → 3:r → = 9.
🔑 Important: Understanding variables and how they relate is key for prediction and analysis in research 2.
2. Simple linear regression analysis
2.1 Introduction to linear regression
- Linear regression analysis models the relationship between variables for prediction.
- It uses one or more independent variables to predict a numerical dependent variable.
- Simple linear regression uses only one independent variable.
- The goal is to fit a straight line to describe the data's relationship.
2.2 The least squares regression equation
- The relationship is modeled as y=a+bx+e.
- y is the dependent variable.
- x is the independent variable.
- a is the y-intercept.
- b is the slope (gradient).
- e is the error term (deviation from the line).
- The least squares method minimizes the sum of squared errors.
- This results in the line of best fit, closest to all data points.
- The predicted value of Y is denoted as y^.
- The regression equation is y^=a+bx.
2.2.1 Calculating regression coefficients
- The regression coefficients a and b are estimated using the least squares method.
- The formula for the slope (b) is: b=n∑x2−(∑x)2n∑xy−(∑x)(∑y).
- The formula for the y-intercept (a) is: a=n∑y−b(∑x).
- The roles of x and y are not interchangeable in these formulas.
2.3 Using the regression model for prediction
- The regression equation predicts the dependent variable for a given independent variable value.
- Predictions should use x-values within the observed range (interpolation).
- Predictions outside the observed range (extrapolation) are not valid.
2.3.1 Interpreting the slope coefficient (b)
- A positive b indicates that Y increases as X increases (positive relationship). Example: y^=3+2x.
- A negative b indicates that Y decreases as X increases (negative relationship). Example: y^=3−2x.
- The sign of b matches the sign of the correlation coefficient (r).
- The slope (b) shows the predicted change in Y for a one-unit change in X.
🔑 Important: The actual numerical values of r and b are not directly related, only their signs.
2.4 Coefficient of determination (r2)
- The coefficient of determination (r2) measures how well the regression line fits the data.
- It is the square of the correlation coefficient (r).
- r2 is typically expressed as a percentage.
- It represents the percentage of variation in the dependent variable explained by the model.
| r Value | r2 Value | Percentage of Variation Explained | Interpretation |
|---|---|---|---|
| 1 | 1 | 100% | All variation in Y explained by X |
| 0 | 0 | 0% | No variation in Y explained by X |
- r2 ranges from 0 to 1 (0% to 100%).
- It indicates the goodness-of-fit, not the direction of the relationship.
- If r2=80%, then 20% of the variation in Y is unexplained by the model.
🔑 Important: r2 tells you how much of the dependent variable's fluctuation is accounted for by the independent variable in your model.
🔑 Important: Simple linear regression analysis provides a framework to understand and quantify the linear relationship between two variables, enabling predictions and assessing the model's fit 10 11 12 13 14 15 16.
3. Applying correlation and regression
3.1 Identifying variables and relationships
- Independent variable: The variable that is manipulated or changed.
- Dependent variable: The variable that is measured or observed.
📝 Example: In a study of athlete fitness and marathon times, fitness score is the independent variable and marathon time is the dependent variable 17.
- Scatterplots help visualize the relationship between two continuous variables.
- The pattern of points indicates the nature and strength of the relationship.
📝 Example: A scatterplot showing points trending downwards from left to right suggests a negative linear relationship 18.
3.2 Calculating correlation and regression statistics
- Correlation measures the strength and direction of a linear relationship between two variables.
- The correlation coefficient, r, ranges from -1 to +1.
🔑 Important: r=+1 means perfect positive linear correlation, r=−1 means perfect negative linear correlation, and r=0 means no linear correlation 19.
- The coefficient of determination, R2, represents the proportion of variance in the dependent variable explained by the independent variable.
- It is the square of the correlation coefficient (R2=r2).
🔑 Important: A higher R2 value indicates a better fit of the regression model.
- The regression equation describes the linear relationship between variables, allowing prediction.
- It takes the form y=a+bx, where y is the dependent variable, x is the independent variable, b is the slope, and a is the intercept.
3.2.1 Formulas for calculation
- The correlation coefficient (r) can be calculated using raw data or summary statistics.
r=[n∑x2−(∑x)2][n∑y2−(∑y)2]n∑xy−(∑x)(∑y) 20.
- The regression line's slope (b) and intercept (a) are calculated as follows:
b=n∑x2−(∑x)2n∑xy−(∑x)(∑y).
a=n∑y−b(∑x) 21.
3.3 Interpreting computer output
- Statistical software provides regression analysis results, including key values.
- Multiple R: The correlation coefficient between the observed and predicted values of the dependent variable.
- R Square: The coefficient of determination (R2).
📝 Example: An R2 of 0.88 means 88% of the variation in marathon time is explained by fitness score 22.
- Coefficients: These are the intercept (a) and slope (b) of the regression line.
- P-value: Indicates the statistical significance of the relationship. A low P-value (typically < 0.05) suggests the relationship is unlikely due to random chance.
3.3.1 Interpreting relationship strength and variation
- A correlation coefficient close to +1 or -1 indicates a strong linear relationship. A value near 0 indicates a weak one.
- The R Square value quantifies the proportion of variation in the dependent variable explained by the independent variable.
- The remaining proportion is unexplained variation.
📝 Example: If R2=0.88, then 88% of the variation in marathon time is explained by fitness, and 100%−88%=12% is unexplained 23.
3.3.2 Interpreting the slope and making predictions
- The slope (b) represents the average change in the dependent variable for a one-unit increase in the independent variable.
📝 Example: A slope of -2.98 for fitness score means that for every one-point increase in fitness score, marathon time decreases by an average of 2.98 hours.
- Predictions using the regression equation are most valid when the independent variable's value is within the range of the observed data.
- Extrapolation (predicting outside the observed range) can lead to unreliable results.
🔑 Important: Predicting a marathon time for a fitness score of 2 is valid if 2 falls within the original fitness score range. Predicting for a score of 5, if 5 is outside the range, is extrapolation 24.
- Regression models predict the dependent variable from the independent variable. They do not directly allow prediction of the independent variable from the dependent variable.
🔑 Important: You cannot directly predict an athlete's fitness score from their marathon time using a model where marathon time is the dependent variable 25.
🔑 Important: Understand that correlation does not imply causation; a strong relationship shown by regression analysis only suggests that the variables change together, not that one directly causes the other.
© 2026 Maeve. All rights reserved. This content is protected by copyright.