Hi Everyone,
Below is an example of data from the survival analysis.
The total duration of follow up is 18 years+. However, I want to restrict my survival analysis to the first five years since diagnosis.
datediag dead dateexit id perdiag agegrp
4429 1 4706 1570110 0 5
4533 1 6754 1570111 0 5
4387 1 4650 1570112 1 5
4669 1 4856 1570113 0 4
4123 1 4236 1570114 0 3
4883 0 4896 1570115 0 2
4324 1 4432 1570116 0 5
4129 1 4231 1349552 0 5
4114 1 4155 1349553 0 5
4220 1 4343 1349554 1 5
4201 1 4220 1349555 0 5
5332 1 5449 1349556 0 5
Could anyone suggest me what is the best way to restrict my analysis to FIRST FIVE YEARS SINCE DIAGNOSIS?
I am confused between the two methods:
* Generating duration variable
gen duration = dateexit - datediag
* We only want first five years after diagnosis
drop if duration > 1825
or using the stsplit command and restricting the analysis to first five years
stsplit fiveyears, at (5)
and
dropping
drop if fiveyears==5
Below is an example of data from the survival analysis.
The total duration of follow up is 18 years+. However, I want to restrict my survival analysis to the first five years since diagnosis.
datediag dead dateexit id perdiag agegrp
4429 1 4706 1570110 0 5
4533 1 6754 1570111 0 5
4387 1 4650 1570112 1 5
4669 1 4856 1570113 0 4
4123 1 4236 1570114 0 3
4883 0 4896 1570115 0 2
4324 1 4432 1570116 0 5
4129 1 4231 1349552 0 5
4114 1 4155 1349553 0 5
4220 1 4343 1349554 1 5
4201 1 4220 1349555 0 5
5332 1 5449 1349556 0 5
Could anyone suggest me what is the best way to restrict my analysis to FIRST FIVE YEARS SINCE DIAGNOSIS?
I am confused between the two methods:
* Generating duration variable
gen duration = dateexit - datediag
* We only want first five years after diagnosis
drop if duration > 1825
or using the stsplit command and restricting the analysis to first five years
stsplit fiveyears, at (5)
and
dropping
drop if fiveyears==5
Comment