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]

R: T test: Manually vs. with Stata


From   "Carlo Lazzaro" <[email protected]>
To   <[email protected]>
Subject   R: T test: Manually vs. with Stata
Date   Tue, 29 Mar 2011 15:04:56 +0200

Dear Jen,

- ttest A == B, unpaired unequal - gives back what you calculated manually
(t = -19.1337), whereas -ttest A == B, unpaired gives back t = -20.4249.

The difference stays in the degrees of freedom calculated with the two
approaches (unequal and equal variances, respectively).

It's probably up to you to choose which ttest procedures is consistent with
your research.

Kindest Regards,
Carlo

-----Messaggio originale-----
Da: [email protected]
[mailto:[email protected]] Per conto di Jen Zhen
Inviato: martedì 29 marzo 2011 14.42
A: [email protected]
Oggetto: T test: Manually vs. with Stata

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