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, is already up and running.

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

st: date calculation

From   Daniel Marcelino <>
Subject   st: date calculation
Date   Thu, 29 Sep 2011 17:21:22 -0400

Hello all,

I'm fuzzing my mind to get into calculation of date vars. I've a data
set with historic of events that I want to calculate number of days.
However, I need to account for those occurrences in par of them, the
first date is the enter and the subsequent date is the out. If the
same id enter again it will receive new enter e new out date. My point
is, how can I calculate the overall period regarding this intermediary
calculation? Any thoughts is welcome.

  day	           flag_n	flag_N  id
07may2003	1	4	   1
23feb2005	        2	4	   1
31mar2005	3	4	   1
31jan2007   	4	4	   1
01feb2003	        1	2	   5
21dec2005 	2	2         5

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index