Hi All,
I am want to compare mean of a variable by subcategorizing them into more than two groups. From the following Example
I can get two sample t test with equal variances as follow:
I was able to get following output
Two-sample t test with equal variances ------------------------------------------------------------------------------ Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- male | 91 50.12088 1.080274 10.30516 47.97473 52.26703 female | 109 54.99083 .7790686 8.133715 53.44658 56.53507 ---------+-------------------------------------------------------------------- combined | 200 52.775 .6702372 9.478586 51.45332 54.09668 ---------+-------------------------------------------------------------------- diff | -4.869947 1.304191 -7.441835 -2.298059 ------------------------------------------------------------------------------ diff = mean(male) - mean(female) t = -3.7341 Ho: diff = 0 degrees of freedom = 198 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 Pr(T < t) = 0.0001 Pr(|T| > |t|) = 0.0002 Pr(T > t) = 0.9999 but in the same example I have a group ses (social economic status)
offcourse if i write following command
It wont work as ses has more than two category high middle low and stata is giving the same message
. ttest write, by(ses)
more than 2 groups found, only 2 allowed
.
What I want to know the name of test or command which do the above output for more than two group. .i.e. t test for ses in the given example.
Regards and Stay Blessed
Muhammad Mubeen
I am want to compare mean of a variable by subcategorizing them into more than two groups. From the following Example
Code:
use http://www.ats.ucla.edu/stat/stata/notes/hsb2, clear
Code:
ttest write, by(female)
Two-sample t test with equal variances ------------------------------------------------------------------------------ Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- male | 91 50.12088 1.080274 10.30516 47.97473 52.26703 female | 109 54.99083 .7790686 8.133715 53.44658 56.53507 ---------+-------------------------------------------------------------------- combined | 200 52.775 .6702372 9.478586 51.45332 54.09668 ---------+-------------------------------------------------------------------- diff | -4.869947 1.304191 -7.441835 -2.298059 ------------------------------------------------------------------------------ diff = mean(male) - mean(female) t = -3.7341 Ho: diff = 0 degrees of freedom = 198 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 Pr(T < t) = 0.0001 Pr(|T| > |t|) = 0.0002 Pr(T > t) = 0.9999 but in the same example I have a group ses (social economic status)
offcourse if i write following command
Code:
ttest write, by(ses)
. ttest write, by(ses)
more than 2 groups found, only 2 allowed
.
What I want to know the name of test or command which do the above output for more than two group. .i.e. t test for ses in the given example.
Regards and Stay Blessed
Muhammad Mubeen
Comment