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   Richard Williams <[email protected]>
To   [email protected]
Subject   Re: st: specifying difference in Ho of ttest
Date   Thu, 15 Jan 2004 10:37:54 -0500

At 11:01 PM 1/14/2004 -0500, Michel Camus wrote:
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
Yet another more straightforward solution than I initially proposed; about the only downside I see would be if you wanted to specify unequal variances on the t-test. With yours and Kit's and Scott's solutions, the trick is to take the original problem, which is awkward to address with a matched pairs or independent samples t-test, and recast it into an equivalent problem where it is easy to test the desired constraints. It might be nice if some future version of the t-test command let you specify differences other than 0.

Kit mentions Anova may be able to do this too. Yes, it would; commands equivalent to what you have above are

. anova continuous dichotomy
. test _b[dichotomy[1]]=-10

In the case of Kit's example, the corresponding Anova commands would be

. anova price foreign
. test _b[ foreign[1]] = -200

The sign reversal is necessary because Anova, in effect, reverses the coding of a 0-1 dichotomy. I find this syntax more awkward than the corresponding regression command, but it works fine.


-------------------------------------------
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

*
* 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