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

RE: st: Multiple tests


From   "Ronnie Babigumira" <ronnie.babigumira@ios.nlh.no>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Multiple tests
Date   Fri, 4 Apr 2003 11:25:23 +0200

Super!!!!!!!!!!!!!!!!!!

Ernest, many thanks. It works with just one slight modification, I wanted to

test avgspring = deltaspring

so the modified solution is

local i=0
foreach origvars of varlist spring crsgpa frstsem  {
         if `i'==0 test avg`origvars' = delta`origvars'
         else         test avg`origvars' = delta`origvars' , accum
         local i = `i' + 1
}


Ronnie
-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of Ernest
Berkhout
Sent: 4. april 2003 11:06
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: Multiple tests


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/

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