Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: foreach command


From   Martien Lamers <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: foreach command
Date   Tue, 23 Aug 2011 19:16:36 +0200

<>

In your loop, 'model' should be `model' and loglogisitc should be loglogistic
________________________________________
Van: [email protected] [[email protected]] namens Megan Osterbur [[email protected]]
Verzonden: dinsdag 23 augustus 2011 18:58
Aan: [email protected]
Onderwerp: st: foreach command

I am having a problem with the foreach command in stata10. It was not
working with my own dataset so I attempted to use the example from
Cleves et al An Inroduction to Survival Analysis Using Stata 2nd ed
and the example does not work either.

If you are unfamiliar, this example uses the hip fracture study
available from stata press.

Here are the results from the example:

 use http://www.stata-press.com/data/cggm/hip2
(hip fracture study)

. foreach model in exponential weibull gompertz lognormal loglogisitc gamma {
  2. quietly streg age protect, dist('model') noconstant
  3. estimates store 'model'
  4. }
unknown distribution: 'model'
r(198);

I get the same results with my own data:

 foreach model in exponential weibull gompertz lognormal loglogistic gamma{
  2. streg federalist al_religion fe_cultdiv fe_etfra m_wominpar
van_urban europcon e
> umem popgrowth organizations print unemployed unitary confederation rightexec centr
> istexec parliament mixedsys prelectoral  mixelect proportional mixedelectoral parmo
> narchy execmixed, dist('model') noconstant
  3. estimates store 'model'
  4. }
unknown distribution: 'model'
r(198);

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index