I am running several sets of regressions (100plus sets of 64 regressions) that need to be displayed in a table so that the models are in rows rather than columns. While I am able to do this using esttab, I am not able to write the table produced by esttab to any external files using the customary "using" command. My full code is below. I receive an error matrix r(coefs) not found) when I run the line esttab r(coefs, transpose) using filename,replace. There is no error if I do not use "using".
Is there a conflict between calling the coefficients from Stata and also writing to an external file ? If esttab is not the correct approach, I would be grateful for some advice pointing me in the right direction.
sysuse auto,clear
eststo clear //Clear previously stored regressions.
levelsof rep78, local(levelrep78)
di "`levelsrep78'"
foreach l of local levelrep78 {
di "rep78: `l'"
capture noisily eststo Route`l': reg p turn head if rep78==`l'
}
esttab using r, p scalars(F df_m df_r) keep( turn ) replace
mat list r(coefs)
esttab r(coefs, transpose) using filename,replace //Final Table
matrix r(coefs) not found
Best,
Claudia
Is there a conflict between calling the coefficients from Stata and also writing to an external file ? If esttab is not the correct approach, I would be grateful for some advice pointing me in the right direction.
sysuse auto,clear
eststo clear //Clear previously stored regressions.
levelsof rep78, local(levelrep78)
di "`levelsrep78'"
foreach l of local levelrep78 {
di "rep78: `l'"
capture noisily eststo Route`l': reg p turn head if rep78==`l'
}
esttab using r, p scalars(F df_m df_r) keep( turn ) replace
mat list r(coefs)
esttab r(coefs, transpose) using filename,replace //Final Table
matrix r(coefs) not found
Best,
Claudia
Comment