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: date in stata


From   Christopher Baum <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: date in stata
Date   Sun, 7 Aug 2011 10:36:28 -0400

On Aug 7, 2011, at 2:33 AM, Luist wrote:

> id sex date of bird
> 1 1 18/01/2000
> 2 2 12/09/1998
> 3 1 01/01/1969
> 4 1 21/03/1950
> 5 2 25/05/1898
> 
> 
> Is there any way to change the settings for the Stata allows dates prior
> to 1900?


What makes you think Stata can't handle dates prior to 1900? If you want to keep track of Charlemagne's coronation, you certainly can:

g date = mdy(var1, var2, var3)
clonevar disdate  = date
format disdate %td

  +------------------------------------------+
  | var1   var2   var3      date     disdate |
  |------------------------------------------|
  |   12      1   1900    -21580   01dec1900 |
  |    6     12   1899    -22117   12jun1899 |
  |    4     15   1898    -22540   15apr1898 |
  |    3     20   1842    -43020   20mar1842 |
  |   11      1   1789    -62151   01nov1789 |
  |    7      4   1776    -67019   04jul1776 |
  |    1      1    800   -423681   01jan0800 |
  +------------------------------------------+

Stata may not be well suited for explorations in Roman history, as the first date that it can represent is 01jan0100 (see help date) but the Dark Ages are no problem.

Kit


Kit Baum   |   Boston College Economics & DIW Berlin   |   http://ideas.repec.org/e/pba1.html
                              An Introduction to Stata Programming  |   http://www.stata-press.com/books/isp.html
   An Introduction to Modern Econometrics Using Stata  |   http://www.stata-press.com/books/imeus.html




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