I am not clear on what is problematic to you here, but
one simple thing may bite you sooner or later.
Your -year- variable takes on values 0 ... 3
and 60 ... 99 meaning presumably 2000 ... 2003
and 1960 ... 1999.
Fix that straight away by
gen Year = cond(year < 4, 2000 + year, 1900 + year)
I'm suggesting a new variable, so that you can
check -Year- against -year-.
Nick
[email protected]
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of Henry DOCTOR
> Sent: 26 April 2004 16:42
> To: '[email protected]'
> Subject: st: RE: RE: creating age at first birth from birth
> history data
>
>
> I just want to be more clear with the data that I have again:
>
> I have the following variables:
>
> Age of mother, all pregnancies the mother has had (starts
> with last born and
> ends with first born), birthday for each child, an indicator
> variable for
> the child number which runs from 0 to the last child. So, I
> want the reverse
> order for the list of children (first born to last born).
>
> There are a total of roughly 16,000 pregnancies for the women
> and I tried
> what Nick suggested but I am just wondering why I am getting
> the same number
> of pregnancies (16,000). I thought the first births would be
> less than the
> 16,000.
>
> This is how my data are:
>
> tab child_n if child_n!=88 (In this case child 1 is last
> born, child 2 is
> second to last born etc etc)
>
> child |
> number | Freq. Percent Cum.
> ------------+-----------------------------------
> 1 | 4,105 24.71 24.71
> 2 | 3,452 20.78 45.49
> 3 | 2,899 17.45 62.93
> 4 | 2,345 14.11 77.05
> 5 | 1,628 9.80 86.85
> 6 | 1,090 6.56 93.41
> 7 | 607 3.65 97.06
> 8 | 309 1.86 98.92
> 9 | 104 0.63 99.55
> 10 | 47 0.28 99.83
> 11 | 17 0.10 99.93
> 12 | 9 0.05 99.99
> 13 | 2 0.01 100.00
> ------------+-----------------------------------
> Total | 16,614 100.00
>
> tab year (year child was born)
>
> year child |
> born | Freq. Percent Cum.
> ------------+-----------------------------------
> 0 | 717 4.23 4.23
> 1 | 657 3.88 8.11
> 2 | 653 3.85 11.96
> 3 | 570 3.36 15.32
> 60 | 2 0.01 15.33
> 61 | 1 0.01 15.34
> 62 | 1 0.01 15.34
> 63 | 2 0.01 15.36
> 64 | 1 0.01 15.36
> 65 | 1 0.01 15.37
> 66 | 2 0.01 15.38
> 67 | 5 0.03 15.41
> 68 | 9 0.05 15.46
> 69 | 14 0.08 15.54
> 70 | 45 0.27 15.81
> 71 | 35 0.21 16.02
> 72 | 74 0.44 16.45
> 73 | 112 0.66 17.11
> 74 | 109 0.64 17.76
> 75 | 151 0.89 18.65
> 76 | 174 1.03 19.67
> 77 | 207 1.22 20.90
> 78 | 256 1.51 22.41
> 79 | 253 1.49 23.90
> 80 | 399 2.35 26.25
> 81 | 348 2.05 28.31
> 82 | 347 2.05 30.35
> 83 | 481 2.84 33.19
> 84 | 509 3.00 36.19
> 85 | 487 2.87 39.07
> 86 | 526 3.10 42.17
> 87 | 583 3.44 45.61
> 88 | 1,806 10.65 56.26
> 89 | 525 3.10 59.36
> 90 | 722 4.26 63.62
> 91 | 608 3.59 67.21
> 92 | 610 3.60 70.80
> 93 | 682 4.02 74.83
> 94 | 693 4.09 78.92
> 95 | 700 4.13 83.05
> 96 | 711 4.19 87.24
> 97 | 724 4.27 91.51
> 98 | 638 3.76 95.27
> 99 | 801 4.73 100.00
> ------------+-----------------------------------
> Total | 16,951 100.00
>
*
* 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/