From | Michel Camus <[email protected]> |
To | [email protected] |
Subject | Re: st: Re: specifying difference in H0 of ttest |
Date | Sun, 18 Jan 2004 23:06:25 -0500 |
Kristen, I simulated data with characteristics roughly similar as those of your own data. Christopher's solution does work. It seems to me less awkward to explain to your readership than the subtraction done by Richard, although Richard's approach seems also valid to me (I'm not a statistician, mind you.). The results between the regression with robust s.e. and the ttest with unequal variance are similar if the Welch option is used for the ttest ! ---------------------- Here are my results : *** The following table shows the mean and sd for the 2 groups, with a test of equal variance. *** . sdtest concentration, by( group ) Variance ratio test ------------------------------------------------------------------------------ Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- 1 | 10 14.47888 1.379478 4.362292 11.35828 17.59947 2 | 15 24.89638 2.500073 9.68274 19.53425 30.2585 ---------+-------------------------------------------------------------------- combined | 25 20.72938 1.886349 9.431746 16.83614 24.62261 ------------------------------------------------------------------------------ Ho: sd(1) = sd(2) F(9,14) observed = F_obs = 0.203 F(9,14) lower tail = F_L = F_obs = 0.203 F(9,14) upper tail = F_U = 1/F_obs = 4.927 Ha: sd(1) < sd(2) Ha: sd(1) != sd(2) Ha: sd(1) > sd(2) P < F_obs = 0.0106 P < F_L + P > F_U = 0.0147 P > F_obs = 0.9894 ========= *** Doing with "regress , robust" ... *** . regress concentration group , robust Regression with robust standard errors Number of obs = 25 F( 1, 23) = 13.23 Prob > F = 0.0014 R-squared = 0.3050 Root MSE = 8.0321 ------------------------------------------------------------------------------ | Robust concentrat~n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- group | 10.4175 2.864007 3.64 0.001 4.492845 16.34215 _cons | 4.061383 3.713127 1.09 0.285 -3.619805 11.74257 ------------------------------------------------------------------------------ . *** Now, testing Ho = 3 ... *** . test group=3 ( 1) group = 3 F( 1, 23) = 6.71 Prob > F = 0.0164 ** ... doing it with a "ttest with unequal variance using Welch's statistic" AFTER subtracting 3 from the group with the highest mean. *** . ttest concen3b , by(group) unequal welch Two-sample t test with unequal variances ------------------------------------------------------------------------------ Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- 1 | 10 14.47888 1.379478 4.362292 11.35828 17.59947 2 | 15 21.89638 2.500073 9.68274 16.53425 27.2585 ---------+-------------------------------------------------------------------- combined | 25 18.92938 1.738753 8.693767 15.34077 22.51799 ---------+-------------------------------------------------------------------- diff | -7.417496 2.855402 -13.33938 -1.495614 ------------------------------------------------------------------------------ Welch's degrees of freedom: 21.991 Ho: mean(1) - mean(2) = diff = 0 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 t = -2.5977 t = -2.5977 t = -2.5977 P < t = 0.0082 P > |t| = 0.0164 P > t = 0.9918 The P value is 0.0164 using either the regress/robust (test group=3) or the ttest (minus-3)/unequal/Welch procedure. Cheers. Michel Camus, epidemiologist, Health Canada ========================================================== Wandland, Kristen wrote: At 11:28 AM 1/15/2004 -0500, Wandland, Kristen wrote:
--
*
* 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/
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Michel Camus, Ph.D. Épidémiologue, Div. Biostatistique et épidémiologie, DGSESC, Santé Canada Epidemiologist, Biostatistics and Epidemiology Div., HECSB, Health Canada Courriel / e-mail : [email protected] Téléphone / phone : (514) 850-0157 Télécopieur / fax : (514) 850-0836 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ |
© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |