|
Hi,
I'm running a Cox regression analysis with a time dependent covariate for exposure to a certain factor.
****************************************************************.
data list free /Exposure_status Exposure_start Exposure_end time outcome_status (5F6.0).
begin data
0 0 0 200 0
1 10 250 300 1
1 10 30 100 1
1 0 400 450 1
0 0 0 200 0
0 200 300 300 1
end data.
TIME PROGRAM.
DO IF (Exposure_status=1).
IF (T_ >= Exposure_start AND T_ < Exposure_end) T_COV_=1.
ELSE.
COMPUTE T_COV_=0.
End if.
COXREG time
/STATUS=outcome_status(1)
/METHOD=ENTER T_COV_
/CRITERIA=PIN(.05) POUT(.10) ITERATE(20).
****************************************************************.
My goal is that if T_ is within the period of exposure, T_COV_ will be 1, if it is before or after this period, T_COV_ should be 0.
Since I'm new to time dependent covariates, could someone confirm if this is a correct method?
|