Module 12: Multiple Regression Analysis

Supporting Lectures:

EGN3443 Module 12 - Multiple Regression Analysis

1. Multiple Regression Models

Definition

Multiple regression is a statistical technique that uses multiple independent variables to predict a single dependent variable. It extends simple linear regression by allowing more than one predictor variable in the model.

Key Characteristics

General Model Equation

Y = β₀ + β₁X₁ + β₂X₂ + ... + βₖXₖ + ε

Where:

Example Scenario

Predicting house prices based on:

Web References

2. Parameter Estimation and Interpretation

Estimation Methods

  1. Ordinary Least Squares (OLS): Most common method

Coefficient Interpretation

Example Calculation

# Hypothetical house price prediction model

# Y = Price

# X1 = Square footage

# X2 = Number of bedrooms

# Estimated coefficients

β₀ (Intercept) = 50,000

β₁ (Square footage) = 200

β₂ (Number of bedrooms) = 15,000

# Prediction equation

Price = 50,000 + 200(Square Footage) + 15,000(Number of Bedrooms)

# Example calculation

Price = 50,000 + 200(2000) + 15,000(3)

       = 50,000 + 400,000 + 45,000

       = $495,000

Hypothesis Testing

Web References

3. Model Selection Techniques

Common Techniques

  1. Forward Selection

  2. Backward Elimination

  3. Stepwise Regression

Evaluation Metrics

Python Example

from sklearn.feature_selection import f_regression

from sklearn.linear_model import LinearRegression

# Perform feature selection

F_scores, p_values = f_regression(X, y)

# Select top predictors based on F-scores

Web References

4. Multicollinearity

Definition

Multicollinearity occurs when independent variables are highly correlated with each other.

Detection Methods

  1. Variance Inflation Factor (VIF)

VIF Calculation

from statsmodels.stats.outliers_influence import variance_inflation_factor

# Calculate VIF for each predictor

vif_data = pd.DataFrame()

vif_data["Variable"] = X.columns

vif_data["VIF"] = [variance_inflation_factor(X.values, i) for i in range(X.shape[1])]

Interpretation

Web References

5. Polynomial Regression

Definition

Polynomial regression fits a nonlinear relationship between variables using polynomial equations.

General Model

Y = β₀ + β₁X + β₂X² + β₃X³ + ... + ε

Example

from sklearn.preprocessing import PolynomialFeatures

from sklearn.linear_model import LinearRegression

# Create polynomial features

poly = PolynomialFeatures(degree=2)

X_poly = poly.fit_transform(X)

# Fit regression model

model = LinearRegression()

model.fit(X_poly, y)

Use Cases

Cautions

Web References

Recommended Learning Resources

  1. Textbooks:

  2. Online Courses: