ECON 3209 · Week 8, Lecture 3 · Kerala Agricultural University
Autumn 2026
statsmodels and compare results.\[\hat{\beta} = (X'X)^{-1}X'Y\]
fertilizer.statsmodels.formula.api lets us write models in a readable formula style.statsmodels helps practical analysis.statsmodels estimates up to rounding.statsmodels output becomes easier to interpret when you know the mechanics.Generate 20 observations for income and repayment_rate. Compute the OLS coefficients manually using \(\hat{\beta} = (X'X)^{-1}X'Y\), then fit the same model with statsmodels and compare the two slopes.
statsmodels reproduces the same coefficient estimates.ECON 3209 — Kerala Agricultural University