Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Mean Test


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: Mean Test
Date   Sun, 22 Jan 2006 21:20:57 +0000 (GMT)

> > *-----------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)
> -------------------------------------------------------------
> 
> Now cant the same be simply done by
> 
> foreach var of varlist popgrowth-safewater {
>           oneway `var' region, t sid
>          }

No, the sidak option in -oneway- solves a different, though very similar problem. When doing a
oneway anova, you get a test whether the three or more means are the same. Usually you want to
know more: which groups are different, and in what way. So, you can ask -oneway- to compare all
pairs (also called contrasts). This is very much like you automatically doing tests on a lot of
variables. So again you need to correct the p-values you get for all the contrasts. What I did in
my example is get a p-value of the test "the three groups are the same" for lots of variables, and
corrected those p-values. So the sidak option in -oneway- corrects for multiple tests within one
variable, while my code corrects for multiple tests across variables.

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/
-----------------------------------------



		
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index