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
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
Comment