BookmarkSubscribeRSS Feed
adam123
Calcite | Level 5
I am struggling to use PHREG with time-dependent covariate using the "programming approach" (vs. the counting approach).

Rather than going into the details, this is the general idea: I have a covariate --- let us say that it is patient "color." Patients by default are either blue or green in the period before the index date in the time to event analysis. However, blue patients can become purple patients following the index date and prior to death/censoring. (Note: green patients cannot change their color.) I am trying to understand the hazard ratio of death given a patient's color with color formulated as a time-dependent CATGEORICAL/CLASS variable. I want to estimate the hazard ratios of death  for purple to blue; purple to green; and green to blue.

The issue is that the time-dependent covariate in PHREG is automatically coded as a 1 or 0 and is a numeric, not class/categorical. Accordingly, I cannot figure out a way of implementing the 3 hazard rate comparisons which would otherwise be simple if I ignored the time-dependent nature of color. Can someone please help. I have spent hours trying to figure this out. Thanks.

2 REPLIES 2
pink_poodle
Barite | Level 11
There is a basic example here:
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/statug/statug_phreg_examples08.htm
The outcome is time-dependent survival status (Time*VStatus), and that is right - the status can only be 0 (dead) or 1 (alive). The model in example "Time*VStatus(0)=LogBUN HGB" looks at time-dependent probability of survival depending on two factors: LogBUN and HGB. Color would have to be a factor in your example, and it would be useful to "freeze" those additional categories with color transitions before testing the effect of color on survival (i.e., if at any point of time the patient transitioned from purple to blue, h/she will no longer belong to the "purple" category, but to a separate "purple-to-blue" category).
adam123
Calcite | Level 5

I may have misunderstood your reply, but your solution is not what I am looking for.

You are effectively suggesting that I build a traditional Cox Proportional hazard model with with time-INVARIANT covariates.  You are suggesting that the covariate in the Cox model be a categorical variable with the following values: green, blue, blue-to-purple.  This is one way of proceeding.  However, this is arguably very misleading because it does not consider the relationship between when the blue-to-purple transition occurred at the timing of the event of interest (i.e., death.)

The reviewers of my paper have specifically requested a Cox model that uses time-varying covariates.  This would not be a problem if I only had 2 groups: blue and blue-to-purple.  I would create this "extended Cox model"  with color coded as time varying.  Here is the SAS example. https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/statug/statug_phreg_examples06.htm  In this model the color variable becomes a numeric variable 0.0 and 1.0, not a categorical class.  However, I do not have just blue and blue-to-purple.  I also have green......I suspect the solution has something to do with creating an interaction between the variable for blue and blue-purple and another variable that is green/not-green.....But, regardless of the strategy, the model must consider WHEN the blue-purple transition occurred.  This is the fundamental research question: what is the relationship between this transition and death. So, this must be model that considers the TIMING of the blue to purple transition =>>> the covariate must be a function of time.


sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 726 views
  • 1 like
  • 2 in conversation