Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • table of mean std and p value

    I have been trying to create a table reporting the mean and std per group and the p-value of the difference. I am new to Stata I used the below code copied from stata documentation and it gives an error. Anyone willing to help out. Thanks in advance.


    ttest ln_asset, by(BC)
    ttest debt_to_asset, by(BC)
    ttest three_year_CAGR, by(BC)
    ttest stock_vol, by(BC)
    ttest cf_vol, by(BC)
    ttest ln_cash, by(BC)

    table, (command) (result),command(NoBC=r(P1) BC=r(P2) Difference=r(P_diff) r(p):ttest ln_asset, by(BC))command(NoBC=r(P1) BC=r(P2) Difference=r(P_diff) r(p):ttest debt_to_asset, by(BC)) command(NoBC=r(P1) BC=r(P2) Difference=r(P_diff) r(p):
    ttest three_year_CAGR, by(BC)) command(NoBC=r(P1) BC=r(P2) Difference=r(P_diff) r(p):ttest stock_vol, by(BC)) command(NoBC=r(P1) BC=r(P2) Difference=r(P_diff) r(p):ttest ln_cash, by(BC))nformat(%5.3f) style(table-right)

    the error says command varlist required. But according to the documentation it should work. I am using stata 16



  • #2
    the way you want to use -table- was introduced in version 17 so that will not work in your version; I'm not sure I completely understand what you want, but I think you will need to rely on one of the user-written commands such as the -esttab- suite; I have never used any of these but many have been discussed here on Statalist so a search should help

    Comment

    Working...
    X