Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: T test: Manually vs. with Stata


From   Phil Clayton <[email protected]>
To   [email protected]
Subject   Re: T test: Manually vs. with Stata
Date   Tue, 29 Mar 2011 23:56:29 +1100

If you tell Stata to perform the test with unequal variances its answer will match yours. It defaults to assuming equal variances. See the manual entry for -ttest-

Phil

On 29/03/2011, at 11:42 PM, Jen Zhen wrote:

> Dear list members,
> 
> I have a question that makes me feel very stupid, yet is troubling me:
> 
> I would like to compute the T-statistic to test that there is no
> difference in variable between groups G1 and G2.
> The respective summary statistics are:
> 
> G1: Mean1=16.59, SD1=1.05, N1= 330
> G2: Mean2=18.82, SD2=1.26, N2=155.
> 
> Manually I would use these to compute SE1=SD1/sqrt(N1)=0.057800598,
> SE2=SD2/sqrt(N2)=0.101205635, SE_pooled=sqrt(SE1^2+SE2^2)=0.116548229,
> and then T=(Mean1-Mean2)/SE_pooled=-19.13370984.
> 
> However, when I use Stata's -ttest-, I get T=20.4468. I suspect that
> Stata is correct on this and that it does some degrees of freedom
> correction, which I'm missing when doing this manually, but I'm not
> sure where I'm going astray. Would anyone happen to know?
> 
> Thanks a lot,
> JZ
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index