Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: weird date format


From   "Maarten Buis" <M.Buis@fsw.vu.nl>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: weird date format
Date   Mon, 21 Nov 2005 17:03:07 +0100

Which suggest an easy way to convert your format to Stata date format (with all the pretty labelling options etc.): 

gen dob2 = dob + mdy(10,15,1582)
format dob2 %d
list


-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology 
Vrije Universiteit Amsterdam 
Boelelaan 1081 
1081 HV Amsterdam 
The Netherlands

visiting adress:
Buitenveldertselaan 3 (Metropolitan), room Z214 

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of Nick Cox
Sent: maandag 21 november 2005 16:52
To: statalist@hsphsun2.harvard.edu
Subject: st: RE: weird date format

A regression of dob on birth gives a slope of -364,
so that underlines the easy guess that dob is #days
since some origin. So the question is clearly what
origin. Some monkeying around gives

. di mdy(1,1,1994) -  mdy(10,15,1582)
150193

So my wild guess is that the scale is "number
of days since the Gregorian calendar was
introduced on 15 October 1582".

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

Haidong Wang

> I'm using a dataset with a format of date of birth (dob) which I can't
> recognize.
>
>
>      +--------------+
>      |    dob       age |
>      |--------------|
>   1. | 141116    27 |
>   2. | 141016    27 |
>   3. | 150189     2 |
>   4. | 125494    70 |
>   5. | 126759    66 |
>      +--------------+
> The survey was carried out between 1996 and 1997. So, the first
> respondents who's date of
> birth was "141116"  was 27 years old at that time, either
> 1996 or 1997.
>
> Does anyone know what format of date are those?

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

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



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index