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 09:32:52 -0800 (PST)

i used the following command:

encode q1_dob, generate (q1_dob2)


----- Original Message ----
From: Nick Cox <[email protected]>
To: "[email protected]" <[email protected]>
Sent: Fri, December 17, 2010 12:19:42 PM
Subject: RE: st: generating age using dates

How did you "encode" that? 

Nick 
[email protected] 

martine etienne

the variable q1_dob2 is the only one that I generated from encoding the original 

variable q1_dob which was is in string format:


des q1_dob

              storage  display     value
variable name   type   format      label      variable label
----------------------------------------------------------------------------------------------------------------------


q1_dob          str10  %10s        

all years are four digits, see below:

tab q1_dob

     q1_dob |      Freq.     Percent        Cum.
------------+-----------------------------------
01/04/1956 |          1        0.35        0.35
01/05/1964 |          1        0.35        0.70
01/05/1968 |          1        0.35        1.05
01/06/1956 |          1        0.35        1.39
01/06/1963 |          1        0.35        1.74
01/07/1960 |          1        0.35        2.09
01/10/1975 |          1        0.35        2.44
01/12/1957 |          1        0.35        2.79
      
also, there is only one missing date of birth in the original variable and it is 

coded as 99/99/9999, there
are no missing dates in the survey_date variable.


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