my dataset consists of the following variables: id (fund id), date (year month), hret (historical return), nstocks (number of stocks) and top_bottom. top_bottom groups the funds into the top 20% and bottom 20% regarding their hret for each observed date.
Now I want to create a table showing the mean regarding hret and nstocks for "top" and "bottom". Furthermore, I also want to see if the difference between both groups is statistically significant (at 10%, 5% and 1% level). However, I could not fully figure out how to do that.
For now my code looks like this. I figured this is best done by using -estpost- and -esttab-. The table's first column displays the mean for the "top" group (mu_2), the second column the mean for the "bottom" group (mu_1) and the third column displays the difference (b). Column four shows the t-statistic (t).
Code:
estpost ttest hret nstocks, by(top_bottom) esttab, cells("mu_2 mu_1 b t")
Does anyone know how to solve that problem?
Thank you very much for your help!
0 Response to Creating a table using -estpost- and -esttab-
Post a Comment