Hi guys, I am new to Stata, just wondering how stata calculates the value of _t and _t0.
Many thx
Many thx
. set obs 2
number of observations (_N) was 0, now 2
. g id=_n
. g time_in=2
. g time_out=4
. g failure=1 in 1
(1 missing value generated)
. replace failure=0 if failure==.
(1 real change made)
. g study_time= time_out- time_in
. stset study_time, failure(failure)
failure event: failure != 0 & failure < .
obs. time interval: (0, study_time]
exit on or before: failure
------------------------------------------------------------------------------
2 total observations
0 exclusions
------------------------------------------------------------------------------
2 observations remaining, representing
1 failure in single-record/single-failure data
4 total analysis time at risk and under observation
at risk from t = 0
earliest observed entry t = 0
last observed exit t = 2
. list
+--------------------------------------------------------------------+
| id time_in time_out failure study_~e _st _d _t _t0 |
|--------------------------------------------------------------------|
1. | 1 2 4 1 2 1 1 2 0 |
2. | 2 2 4 0 2 1 0 2 0 |
+--------------------------------------------------------------------+
.
Comment