Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: difference between -test- and -contrast- in Statat 12
From
Ricardo Ovaldia <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: difference between -test- and -contrast- in Statat 12
Date
Thu, 25 Aug 2011 19:15:13 -0700 (PDT)
I am using the new -contrast- command in Stata 12 to test a contrast after ANOVA and I get different p-values than when using -test- although the marginal means are the same.
I illustrate with the auto data by first making the rep78 variable a 3 level variable and then running an ANOVA follow by -contrast-:
. sysuse auto,clear
. replace rep78=3 if rep78<3
. anova price rep78##foreign
<output omitted>
. contrast r.foreign@rep78
Contrasts of marginal linear predictions
Margins : asbalanced
-------------------------------------------------
| df F P>F
--------------+----------------------------------
foreign@rep78 |
(1 vs 0) 3 | 1 0.73 0.3965
(1 vs 0) 4 | 1 0.07 0.7881
(1 vs 0) 5 | 1 0.80 0.3743
Joint | 3 0.53 0.6606
|
Residual | 63
-------------------------------------------------
---------------------------------------------------------------
| Contrast Std. Err. [95% Conf. Interval]
--------------+------------------------------------------------
foreign@rep78 |
(1 vs 0) 3 | -1529.739 1792.049 -5110.862 2051.385
(1 vs 0) 4 | 379.8889 1407.262 -2432.3 3192.078
(1 vs 0) 5 | 2088.167 2333.681 -2575.322 6751.655
---------------------------------------------------------------