Hi, anyone knows if it is possible to add user-defined dimension+level to play to incorporate in the collect command?
suppose the following toy example:
in the case of ttest command, the Return results that are managed by the collect suite, does not include the foreign variable anywhere.
I am trying to get this:
Any clue? Thanks.
suppose the following toy example:
Code:
. webuse auto, clear (1978 automobile data) . collect: ttest price ,by(foreign ) Two-sample t test with equal variances ------------------------------------------------------------------------------ Group | Obs Mean Std. err. Std. dev. [95% conf. interval] ---------+-------------------------------------------------------------------- Domestic | 52 6072.423 429.4911 3097.104 5210.184 6934.662 Foreign | 22 6384.682 558.9942 2621.915 5222.19 7547.174 ---------+-------------------------------------------------------------------- Combined | 74 6165.257 342.8719 2949.496 5481.914 6848.6 ---------+-------------------------------------------------------------------- diff | -312.2587 754.4488 -1816.225 1191.708 ------------------------------------------------------------------------------ diff = mean(Domestic) - mean(Foreign) t = -0.4139 H0: diff = 0 Degrees of freedom = 72 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 Pr(T < t) = 0.3401 Pr(|T| > |t|) = 0.6802 Pr(T > t) = 0.6599 . collect layout () () (result[mean]), name(default) Collection: default Tables: result[mean] Table 1: 1 x 1 -------- 6165.257 --------
I am trying to get this:
Code:
foreign: 6165.257
Any clue? Thanks.
Comment