Solved – Cox-Proportional hazards model with panel (longitude ) data

cox-modelsurvival

I am working with panel data with incomplete case:
enter image description here

and the goal is to predict the probability of 1 at each time for each case.
I am trying to use the cox-ph model for this analysis because like case B and C are right censored and can start with different time, and I am using the last known status (0 or 1 at time 5) as the status for each case.
for the above case A will be:
enter image description here

There are 5 observations for case A, and the third column is the response variable.

Is the way I deal with data correct?

Best Answer

Now that you've clarified the data matrix, the answer is, "no," this is not the right way to handle it in survival analysis. One of the most important facts about survival models is that they account for censoring, something traditional linear regression models do not. This means that you would want to structure the data in a "stacked," vertical format. Here's an example using your data which has 5 possible periods:

Case  Period  Status Censored
 A      1       0        0
 A      2       0        0
 A      3       0        0
 A      4       1        0
 B      1       0        0
 B      2       0        0
 B      3       0        0
 B      4       0        0
 B      5       0        1
 C      2       0        0
 C      3       0        0
 C      4       0        0
 C      5       0        1
 D      2       0        0
 D      3       0        0
 D      4       0        1

I've added case D to illustrate a case that was "interval" censored.

Left-aligning would pick up Case C in its second period. You might want to adjust the count of the periods to reflect that as a function of model parameterization. In addition, the model should allow you to specify a censoring variable to reflect the right-aligned period in which that occurs.

Other fixed and time-varying predictors would apply in the model as available and appropriate.