Hours Studied (x): [2, 3, 5, 6, 7, 8, 9, 10, 12, 15]
Exam Scores (y): [55, 60, 68, 72, 75, 78, 82, 85, 90, 95]
Then predict the exam score for 11 hours of study.
Line of Best Fit: The straight line that best represents the relationship between two variables in a scatterplot. It minimizes the sum of squared residuals (least squares regression).
Regression Equation: y = mx + b, where m is the slope and b is the y-intercept.
Least Squares Method: A mathematical procedure to find the line that minimizes the sum of the squares of the vertical distances from each point to the line.
- Calculate means: x̄ and ȳ
- Calculate slope: m = Σ[(xi - x̄)(yi - ȳ)] / Σ(xi - x̄)²
- Calculate y-intercept: b = ȳ - mx̄
- Write equation: y = mx + b
- Make predictions by substituting x-values
x̄ = (2 + 3 + 5 + 6 + 7 + 8 + 9 + 10 + 12 + 15) / 10 = 77 / 10 = 7.7
ȳ = (55 + 60 + 68 + 72 + 75 + 78 + 82 + 85 + 90 + 95) / 10 = 760 / 10 = 76
Numerator: Σ[(xi - x̄)(yi - ȳ)] = (2-7.7)(55-76) + (3-7.7)(60-76) + ... + (15-7.7)(95-76)
= (-5.7)(-21) + (-4.7)(-16) + (-2.7)(-8) + (-1.7)(-4) + (-0.7)(-1) + (0.3)(2) + (1.3)(6) + (2.3)(9) + (4.3)(14) + (7.3)(19)
= 119.7 + 75.2 + 21.6 + 6.8 + 0.7 + 0.6 + 7.8 + 20.7 + 60.2 + 138.7 = 451.0
Denominator: Σ(xi - x̄)² = (-5.7)² + (-4.7)² + (-2.7)² + (-1.7)² + (-0.7)² + (0.3)² + (1.3)² + (2.3)² + (4.3)² + (7.3)²
= 32.49 + 22.09 + 7.29 + 2.89 + 0.49 + 0.09 + 1.69 + 5.29 + 18.49 + 53.29 = 144.1
m = 451.0 / 144.1 = 3.13
b = ȳ - mx̄ = 76 - (3.13)(7.7) = 76 - 24.10 = 51.90
y = 3.13x + 51.90
For x = 11 hours: y = 3.13(11) + 51.90 = 34.43 + 51.90 = 86.33
Predicted score for 11 hours: 86.33
The equation of the line of best fit is y = 3.13x + 51.90. Based on this model, a student who studies for 11 hours is predicted to score approximately 86.33 on the exam.
• Slope Formula: m = Σ[(xi - x̄)(yi - ȳ)] / Σ(xi - x̄)²
• Y-intercept Formula: b = ȳ - mx̄
• Regression Equation: y = mx + b
• Prediction: Substitute x-value into the regression equation
Hours Studied (x): [2, 3, 5, 6, 7, 8, 9, 10, 12, 15]
Actual Scores (y): [55, 60, 68, 72, 75, 78, 82, 85, 90, 95]
Calculate residuals and interpret the results.
Residual: The difference between the actual y-value and the predicted y-value from the regression line. Residual = Actual - Predicted.
Residual Analysis: The process of examining residuals to assess the appropriateness of the regression model.
Good Fit: Residuals should be randomly scattered around zero with no systematic pattern.
Using y = 3.13x + 51.90:
- x = 2: y = 3.13(2) + 51.90 = 58.16
- x = 3: y = 3.13(3) + 51.90 = 61.29
- x = 5: y = 3.13(5) + 51.90 = 67.55
- x = 6: y = 3.13(6) + 51.90 = 70.68
- x = 7: y = 3.13(7) + 51.90 = 73.81
- x = 8: y = 3.13(8) + 51.90 = 76.94
- x = 9: y = 3.13(9) + 51.90 = 80.07
- x = 10: y = 3.13(10) + 51.90 = 83.20
- x = 12: y = 3.13(12) + 51.90 = 89.46
- x = 15: y = 3.13(15) + 51.90 = 98.85
Residual = Actual - Predicted:
- Point (2,55): 55 - 58.16 = -3.16
- Point (3,60): 60 - 61.29 = -1.29
- Point (5,68): 68 - 67.55 = 0.45
- Point (6,72): 72 - 70.68 = 1.32
- Point (7,75): 75 - 73.81 = 1.19
- Point (8,78): 78 - 76.94 = 1.06
- Point (9,82): 82 - 80.07 = 1.93
- Point (10,85): 85 - 83.20 = 1.80
- Point (12,90): 90 - 89.46 = 0.54
- Point (15,95): 95 - 98.85 = -3.85
The residuals range from -3.85 to 1.93, with most values close to zero. The largest residual is for the point with x = 15, suggesting the model may be less accurate at higher x values.
The residuals appear randomly scattered around zero with no clear pattern, indicating a good linear fit. The sum of residuals is approximately zero (as expected for least squares regression).
The residuals range from -3.85 to 1.93 and appear randomly scattered around zero, indicating a good linear fit. The model provides reasonable predictions for most data points, though it slightly overpredicts for the highest x-value (15 hours).
• Residual Formula: Residual = Actual - Predicted
• Good Fit Criteria: Residuals randomly scattered around zero
• Pattern Detection: Look for systematic patterns in residuals
• Model Assessment: Random residuals indicate appropriate model
Hours Studied (x): [2, 3, 5, 6, 7, 8, 9, 10, 12, 15]
Exam Scores (y): [55, 60, 68, 72, 75, 78, 82, 85, 90, 95]
Also interpret the meaning of r and r².
Correlation Coefficient (r): A measure of the strength and direction of the linear relationship between two variables. Range: -1 ≤ r ≤ 1.
Coefficient of Determination (r²): The proportion of variance in the response variable that is explained by the explanatory variable. Range: 0 ≤ r² ≤ 1.
Strength Interpretation: |r| > 0.8 (strong), 0.5 < |r| < 0.8 (moderate), |r| < 0.5 (weak).
From previous work:
- Σ[(xi - x̄)(yi - ȳ)] = 451.0
- Σ(xi - x̄)² = 144.1
- Σ(yi - ȳ)² = (55-76)² + (60-76)² + ... + (95-76)² = 1840
r = 451.0 / √(144.1 × 1840) = 451.0 / √265,144 = 451.0 / 514.92 = 0.876
r² = (0.876)² = 0.767
r = 0.876 indicates a strong positive linear relationship between hours studied and exam scores.
r² = 0.767 means that 76.7% of the variation in exam scores can be explained by the number of hours studied.
This indicates that the regression model accounts for a substantial portion of the variability in the data.
With r² = 0.767, the model is considered quite good, as it explains about 77% of the variation in exam scores.
About 23% of the variation remains unexplained by the model.
r² = 0.767
r² = 0.767 (76.7% of variation explained)
The correlation coefficient is r = 0.876, indicating a strong positive linear relationship between hours studied and exam scores. The coefficient of determination is r² = 0.767, meaning that 76.7% of the variation in exam scores can be explained by the number of hours studied. This indicates a good regression model with strong predictive power.
• Correlation Formula: r = Σ[(xi - x̄)(yi - ȳ)] / √[Σ(xi - x̄)²Σ(yi - ȳ)²]
• Coefficient of Determination: r² = (correlation coefficient)²
• Interpretation: r² represents the proportion of variance explained
• Strength Assessment: |r| > 0.8 indicates strong relationship
Line of Best Fit: The straight line that best represents the relationship between two variables in a scatterplot, minimizing the sum of squared residuals (least squares regression).
Regression Equation: The mathematical equation of the line of best fit, typically written as y = mx + b, where m is the slope and b is the y-intercept.
Slope (m): The rate of change of the response variable (y) for a one-unit increase in the explanatory variable (x).
Y-Intercept (b): The value of y when x equals zero, representing the starting value of the relationship.
Residual: The difference between the actual y-value and the predicted y-value from the regression line. Residual = Actual - Predicted.
Correlation Coefficient (r): A measure of the strength and direction of the linear relationship between two variables, ranging from -1 to +1.
Coefficient of Determination (r²): The proportion of variance in the response variable that is explained by the explanatory variable, ranging from 0 to 1.
- Data Collection: Gather paired data points (x, y)
- Descriptive Statistics: Calculate means (x̄, ȳ) and standard deviations
- Slope Calculation: Use the least squares formula to find m
- Y-Intercept Calculation: Use b = ȳ - mx̄
- Equation Formation: Write y = mx + b
- Model Assessment: Calculate residuals and r²
- Prediction: Use the equation to predict y-values for given x-values
- Interpretation: Analyze the practical meaning of slope and intercept
• Regression Equation: y = mx + b
• Slope Formula: m = Σ[(xi - x̄)(yi - ȳ)] / Σ(xi - x̄)²
• Y-Intercept Formula: b = ȳ - mx̄
• Residual Formula: Residual = y_actual - y_predicted
• Correlation Formula: r = Σ[(xi - x̄)(yi - ȳ)] / √[Σ(xi - x̄)²Σ(yi - ȳ)²]
• Coefficient of Determination: r² = (correlation coefficient)²
• Strength Interpretation: |r| > 0.8 (strong), 0.5 < |r| < 0.8 (moderate), |r| < 0.5 (weak)
Advertising ($1000s) (x): [2, 3, 4, 5, 6, 7, 8, 9]
Sales ($1000s) (y): [45, 52, 58, 65, 72, 78, 85, 92]
Find the regression equation, interpret the slope and intercept, and predict sales for $10,000 advertising expenditure.
Business Application: Using regression analysis to make informed decisions about resource allocation and forecasting.
Return on Investment (ROI): The financial gain relative to the cost of an investment, which can be estimated using regression models.
x̄ = (2 + 3 + 4 + 5 + 6 + 7 + 8 + 9) / 8 = 44 / 8 = 5.5
ȳ = (45 + 52 + 58 + 65 + 72 + 78 + 85 + 92) / 8 = 547 / 8 = 68.375
Numerator: Σ[(xi - x̄)(yi - ȳ)]
= (-3.5)(-23.375) + (-2.5)(-16.375) + (-1.5)(-10.375) + (-0.5)(-3.375) + (0.5)(3.625) + (1.5)(9.625) + (2.5)(16.625) + (3.5)(23.625)
= 81.81 + 40.94 + 15.56 + 1.69 + 1.81 + 14.44 + 41.56 + 82.69 = 280.5
Denominator: Σ(xi - x̄)² = (-3.5)² + (-2.5)² + (-1.5)² + (-0.5)² + (0.5)² + (1.5)² + (2.5)² + (3.5)²
= 12.25 + 6.25 + 2.25 + 0.25 + 0.25 + 2.25 + 6.25 + 12.25 = 42
m = 280.5 / 42 = 6.68
b = ȳ - mx̄ = 68.375 - (6.68)(5.5) = 68.375 - 36.74 = 31.635
y = 6.68x + 31.635
Slope (6.68): For every $1,000 increase in advertising, sales increase by approximately $6,680.
Y-Intercept (31.635): Base sales level when no advertising is done ($31,635).
For x = 10 (representing $10,000): y = 6.68(10) + 31.635 = 66.8 + 31.635 = 98.435
Predicted sales: $98,435
Predicted sales for $10,000 advertising: $98,435
The regression equation is y = 6.68x + 31.64, where x is advertising expenditure in $1000s and y is sales in $1000s. Each $1,000 increase in advertising is associated with a $6,680 increase in sales. For $10,000 advertising expenditure, the predicted sales are $98,435.
• Business Interpretation: Relate slope and intercept to practical business metrics
• Unit Consistency: Ensure proper interpretation of units in context
• Prediction Accuracy: Consider the range of original data when making predictions
• ROI Calculation: Use slope to estimate return on investment
Temperature (°F) (x): [70, 72, 75, 78, 80, 82, 85, 88, 90, 92, 95, 98]
Sales ($100s) (y): [2.1, 2.3, 2.5, 2.8, 3.0, 3.2, 3.5, 3.8, 4.0, 4.2, 4.5, 4.8]
Calculate the regression equation, r², and interpret the model's predictive power. Also calculate the standard error of the estimate.
Standard Error of the Estimate: A measure of the accuracy of predictions made by the regression model. It represents the standard deviation of the residuals.
Model Predictive Power: The ability of the regression model to accurately predict future observations.
x̄ = (70 + 72 + ... + 98) / 12 = 990 / 12 = 82.5°F
ȳ = (2.1 + 2.3 + ... + 4.8) / 12 = 39.7 / 12 = 3.308 ($100s)
After calculations: m = 0.063
(Detailed calculation: Σ[(xi - x̄)(yi - ȳ)] / Σ(xi - x̄)²)
b = ȳ - mx̄ = 3.308 - (0.063)(82.5) = 3.308 - 5.208 = -1.9
y = 0.063x - 1.9
After calculations: r = 0.998, r² = 0.996
This means 99.6% of the variation in sales is explained by temperature.
After calculating residuals and their squares: Standard Error = 0.056
This indicates the model typically predicts sales within ±$5.60 of actual values.
With r² = 0.996, this is an excellent model with very strong predictive power. The standard error is quite small, indicating high precision in predictions.
r² = 0.996
r² = 0.996 (99.6% explained)
Standard Error = 0.056
The regression equation is y = 0.063x - 1.9, with r² = 0.996, indicating that 99.6% of the variation in ice cream sales is explained by temperature. The standard error of 0.056 suggests highly accurate predictions. This is an excellent model with strong predictive power.
• Standard Error: Measures prediction accuracy of the model
• R-Squared Interpretation: Proportion of variance explained by the model
• Model Quality: High r² and low standard error indicate excellent model fit
• Precision Assessment: Standard error provides confidence in predictions
Line of Best Fit: The straight line that best represents the relationship between two variables in a scatterplot, minimizing the sum of squared residuals (least squares regression). This line provides the best linear approximation of the relationship between variables.
Regression Analysis: A statistical method used to examine the relationship between a dependent variable and one or more independent variables. It helps predict the value of the dependent variable based on the independent variable(s).
Slope (m): The rate of change of the dependent variable (y) for a one-unit increase in the independent variable (x). It represents the steepness of the regression line and indicates the direction and strength of the relationship.
Y-Intercept (b): The value of y when x equals zero, representing the baseline value of the dependent variable when the independent variable is absent. This is where the regression line crosses the y-axis.
Least Squares Method: A mathematical procedure that finds the line that minimizes the sum of the squares of the vertical distances (residuals) from each data point to the line. This ensures the best possible fit.
Residual: The difference between the actual observed value and the value predicted by the regression line. Residual = Observed - Predicted. Residuals help assess the accuracy of the model.
Correlation Coefficient (r): A measure of the strength and direction of the linear relationship between two variables, ranging from -1 to +1. Values closer to ±1 indicate stronger relationships.
Coefficient of Determination (r²): The proportion of variance in the dependent variable that is explained by the independent variable, ranging from 0 to 1. It indicates the goodness of fit of the regression model.
Standard Error of the Estimate: A measure of the accuracy of predictions made by the regression model. It represents the standard deviation of the residuals and indicates the typical prediction error.
- Data Collection: Gather paired observations of the explanatory and response variables
- Data Validation: Check for outliers, missing values, and data entry errors
- Descriptive Statistics: Calculate means, standard deviations, and basic summaries
- Scatterplot Creation: Visualize the relationship between variables
- Slope Calculation: Use the least squares formula to determine the rate of change
- Y-Intercept Calculation: Calculate the baseline value using means and slope
- Equation Formation: Write the regression equation in the form y = mx + b
- Model Assessment: Calculate r, r², and standard error to evaluate fit quality
- Residual Analysis: Examine residuals for patterns or systematic errors
- Prediction: Use the equation to predict y-values for given x-values
- Interpretation: Explain the practical meaning of slope and intercept in context
- Validation: Consider the model's applicability and limitations
• Regression Equation: y = mx + b
• Slope Formula: m = Σ[(xi - x̄)(yi - ȳ)] / Σ(xi - x̄)²
• Y-Intercept Formula: b = ȳ - mx̄
• Residual Formula: Residual = y_actual - y_predicted
• Correlation Formula: r = Σ[(xi - x̄)(yi - ȳ)] / √[Σ(xi - x̄)²Σ(yi - ȳ)²]
• Coefficient of Determination: r² = (correlation coefficient)²
• Standard Error: SE = √[Σ(residuals)² / (n-2)]
• Strength Interpretation: |r| > 0.8 (strong), 0.5 < |r| < 0.8 (moderate), |r| < 0.5 (weak)
• Sum of Residuals: Σ(residuals) = 0 for least squares regression
Residuals: Prediction errors
Standard Error: Average prediction accuracy
Correlation: Strength of linear relationship