Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: -ttest- (repost)


From   "Cleves, Mario A" <ClevesMarioA@uams.edu>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: -ttest- (repost)
Date   Thu, 26 Sep 2002 20:25:31 -0500

Constantine Daskalakis <constantine.daskalakis@mail.tju.edu> asked:

	> It seems that the default -ttest- (equal variances assumption) and the 
	> -ttest- with the option 'unequal' give the same test statistic. It appears 
	> that the first one is in error (ie, does not use the pooled estimator). Can 
	> someone confirm?

Not true. Here is an example using the auto data.

. use "C:\Stata\auto.dta", clear
(1978 Automobile Data)

. 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
------------------------------------------------------------------------------
Degrees of freedom: 72

                Ho: mean(Domestic) - mean(Foreign) = diff = 0

     Ha: diff < 0               Ha: diff ~= 0              Ha: diff > 0
       t =  -0.4139                t =  -0.4139              t =  -0.4139
   P < t =   0.3401          P > |t| =   0.6802          P > t =   0.6599

. ttest  price,by( foreign) unequal

Two-sample t test with unequal 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    704.9376               -1730.856    1106.339
------------------------------------------------------------------------------
Satterthwaite's degrees of freedom:  46.4471

                Ho: mean(Domestic) - mean(Foreign) = diff = 0

     Ha: diff < 0               Ha: diff ~= 0              Ha: diff > 0
       t =  -0.4430                t =  -0.4430              t =  -0.4430
   P < t =   0.3299          P > |t| =   0.6599          P > t =   0.6701

Regards,
Mario.
-------------------------------------------------------------------------------------------------------------
Mario A. Cleves, Ph.D.
Associate Professor and Senior Biostatistician
UAMS, Department of Pediatrics
Arkansas Center for Birth Defects Research and Prevention
11219 Financial Centre Parkway, Suite 250
Little Rock, AR  72211
Telephone: 501-320-5001
Fax: 501-320-5107
Email: ClevesMarioA@uams.edu
-------------------------------------------------------------------------------------------------------------



> -----Original Message-----
> From:	Constantine Daskalakis [SMTP:constantine.daskalakis@mail.tju.edu]
> Sent:	Thursday, September 26, 2002 7:13 PM
> To:	statalist@hsphsun2.harvard.edu
> Cc:	Constantine Daskalakis
> Subject:	st: -ttest- (repost)
> 
> I am not sure whether my previous message on -ttest- got posted or not (did 
> not receive any replies on what seemed a simple comment)...
> 
> It seems that the default -ttest- (equal variances assumption) and the > 
> -ttest- with the option 'unequal' give the same test statistic. It appears > 
> that the first one is in error (ie, does not use the pooled estimator). Can 
> someone confirm?
> 
> (the -ttesti- seems to be fine)
> 
> Thanks,
> cd
> 
> 
> ________________________________________________________________
> 
> Constantine Daskalakis, ScD
> Assistant Professor,
> Biostatistics Section, Thomas Jefferson University,
> 125 S. 9th St. #402, Philadelphia, PA 19107
>     Tel: 215-955-5695
>     Fax: 215-503-3804
>     Email: constantine.daskalakis@mail.tju.edu
>     Webpage: http://www.kcc.tju.edu/Science/SharedFacilities/Biostatistics
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index