-
Linear Regression – Assumption – 6 (How To Detect & Avoid Endogeneity ?)
-
Linear Regression – Assumption – 5 (How To Detect & Avoid Autocorrelation In Regression ?)
How To Detect & Avoid Autocorrelation In Regression ? Table Of Contents: Methods To Detect Autocorrelation In Error Term? Methods To Avoid The Autocorrelation In Error Term. (1) Methods To Detect Autocorrelation In Error Term? Residual Plot (vs. time or observation order) Durbin-Watson Test Autocorrelation Function (ACF) Plot Ljung-Box Test (for multiple lags) (1.1) Residual Plot To Detect Autocorrelation In Error Term? import numpy as np import pandas as pd import matplotlib.pyplot as plt import statsmodels.api as sm # Simulate ordered data (e.g., time series) np.random.seed(42) n = 100 advertising = np.random.normal(1000, 200, n) # Introduce autocorrelation in error terms
-
Linear Regression – Assumption – 3(How To Detect & Avoid Non Normal Distribution Of Error Term ?)
-

Linear Regression – Assumption – 2 (How To Detect & Avoid Multicollinearity ?)
Linear Regression – Assumption- 2 (How To Detect & Avoid Multicollinearity ?) Table Of Contents: How To Detect Multicollinearity In The Dataset ? Correlation Matrix. Variance Inflection Factor Model Behavior Observation. How To Avoid Multicollinearity In The Dataset ? Remove One of the Correlated Variables Use Principal Component Analysis (PCA) Use Regularization Techniques (Ridge/Lasso) (1) How To Detect Multicollinearity In The Dataset? Method – 1: Correlation Matrix (Pearson correlation) We will use Pearson ‘r’ Correlation Coefficient to find the correlation between two variable. import seaborn as sns import matplotlib.pyplot as plt # Load dataset tips = sns.load_dataset("tips") # Compute the
-
Linear Regression – Assumption -2 (No Multicollinearity)
-

Linear Regression – Assumption- 1 (Linear Relationship)
Linear Regression – Assumption- 1 (Linear Relationship) Table Of Contents: What Is Linear Relationship Assumption ? Why Linear Regression Assumption Is Important ? How To Check Linearity Between Dependent & Independent Variable ? How The Residuals Can Say About The Linearity ? What To Do If You Have Non Linearity Present In The Data ? (1) What Is Linear Relationship Assumption ? (2) What Is Linear Relationship Assumption Important ? (3) How To Check Linearity Between Dependent & Independent Variable ? (1) Using Scatter Plot import seaborn as sns import matplotlib.pyplot as plt # Load a real dataset tips =
