0
votes

I´m trying to print my CI with esttab in this order:

enter image description here

My code with the cars.csv dataset form https://gist.github.com/noamross/e5d3e859aa0c794be10b#file-cars-csv:

clear all
import excel "C:\Users\luism\Desktop\archive/cars_usa.xlsx", sheet("hoja1") firstrow

destring mileage, force replace

reg price mileage
estimates store model_1

esttab model_1 using "C:\Users\luism\Desktop\archive/results.csv", replace beta ci
    

This is what I got when I separate by commas the results.csv file.

enter image description here

I would like to print the upper bound below the lower bound, not next to after I separate by commas the results.csv. Thanks

1
I'm pretty sure esttab or estout doesn't have that option. You might have to code this yourself by taking the results from r(table) and writing it to an Excel file with putexcel.Wouter
You might be able to add the CI UB and LB as two separate auxiliary statistics, like N.dimitriy

1 Answers

2
votes

estadd allows you to add anything as a scalar and include it as follows:

sysuse auto , clear
reg price mpg 
matrix results = r(table)
estadd scalar upperCI = results[rownumb(results,"ul"),colnumb(results,"mpg")]
estadd scalar lowerCI = results[rownumb(results,"ll"),colnumb(results,"mpg")]
esttab, stats(lowerCI upperCI)

This is exactly what Dimitry was suggesting in his comment. Wouter's comment is true to the extent that this isn't, strictly speaking, an "option" of esttab or estout. However, estadd provides a large amount of flexibility to esttab and it's worth knowing about.