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]
Re: st: generating age using dates
From
Maarten buis <[email protected]>
To
[email protected]
Subject
Re: st: generating age using dates
Date
Fri, 17 Dec 2010 15:45:50 +0000 (GMT)
--- On Fri, 17/12/10, martine etienne wrote:
> I am trying to generate age using the following variables:
>
> "survey_date"=survey date
>
> "q1_dob2"=date of birth
>
> I started with the following command:
> gen nage= survey_date- q1_dob2
> gen age= nage/365.4
> but I'm stuck at this point because it looks like the
> numbers are very similar to each other, ie..I have a sample
> of 287 and over 200 are 50 plus....
I would start looking at the distribution of the individual
variables, e.g.
spikeplot survey_date
spikeplot ql_dob2
I would also look at the date format of both variables. If one
is measured in days and the other in weeks then that would
explain the weird results. You can see that by typing
desc survey_date ql_dob2
Hope this helps,
Maarten
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
*
* 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/