Hello,

I recently learned how to use -esttab- to export my regression output in csv format but I cannot figure out to how to get the csv output to contain variable names. In the attached example output (csv output attached), I can see only variable labels but not the variable names. Can someone please advise how to get the variable names to show in the csv output?

Currently, the csv/excel output looks like this:
Table 1. Odds ratios
Model 1
birthweight<2500g
age of mother 0.966 (0.0323)
white 1 (.)
black 2.749* (1.357)
other 2.877** (1.168)
smoked during pregnancy 3.006** (1.118)

I want the csv/excel output to show variable names like this:
low
birthweight<2500g
age
age of mother 0.966 (0.0323)
race
white 1 (.)
black 2.749* (1.357)
other 2.877** (1.168)
smoke
smoked during pregnancy 3.006** (1.118)

My current Stata code is:

* data
webuse lbw // opening data

* logit
logit low age i.race smoke, or // regression
estimates store M1 // store output


* export
esttab M1 using esttab_test.csv, eform se ///
replace label wide ///
title(Table 1. Odds ratios) /// table title
nonumber mtitles("Model 1") /// labels for columns
addnotes("Source: lbw") // note at bottom of table


Thank you in advance for your time!