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 calculation
From
Nick Cox <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: date calculation
Date
Mon, 10 Mar 2014 19:50:57 +0000
The age at admission is just the difference between two dates, and as
such quite independent of the origin of Stata dates.
Nevertheless the idiosyncrasies of the calendar make this a little
trickier than just subtraction. Indeed Phil Clayton, Mike Corbett and
Alison Smith all found embarrassing bugs in code I wrote for this.
But see -personage- (SSC). (Think "person age", not "personage";
perhaps it should have an underscore, but I am not changing it now.)
Nick
[email protected]
On 10 March 2014 19:38, DeMichele, Matthew <[email protected]> wrote:
> I have two date variables arranged as YYYYMM and YYYYYMMDD. The first
> variable is date of birth and the second is date of admission to
> treatment. I am trying to calculate age_at_admission, but am running
> into trouble. Is this a possible calculation since Stata calculates
> dates as days since 1,1,1960?
>
> Thank you for your help.
>
> Matthew
>
>
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/