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

Re: st: specifying difference in Ho of ttest


From   Michel Camus <[email protected]>
To   [email protected]
Subject   Re: st: specifying difference in Ho of ttest
Date   Wed, 14 Jan 2004 23:01:39 -0500

Richard Williams wrote:

At 06:15 PM 1/14/2004 -0600, Scott Merryman wrote:

Isn't this just calculating the difference and then using -ttest diff = #-
Example:
. sysuse auto
(1978 Automobile Data)
. gen diff = disp - length
. ttest diff = 10
That should work, and is more straightforward than what I tossed out before. A matched pairs problem can be converted into a single sample t-test problem in this way.

One thing that occurs to me: Scott and I both interpreted this as a matched pairs problem. But, if the original author meant "diff" to stand for the difference between 2 group means (i.e. an independent samples t-test) rather than the difference between the means of two variables (matched pairs) then neither Scott's nor my approach is right. So, if you hypothesized that group 1's mean was 10 points higher than group 2's, you'd do something like gen score2 = score
replace score2 = score2-10 if group==1
ttest score2, by(group)
-------------------------------------------
Richard Williams, Associate Professor
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: [email protected]
WWW (personal): http://www.nd.edu/~rwilliam
WWW (department): http://www.nd.edu/~soc
=============================================
I am not sure that I get the issue correctly, having missed the original thread.
However, if a t-test were appropriate and if the samples are independent, would not a linear regression of the continuous variable against the group variable, followed by testing the parameter estimated for the group variable address the issue in a more straightforward way?
Ex. : suppose you want to test if the difference if significantly different from 10 between two groups.
. regress continuous dichotomous
. test dichotomous = 10
Michel

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

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] <mailto:[email protected]>

T�l�phone / phone : (514) 850-0157

T�l�copieur / fax : (514) 850-0836

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~




*
* 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index