Regression Analysis Simple Regression
Regression Analysis Simple Regression
Key Terms:
Dependent Variable (Y): The variable we want to predict.
Independent Variable (X): The variable(s) used to make the prediction.
Intercept (a): Value of Y when X = 0.
Coefficient (b): Measures the change in Y for a one-unit change in X.
Residual/Error (ε): Difference between actual and predicted values.
Applications:
Forecasting sales, prices, or trends.
Risk analysis in finance.
Estimating real estate values.
Understanding consumer behavior.
QUESTION: Using simple linear regression, predict the exam score if a student
studies for 7 hours.
Solution Steps:
Solution for the give problem
Table with Summation Row
Final Answer:
If a student studies for 7 hours, the predicted exam score is 81.75.
Interpretation:
Slope (3.75): For each additional hour studied, the exam score
is expected to increase by 3.75 points.
df = pd.DataFrame(data)
#Output
#Plotting
import matplotlib.pyplot as plt
import numpy as np
#Output