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: Create a Running Count Variable?


From   Don Ruby <[email protected]>
To   [email protected]
Subject   st: Create a Running Count Variable?
Date   Fri, 20 May 2011 14:48:57 -0400

Hi everyone,

Suppose I have the following data, where NUML is the variable I want to create.

    +---------------------------------------------------------+
     |  Fid   CHid  YOB  LOWB      NUML      |
     |----------------------------------------------------------|
 1. |    1      11    80         1              0         |
 2. |    1      12    82         0              1         |
 3. |    2      21    78         1              0         |
 4. |    2      22    85         1              1         |
 5. |    2      23    88         1              2         |
    +---------------------------------------------------------+

Where Fid is a family id, CHid is a child id, YOB is year of child's
birth, LOWB is an indicator for whether the child was born with low
birth weight, and NUML is the number of LOWB siblings born previously.

How can I create this running count variable, NUML?


Thanks,

Don

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