Hi,

I have a question that I was hoping someone could help with regarding the order in which Stata completes a test when looking at differences.

My data set has got a field for 'pre' or 'post' (see data table below).

Pre is coded as zero (0) and post is coded as one (1).

Question: With the test, will stata take the pre values as they are coded as 0 and subtract the post values?
ie a negative number indicates that the post values are higher?


This is my code:
**T tests of Volume, trades, num of bids and asks, messages, bid ask spread, bid ask volume FOR ANNOUNCEMENT days
** Price sensitive vs non price sensitive
** Revised_Pre and Post Colo_30 min window.dta
putexcel set Ttest_Annoucement_days_PS_NPS, replace
local counter5 = 4
forvalue i = 1/2 {
foreach ttest_var of varlist Volume No__Trades No__Bids No__Asks Count_of_Messages {
ttest `ttest_var' if PriceSensitive2==`i', by(Pre_or_Post_Colo) unequal
putexcel A`counter5' = `r(t)'
putexcel B`counter5' = `r(p)'
local counter5 = `counter5' + 1
}
}
encode


The data looks as follows (scroll to the right to see the Pre_or_Post_Colocation field, in red font):
Array

Output for the Volume Var tttest
Two-sample t test with unequal variances
------------------------------------------------------------------------------
Group | Obs Mean Std. err. Std. dev. [95% conf. interval]
---------+--------------------------------------------------------------------
0 | 198,188 22274.75 429.8264 191351.5 21432.3 23117.2
1 | 320,645 16575.2 177.341 100420.3 16227.61 16922.78
---------+--------------------------------------------------------------------
Combined | 518,833 18752.36 197.4449 142219.7 18365.37 19139.34
---------+--------------------------------------------------------------------
diff | 5699.552 464.9737 4788.216 6610.888
------------------------------------------------------------------------------
diff = mean(0) - mean(1) t = 12.2578
H0: diff = 0 Satterthwaite's degrees of freedom = 266629

Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(T < t) = 1.0000 Pr(|T| > |t|) = 0.0000 Pr(T > t) = 0.0000

Thanks
Imtiaz