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
Related Posts with Ttest order when assessing difference
Aggregating Weekly Data to MonthlySuppose I have a time series that has weekly realizations, but I want to average each week of a give…
Cox-Model with very few observationsHello everybody, I am researching peace agreements and their durability if they include gender prov…
How to find the matched observation with nearest Mahalanobis distance?Hi everyone, I am wondering how to find the matched observation with nearest Mahalanobis distance. …
Changing Axis Range - Pre Saved .gphHi Im having an issue with a pre saved graph. I would like to change the range of mye y-axis. Someon…
Graph: display negative sign using en-dash instead of hyphenHi list, Code: webuse auto,clear replace rep78=-1*rep78 if foreign==1 scatter rep78 trunk,ysc(r(-5…
Subscribe to:
Post Comments (Atom)
0 Response to Ttest order when assessing difference
Post a Comment