Rijo:
Appart from first testing for equality of variance there are two other problems with your
approach:
1) The t-test is for comparing the means of two groups. You want to compare three groups, in which
case the t-test (on pairs) is not appropriate, as Nick already suggested. I am not familiar with
Jonckheere-Terpstra test he sugested, I always teach my students to use a oneway anova in this
case. So I did that in the example code below.
2) You are doing multiple test: p-value of .05 means that you will find a significant result when
you shouldn't in 1 out of 20 times you perform a test. If you do many tests, like you are
proposing, than you will find significant results just by coincidence (random sampling error).
When doing multiple testing you should adjust your p-values. This is what the -_mtest- command in
my example does, see -help _mtest- if you want to know more.
*-----------begin example--------------
set more off
sysuse lifeexp, clear
local i = 1
tempname tests
matrix `tests' = J(4,1,0)
foreach var of varlist popgrowth-safewater {
oneway `var' region
matrix `tests'[`i',1] = Ftail(r(df_m), r(df_r),r(F))
local ++i
}
matrix list `tests'
_mtest adjust `tests', pindex(1) replace mtest(sidak)
matrix list r(result)
*---------------end example-----------------------
HTH,
Maarten
-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands
visiting adress:
Buitenveldertselaan 3 (Metropolitan), room Z214
+31 20 5986715
http://home.fsw.vu.nl/m.buis/
-----------------------------------------
___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com
*
* 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/