Hi everyone, I am new to the forum and hoping to get some help on storing regression results.
I would like to store the regression coefficients and standard errors (_b and _se) from regressing multiple y variables on the same x variable.
For example, after generating 5 lags for the variable "change" named L1 - L5:
I would like to regress each lag on the same variable, and store the 5 b's and 5 se's (so that b1 is from "reg L1 volume", b2 is from "reg L2 volume" and so on).
I've looked into -statsby- and generating b=. and then replacing it as suggested here and here, but can't quite apply them to what I am trying to do. Any thoughts or suggestions are greatly appreciated!
I would like to store the regression coefficients and standard errors (_b and _se) from regressing multiple y variables on the same x variable.
For example, after generating 5 lags for the variable "change" named L1 - L5:
Code:
sysuse sp500, clear foreach t of numlist 1/5 { gen L`t' = change[_n-`t'] }
Code:
foreach t of numlist 1/5 { reg L`t' volume }
Comment