Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Looping over variables


From   daniel klein <klein.daniel.81@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Looping over variables
Date   Tue, 18 Dec 2012 09:47:28 +0100

You could probably create a loop over the values 95, 101 and so on,
and add 1 to the respective number inside the loop to get at the
durration. But I would look at -egen-'s -anycount()- function first.
This might be a good way of approching this.

Best
Daniel
-- 
Hello all,

[...]
I want to make a variable that counts the number of pregnancies for each
woman if outcome is 1 or 5 or if outcome is 2,3,4,6 or 7 and number of
weeks of pregnancy was more than 12 weeks. Number of weeks of
pregnancy is given by aa96 (corresponding to the outcome of the first
pregnancy given by aa95), aa102 (corresponding to the outcome of the
second pregnancy given by aa101), and so on.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index