Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Multiple tests


From   Ernest Berkhout <ernestb@seo.fee.uva.nl>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Multiple tests
Date   Fri, 04 Apr 2003 11:06:15 +0200

At 10:47 4-4-2003, you wrote:
test avgspring = deltaspring
test avgcrsgpa = deltacrsgpa, accum
test avgfrstsem  = deltafrstsem, accum

and it is OK for a few variables, however, I need to do this for many more
variables so my question is, CAN THIS BE AUTOMATED (can i repeat myself
without running mad).
local i=0
foreach origvars of varlist spring crsgpa frstsem  {
        if `i'==0 test avg`origvars' = avg`origvars'
        else         test avg`origvars' = avg`origvars' , accum
        local i = `i' + 1
}

should do the trick I think.

Grtz,
Ernest Berkhout
Stichting voor Economisch Onderzoek
Universiteit van Amsterdam

De SEO is verhuisd! Tegenwoordig ben ik bereikbaar op:
Kamer 3.08
Roetersstraat 29
1018 WB Amsterdam

tel.:+ 31 20 525 1630
fax:+ 31 20 525 1686
http://www.seo.nl
=================================
"To an economist, real life is a special case"
=================================

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index