I have dataset on legal cases in which there are multiple entries for each case, each entry pertaining to a specific hearing. I am trying to fit a Cox proportional hazards model to estimate the impact of some variables on the probability of disposal of civil and criminal cases, mainly
, a categorical variable indicating what type of court the case is being heard in. I thought it would be convenient to stset the data using the dates of hearings to define survival time.
I have stset the data using this code:
Code:
stset businessondate_sif, id(unidcode) failure(dispvar) origin(time firsthearingdate)
,
where
refers to individual hearing dates,
refers to the first hearing, which I regard as the start of a case,
is a number which uniquely identifies a case, and
is a dummy variable which is equal to 0 unless the hearing/observation is the final one in which a case is disposed, in which case it is equal to 1.
Some of the time-varying covariates that I want to control for are
and
, which are the number of cases pending and the number of cases filed in a given court, for the month in which the hearing occurs.
My question is, since the time-varying covariates vary with respect to each month, rather than with respect to the duration of a case, does it make sense to include them in the
option, for example
Code:
stcox i.treat i.casetype_code, tvc(numfiled numpend)
? Or is there another, more appropriate, way of dealing with this? I would rather not dispense with current format of multiple hearings per case in the dataset (as has been suggested by colleagues), since it allows me to control for the stage of a case using indicator variables.
Thank you in advance!
0 Response to Time-varying covariates in Cox models, when data has been stset with a date variable
Post a Comment