I'm trying to get information from OLS results after for loop regression.
For example,
depvars = ['y1', 'y2', 'y3', ...]
models = [ "~ x1 + x2", "~ x1 + x2 + x3", ...]
results = []
for depvar in depvars:
for model in models:
results.append(smf.glm(formula = depvar + model, data= data).fit())
I can get information such as estimates, p-value by results[0].params, results[0].pvalues.
But I also want to get the name of the dependent variable (y1, y2, ...) used in each regression so that I can tell which parameters are for which variable.
For instance, if I run results[0].depvar then I get y1 .
Thank you! :)