regress is Stata's OLS command. The output table is one of the cleanest in any statistical software, and the ecosystem of post-estimation commands (predict, test, lincom, margins) turns a single regression into a structured analytical product.
regress
regress lending_rate deposit_rateregress lending_rate deposit_rate i.year // with year fixed effectsregress lending_rate c.deposit_rate##i.year // interactions
Robust standard errors
regress lending_rate deposit_rate, robust // HC3regress lending_rate deposit_rate, vce(cluster bank_id) // clusteredregress lending_rate deposit_rate, vce(robust) cluster(bank_id) // both
Reading the output
- Source / SS / df / MS — the ANOVA decomposition
- Number of obs — sample size
- F(p, n-p-1) — joint test of all coefficients = 0
- R-squared — fraction of variance explained
- Root MSE — sqrt of mean squared error
- Coef. / Std. Err. / t / P>|t| / [95% CI] — per coefficient
Post-estimation: predict, test, lincom
regress lending_rate deposit_rate i.yearpredict yhat // fitted valuespredict residual, residuals // residualspredict se, stdp // standard error of fitted valuetest deposit_rate // test single coefficienttest 2024.year = 2023.year // test equalitylincom deposit_rate + 2024.year // linear combination with SE
store and esttab — publication tables
regress lending_rate deposit_rateestimates store m1regress lending_rate deposit_rate i.yearestimates store m2estout m1 m2, cells(b(star fmt(3)) se(par fmt(3))) ///stats(N r2 r2_a, fmt(0 3 3))
regress is one line. The post-estimation is the analysis.
Anyone can run a regression. The discipline of an applied econometrician shows in what they do next: testing constraints, computing margins, comparing specifications, presenting tables. That's where Stata earns its keep.
Exercise
Run a regression of lending_rate on deposit_rate with robust standard errors.