Statalist


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

Re: st: Problem with forvalues option


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Problem with forvalues option
Date   Thu, 27 Mar 2008 13:33:03 +0000 (GMT)

What about:

forvalues id = 114603/304057{
forvalues year = 2004/2007{
egen stypno`id'_`year' = count(servtype)
lab var styno`id'_`year' ///
  "number of service types utilized each child per year"
}
}

Hope this helps,
Maarten

--- Josiane Georges <jgeorges@health.nyc.gov> wrote:

> I can't get the following code to work:
> 
> *****Create new variable which counts # of service types utilized by
> child's id by year
> forvalues id = 114603/304057{
> forvalues year = 2004/2007{
> egen stypno`id' `year' = count(servtype)
> lab var styno "number of service types utilized each child per year"
> }
> }
> 
> What have I done wrong?
> 
> 
> 
> Josiane "Josie" Georges
> Analyst, Liaison to the Division of Mental Hygiene
> Policy and Planning
> NYC Department of Health and Mental Hygiene
> Tel: 212-788-5342
> Fax: 212-788-5353
> Email: jgeorges@health.nyc.gov
> 125 Worth Street, Rm 624, CN #45
> New York, NY 10013
>  
> 
> 
> 
>
**********************************************************************
> The New York City Department of Health & Mental Hygiene is now
> offering information important for the health of all New Yorkers.  To
> sign up for these new and valuable updates, log-on to our website at
> http://www.nyc.gov/health/email and select the NYC DOHMH updates
> you'd like to receive.
> 
> IMPORTANT NOTICE:  This email is meant only for the use of the
> intended recipient.  It may contain confidential information that is
> legally privileged or otherwise protected by law.  If you have
> received this communication in error, please notify me immediately by
> replying to this message and please delete it from your computer. 
> Thank you for your cooperation.
> 
> 
> *
> *   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/
> 


-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


      ___________________________________________________________ 
Yahoo! For Good helps you make a difference  

http://uk.promotions.yahoo.com/forgood/
*
*   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