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]

Re: st: generating age using dates


From   martine etienne <[email protected]>
To   [email protected]
Subject   Re: st: generating age using dates
Date   Fri, 17 Dec 2010 08:56:27 -0800 (PST)

thanks Maarten,
the dates look pretty normally distributed, 
both variables are long format:
survey_date     long   %dD_m_Y                
q1_dob2         long   %td         






----- Original Message ----
From: Maarten buis <[email protected]>
To: [email protected]
Sent: Fri, December 17, 2010 10:45:50 AM
Subject: Re: st: generating age using dates

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



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