I'm analyzing data from a survey that utilized multistage probability sampling. I'm using R and therefore the bulk of my analyses with these data utilize the survey package to account for the weighting. The survey package has the svycoxph function which accepts the survey design objects that indicate the survey weights.
The data set contains one row per case with time values for the covariate and event. However, CoxPH models that utilize time-dependent covariates require the data be set up with with multiple rows per case that have changes in the time-dependent covariate. For example, right now I have this (weights and other variables omitted):
subject cov event age
1 5 90 120 135
First question - my covariate is more of a dichotomous event than something that can continuously change over time. (e.g., cov = occurrence of a traumatic brain injury, event = development of depression). Is this the correct way to code the covariate to indicate that subject 5 experienced a TBI at 90 units of time and then developed depression at 120 units of time?
subject time1 time2 cov event
1 5 0 90 0 0
2 5 90 120 1 1
The second question has to do the survey weighting and the implications of creating of additional rows for cases with changes in the time-dependent covariate. The options seem to be to either utilize the svycoxph function to consider the weights, or to use the coxph function and disregard the weights for this particular analysis.
svycoxph(Surv(time1, time2, event == 1) ~ cov, design = df.design, data = df)
vs
coxph(Surv(time1, time2, event == 1) ~ cov, data = df)
The first method retains the survey weighting - but is that an issue because some cases now have multiple rows (weighting factored in twice)? The second discards the weighting information. Which would be more appropriate given the nature of these data? Are there other alternatives I haven't considered?
Thanks in advance for the help - please let me know if any additional information would be useful for these questions.