Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: generating age using dates


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   RE: st: generating age using dates
Date   Fri, 17 Dec 2010 17:02:24 +0000

These ages are evidently all near 50. That suggests to me some confusion directly or indirectly to do with the fact that Stata's origin for dates is 1 January 1960, i.e. nearly 50 years ago. Just a wild guess. 

We have to see what 

Nick 
n.j.cox@durham.ac.uk 

martine etienne

"very similar" looks like this:

tab age

        age |      Freq.     Percent        Cum.
------------+-----------------------------------
   49.85495 |          1        0.35        0.35
   49.86043 |          1        0.35        0.70
   49.86864 |          1        0.35        1.05
   49.87685 |          1        0.35        1.39
   49.89053 |          2        0.70        2.09
   49.90421 |          1        0.35        2.44
   49.90695 |          1        0.35        2.79
   49.91516 |          2        0.70        3.48
   49.92337 |          2        0.70        4.18
   49.92611 |          1        0.35        4.53
   49.93705 |          2        0.70        5.23
   49.93979 |          1        0.35        5.57
   49.94253 |          1        0.35        5.92
   49.94527 |          3        1.05        6.97
     49.948 |          1        0.35        7.32
   49.95348 |          1        0.35        7.67

please see the output of 

des nage age

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

nage            float  %9.0g                  
age             float  %9.0g                  

The survey was administered to a random selection of patients, and our patient 
population is between 20-60years old. 

From: Neil Shephard <nshephard@gmail.com>

On Fri, Dec 17, 2010 at 3:26 PM, martine etienne <martieluvsu@yahoo.com> wrote:


> I am trying to generate age using the following variables:
>
> "survey_date"=survey date
>
> "q1_dob2"=date of birth

What format are these stored as?

-des survey_date q1_dob2-

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

What does "very similar" mean?  If you could post the output of -des
nage age- would go some way to explaining that.

> ie..I have a sample of 287 and over 200 are 50 plus....

Why is that surprising?  What is the study design?  If it was to
survey people > ~45 then this wouldn't surprise me at all!

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index