I want to build a standard Latex Asset Pricing table in Stata. Each 2 rows contain information about one trading strategy. And the columns are average returns, sharpe ratio, CAPM alpha and Fama-French 3 factor alpha. The first two are summary statistics, the last two are regression coefficients that come with standard errors. I want the standard error in parenthesis and placed under the corresponding coefficient estimate. The Stata script should write a .tex file that contains something a table fragment like this:
```
portfolio1 & 0.01 & 1.00 & 0.01 & 0.01 \\
& & & (0.01) & (0.01) \\
portfolio2 & 0.01 & 1.00 & 0.01 & 0.01 \\
& & & (0.01) & (0.01) \\
```
I can add the missing Latex header/footer later in my Latex file.
As a starting point, here is a working example for regression estimates only:
```
sysuse auto, clear
eststo clear
eststo: reg price mpg, nocons
eststo: reg trunk mpg, nocons
esttab using "test.tex", ///
fragment noobs nomtitles nonumbers nowrap booktabs nogaps nolines ///
style(tex) replace collabels(none) ///
cells(b(star fmt(%9.2f)) se(par)) compress
eststo clear
eststo: reg price mpg, nocons
eststo: reg trunk mpg, nocons
esttab using "test.tex", ///
fragment noobs nomtitles nonumbers nowrap booktabs nogaps nolines ///
style(tex) append collabels(none) ///
cells(b(star fmt(%9.2f)) se(par)) compress
```
This essentially gives me the alpha columns, but not the average return/sharpe ratio columns. In the working example, any idea on how to add, say the mean of "price" and the mean of "trunk" in separate columns?
Thank you!
(I posted this on stack exchange but got shut down with no answer for being of topic.)
```
portfolio1 & 0.01 & 1.00 & 0.01 & 0.01 \\
& & & (0.01) & (0.01) \\
portfolio2 & 0.01 & 1.00 & 0.01 & 0.01 \\
& & & (0.01) & (0.01) \\
```
I can add the missing Latex header/footer later in my Latex file.
As a starting point, here is a working example for regression estimates only:
```
sysuse auto, clear
eststo clear
eststo: reg price mpg, nocons
eststo: reg trunk mpg, nocons
esttab using "test.tex", ///
fragment noobs nomtitles nonumbers nowrap booktabs nogaps nolines ///
style(tex) replace collabels(none) ///
cells(b(star fmt(%9.2f)) se(par)) compress
eststo clear
eststo: reg price mpg, nocons
eststo: reg trunk mpg, nocons
esttab using "test.tex", ///
fragment noobs nomtitles nonumbers nowrap booktabs nogaps nolines ///
style(tex) append collabels(none) ///
cells(b(star fmt(%9.2f)) se(par)) compress
```
This essentially gives me the alpha columns, but not the average return/sharpe ratio columns. In the working example, any idea on how to add, say the mean of "price" and the mean of "trunk" in separate columns?
Thank you!
(I posted this on stack exchange but got shut down with no answer for being of topic.)
Comment