Statalist


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

st: date subtraction


From   "moleps islon" <moleps2@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: date subtraction
Date   Wed, 17 Dec 2008 20:49:57 +0100

IN generating the timevariabel for a cox model I get the follwing.
Everything is perfect, except id 83. Any idea why??

gen futime=fudate-opdate
gen pfutime=pfudate-opdate
gen coxtime=pfutime if pfutime>futime &pfutime<.
replace coxtime=futime if pfutime==.
replace coxtime=pfutime if futime==.
list opdate fudate pfudate futime pfutime coxtime


    |    opdate      fudate     pfudate   futime   pfutime   coxtime |
 76. | 10 Nov 04   18 Apr 05   23 May 08      159      1290      1290 |
 77. | 25 May 04   16 Sep 04   23 May 08      114      1459      1459 |
 78. | 24 Aug 04   01 Dec 04   30 Jun 08       99      1406      1406 |
 79. | 28 Feb 05   22 Sep 05   26 Jun 08      206      1214      1214 |
 80. | 06 Jan 05   13 Apr 05   15 Oct 08       97      1378      1378 |
     |----------------------------------------------------------------|
 81. | 10 Jan 05   18 Apr 05   15 Sep 08       98      1344      1344 |
 82. | 14 Apr 05   06 Jun 05   25 Jun 08       53      1168      1168 |
 83. | 22 Jun 05   04 Oct 05   24 Jun 08   -72944    -71950    -71950 |
 84. | 15 Jan 87   10 Feb 96           .     3313         .      3313 |
 85. | 31 Aug 92   20 Mar 94           .      566         .       566 |
     |----------------------------------------------------------------|

Regards,
Moleps
*
*   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   |   What's new   |   Site index