I have a loop command to run multiple ttests on my variables
foreach var of varlist var1 var2 var3 var4 var5 var6 var7 var8 var9 {
ttest `var', by (group)
}
I would like to get a custom table that looks like this after I output
I used the code below but it is not producing a table.
collect style cell group1[mu_1] group2[mu_2] Difference[p], nformat(%5.2f)
foreach var of varlist var1 var2 var3 var4 var5 var6 var7 var8 var9 {
ttest `var', by (group)
}
I would like to get a custom table that looks like this after I output
Group1 Mean (SD) |
Group2 Mean (SD) |
P | |
VAR1 | 2.31 (1.51) | 2.73 (1.83) | 0.075 |
VAR2 | |||
VAR3 | |||
VAR4 | |||
VAR5 | |||
VAR6 | |||
VAR7 |
I used the code below but it is not producing a table.
collect style cell group1[mu_1] group2[mu_2] Difference[p], nformat(%5.2f)
Comment