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
Using atcontrasts in margins for a mixed effect modelHi everyone I am currently working on a project (using Stata 15) to analyse changes in kidney funct…
Interactions, Inconsistent resutlsHi all,, I am getting inconsistent results and hope that someone can help me understand the source.…
Unbalanced panel data analysisHi dear all i hope you all fine ...i am undergoing a problem in running analysis on the data ,the de…
GLM or Tobit Regression & Forecast for different distributions (incl. zero inflation)Dear Statalists, I'd very much like to hear your opinion on the following. What I’m trying to do: …
How to draw a correlation forest map with the admetan command?Dear Statalist, I have recently done a meta-analysis of the correlation coefficient, but I encounter…
Subscribe to:
Post Comments (Atom)
0 Response to Ttest order when assessing difference
Post a Comment