Comprehensive Analysis of Simple Linear Regression for Income Prediction

Conceptual Foundations of Simple Linear Regression

Simple linear regression is a fundamental statistical method used to model and analyze the relationship between two quantitative variables. It specifically examines how a single independent variable, often denoted as XX, influences or predicts a dependent variable, denoted as YY. The term linear implies that the model assumes a straight-line relationship between the variables, while simple indicates that there is only one explanatory variable involved. In the context of the provided application, the independent variable XX represents the number of years of study after the Baccalaureate (Années d'études après le BAC), and the dependent variable YY represents the income in thousands of Moroccan Dirhams (Revenu en milliers de MAD). The primary objective of this method is to find the best-fitting line that minimizes the vertical distances (residuals) between the observed data points and the line itself, allowing researchers to estimate the effect of education on income levels and make predictions for future values.

Mathematical Specification of the Regression Model

The theoretical population model for simple linear regression is expressed by the following equation:

Yi=β0+β1Xi+ϵiY_i = \beta_0 + \beta_1 X_i + \epsilon_i

In this specification, YiY_i is the observed value of the dependent variable for the ii-th observation. The parameter β0\beta_0 is the intercept, representing the value of YY when X=0X = 0. The parameter β1\beta_1 is the slope coefficient, which measures the average change in the dependent variable YY for every one-unit increase in the independent variable XX. The term ϵi\epsilon_i represents the stochastic error or disturbance term, capturing all factors other than XX that influence YY, as well as measurement errors. For estimation purposes using a sample of size n=5n = 5, we use the estimated regression equation:

Y^i=β^0+β^1Xi\hat{Y}_i = \hat{\beta}_0 + \hat{\beta}_1 X_i

Here, Y^i\hat{Y}_i is the predicted value of the income, and the hats over the beta parameters indicate that these are estimates derived from the specific dataset provided.

Data Summary and Parameter Estimation via OLS

To estimate the parameters β^0\hat{\beta}_0 and β^1\hat{\beta}_1, we employ the Ordinary Least Squares (OLS) method, which minimizes the sum of squared residuals. Based on the provided dataset with five observations (n=5n = 5), the key mathematical components are calculated as follows:

Observations for Years of Study (XX): 2,3,5,8,122, 3, 5, 8, 12

Observations for Income (YY in thousands of MAD): 4,6,8,16,204, 6, 8, 16, 20

Sum of XX: ∑Xi=2+3+5+8+12=30\sum X_i = 2 + 3 + 5 + 8 + 12 = 30

Sum of YY: ∑Yi=4+6+8+16+20=54\sum Y_i = 4 + 6 + 8 + 16 + 20 = 54

Means: Xˉ=305=6\bar{X} = \frac{30}{5} = 6 and Yˉ=545=10.8\bar{Y} = \frac{54}{5} = 10.8

Sum of Squares and Cross-products: ∑Xi2=4+9+25+64+144=246\sum X_i^2 = 4 + 9 + 25 + 64 + 144 = 246 and ∑XiYi=(2×4)+(3×6)+(5×8)+(8×16)+(12×20)=434\sum X_i Y_i = (2 \times 4) + (3 \times 6) + (5 \times 8) + (8 \times 16) + (12 \times 20) = 434

The slope estimate β^1\hat{\beta}_1 is calculated using the formula:

β^1=∑XiYi−nXˉYˉ∑Xi2−nXˉ2=434−5(6)(10.8)246−5(62)=434−324246−180=11066≈1.6667\hat{\beta}_1 = \frac{\sum X_i Y_i - n\bar{X}\bar{Y}}{\sum X_i^2 - n\bar{X}^2} = \frac{434 - 5(6)(10.8)}{246 - 5(6^2)} = \frac{434 - 324}{246 - 180} = \frac{110}{66} \approx 1.6667

The intercept estimate β^0\hat{\beta}_0 is calculated using the formula:

β^0=Yˉ−β^1Xˉ=10.8−(1.6667×6)=10.8−10=0.8\hat{\beta}_0 = \bar{Y} - \hat{\beta}_1 \bar{X} = 10.8 - (1.6667 \times 6) = 10.8 - 10 = 0.8

The resulting estimated model is: Y^=0.8+1.6667X\hat{Y} = 0.8 + 1.6667 X.

Inference: Confidence Intervals and Hypothesis Testing

Statistical inference involves determining the reliability of the estimated coefficients. The point estimates for β0\beta_0 and β1\beta_1 are 0.80.8 and 1.66671.6667 respectively. To construct an interval estimate, we use the standard error of the coefficients and the student's tt-distribution with n−2n-2 degrees of freedom. The confidence interval is defined as:

IC=[β^j±tα/2,(n−2)×σβ^j]IC = [\hat{\beta}_j \pm t_{\alpha/2, (n-2)} \times σ_{\hat{\beta}_j}]

Hypothesis testing involves two main approaches: the Confidence Interval approach and the Significance Test (p-value/t-stat) approach. For the slope β1\beta_1, the null hypothesis is typically H0:β1=0H_0: \beta_1 = 0 (no relationship), against H1:β1≠0H_1: \beta_1 \neq 0. If the confidence interval does not contain zero, we reject the null hypothesis. Similarly, we calculate the observed t-statistic:

tobs=β^1σβ^1t_{obs} = \frac{\hat{\beta}_1}{σ_{\hat{\beta}_1}}

If ∣tobs∣>tcritical|t_{obs}| > t_{critical}, the coefficient is deemed statistically significant, meaning the number of years of study has a statistically documented impact on income.

Model Quality and The Coefficient of Determination

Evaluating the quality of the model involves measuring how well the regression line represents the data. This is primarily done using the Coefficient of Determination, denoted as R2R^2. It is defined as the proportion of the total variation in the dependent variable (YY) that is explained by the regression model (XX). The formula is:

R2=RSSTSS=1−ESSTSSR^2 = \frac{RSS}{TSS} = 1 - \frac{ESS}{TSS}

Where RSSRSS is the Regression Sum of Squares, ESSESS is the Error Sum of Squares, and TSSTSS is the Total Sum of Squares. The value of R2R^2 ranges from 00 to 11. In this application, a high R2R^2 value (expected to be near 0.950.95 given the linear trend in the data) would indicate that years of study are a very strong predictor of income variance. Interpretation: "Approximately X%X\% of the variation in employee income is explained by the number of years of post-BAC study."

Global Significance and Analysis of Variance (ANOVA)

The global significance of the model is evaluated using the Fisher test (FF-test). While in simple linear regression the FF-test is equivalent to the square of the tt-test for the slope, it is formally used to test the null hypothesis that all slope coefficients in the model are zero. The FF-statistic is calculated as:

F=RSS/kESS/(n−k−1)F = \frac{RSS/k}{ESS/(n-k-1)}

Where kk is the number of independent variables (here k=1k=1). A significant FF-statistic (where Fobs>FcriticalF_{obs} > F_{critical}) implies that the model as a whole is useful and provides a better fit than a model with no predictors. This confirms that the linear relationship captured is not merely a product of chance.

Software Analysis and Implementation

The final step in modern econometric analysis is the mobilization of software such as Microsoft Excel (Data Analysis Toolpak), SPSS, R, or Python (Statsmodels/Scikit-learn). These tools automate the calculation of residuals, standard errors, p-values, and the ANOVA table. Software allows for the generation of residual plots to verify the assumptions of the classical linear regression model (homoscedasticity, normality, and absence of autocorrelation). In a professional context, a software-generated output would provide a concise summary including the coefficients (0.80.8 and 1.66671.6667), the standard error, the t-stat, the p-values, and the R-squared value, which facilitates rapid interpretation and decision-making for 2025 financial planning or human resource analysis.