Thank you both. I will give it a try today.
Donald Spady
Dep't of Pediatrics, University of Alberta
(780) 407-1244
Nature has no reset button.
----- Original Message -----
From: "Nick Cox" <[email protected]>
To: <[email protected]>
Sent: Friday, May 09, 2003 04:32
Subject: st: RE: Re: automating a series of equations
> Scott Merryman replied to Don Spady
> > >
> > > I need some help with repeating tasks. I am doing a series of
> > > logistic regressions and want to automate the task.
> > >
> > >
> > > Say I have an equation
> > > logistic depvar indepvar sexfm interactionterm if agegrp == X
> > > lincom indepvar + interaction term (sexfm+indepvar)
> > > I have about 8 depvars and 25 indepvars and 3 agegrps.
> > > I want to do all 8 depvars and 25 indepvars at 3 agegrps
> > and do a lincom
> > > on each outcome.
> > > it is easy to automate the system using for var "x": if
> > you are not
> > > doing lincom. Use of lincom introduces a new command and
> > I don't know
> > > how to
> > > deal with it.
> > > How do I do a for var depvar1 ... depvar10 and then do a
> > lincom for each
> > > equation as it comes up. I think it needs a loop within
> > a loop but I am
> > > not at all sure how to do that.
> > >
>
> > I think something like this should work:
> >
> > levels agegrp , local(levels)
> > foreach var of varlist dep1 - dep10 {
> > foreach l of local levels {
> > logit `var' indepvar1 - indepvar25 if agegrp == `l'
> > lincom indepvar1 + indepvar2
> > }
> > }
> >
>
> Note that -levels- was added to official Stata,
> i.e. version 8, on 16 April 2003.
>
> A -levels7- for Stata 7 remains part
> of the -levels- package on SSC.
>
> Alternatively, -vallist-, which requires
> only Stata 7, is on SSC with a different
> default and indeed more features. -vallist-
> is now maintained by Patrick Joly.
>
> Nick
> [email protected]
> *
> * 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/