Hi

I want to construct a loop that extracts the slope coefficients on two explanatory variables from regressions of increasing horizons. Subsequently, I want to plot these coefficients.

For example:

my first regression is :
reg f.firm_profit firm_sale firm_expense, vce(cluster firm)
the second will be :
reg f2.firm_profit firm_sale firm_expense, vce(cluster firm)
The third will be:
reg F3.firm_profit firm_sale firm_expense, vce(cluster firm)

....and so on for up to F30 (30 forecast horizons)

I need the slope coefficients on firm_sale and firm_expense from each regression and then plot these (the Y axis represents the slope coeffcient values and the X axis represents the horizon)

Can anyone please help me to construct this loop and plot the coefficients?

Thank you so much