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

st: Re: specifying difference in H0 of ttest


From   Christopher F Baum <[email protected]>
To   [email protected]
Subject   st: Re: specifying difference in H0 of ttest
Date   Thu, 15 Jan 2004 06:57:49 -0500

On Jan 15, 2004, at 2:33 AM, Kristen wrote:

Does anyone know a way to specify the difference in a ttest? The default
result is:

Ho = diff = 0

I hope to be able to do:

Ho = diff = #

where # is the standard deviation or other pre-determined value.
. reg price foreign

Source | SS df MS Number of obs = 74
-------------+------------------------------ F( 1, 72) = 0.17
Model | 1507382.66 1 1507382.66 Prob > F = 0.6802
Residual | 633558013 72 8799416.85 R-squared = 0.0024
-------------+------------------------------ Adj R-squared = -0.0115
Total | 635065396 73 8699525.97 Root MSE = 2966.4

------------------------------------------------------------------------ ------
price | Coef. Std. Err. t P>|t| [95% Conf. Interval]
------------- +----------------------------------------------------------------
foreign | 312.2587 754.4488 0.41 0.680 -1191.708 1816.225
_cons | 6072.423 411.363 14.76 0.000 5252.386 6892.46
------------------------------------------------------------------------ ------

. test foreign=200

( 1) foreign = 200

F( 1, 72) = 0.02
Prob > F = 0.8821

This does the same thing as ttest price, by(foreign), but allows you to specify your own value for the difference. The null for the ttest is that foreign=0. I imagine it could also be done with anova and test, but don't see how the "second syntax" in help testanova is supposed to work.

Kit

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