Statalist The Stata Listserver


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

st: RE: ordering records


From   "Alex Ogan" <[email protected]>
To   <[email protected]>
Subject   st: RE: ordering records
Date   Tue, 6 Jun 2006 12:11:27 -0400

. list

     +--------------------------------------+
     | surmonth    iddom   i   sthome   age |
     |--------------------------------------|
  1. |        1   560036   1        1    57 |
  2. |        1   560036   2        2    51 |
  3. |        1   560036   3        3    27 |
  4. |        1   560036   4        3    16 |
  5. |        1   560036   5        3    13 |
     +--------------------------------------+

. gen dep_seq = .
(5 missing values generated)

. bysort surmonth iddom sthome (age): replace dep_seq = _N - _n + 1 if
sthome==3
(3 real changes made)

. list

     +------------------------------------------------+
     | surmonth    iddom   i   sthome   age   dep_seq |
     |------------------------------------------------|
  1. |        1   560036   1        1    57         . |
  2. |        1   560036   2        2    51         . |
  3. |        1   560036   5        3    13         3 |
  4. |        1   560036   4        3    16         2 |
  5. |        1   560036   3        3    27         1 |
     +------------------------------------------------+

.

Hope this helps.

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Ricardo
Guimaraes
Sent: Tuesday, June 06, 2006 12:01 PM
To: [email protected]
Subject: st: ordering records

I have the following panel data .



      | surmonth    iddom     i   sthome   kid_seq   age |
      |--------------------------------------------------|
   1. |        1   560036     1        1         .    57 |
   2. |        1   560036     2        2         .    51 |
   3. |        1   560036     3        3         1    27 |
   4. |        1   560036     4        3         1    16 |
   5. |        1   560036     5        3         1    13 |

"surmonth" is time; "iddom" identifies a family; "i" an 
individuo in the family;
"sthome" is the status in the family (1=head, 2=spouse; 
3=kids) and "age". kid_seq was my attempt
to create a order from the older to the younger kid.

Question:
How to create a variavel (let`s say, dep_seq) for each 
family ordering the kids from the older to the
younger.

sincerely,
Ricardo



Ricardo Guimaraes
Junior Researcher
Center for Development Research (ZEF) - University of Bonn
Walter-Flex Str., 3
53113 Bonn
Germany
*
*   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/


This message is intended solely for the designated recipient(s). It may contain confidential or proprietary information and may be subject to confidentiality protections. If you are not a designated recipient, you may not review, copy, or distribute this message. If you receive this in error, please notify the sender by reply e-mail and delete this message. 

Arrowstreet Capital, L.P. is an Equal Opportunity Employer. 



*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index