Help using Base SAS procedures

Modeling effect of fixed exposure in multiple time-windows in follow-up using PROC PHREG

Posts: 50

Modeling effect of fixed exposure in multiple time-windows in follow-up using PROC PHREG

Hello everyone!  Thanks in advance for your help.  I'm looking for some guidance on how to program a model that I can't seem to find information on in my textbooks and in SAS documentation.

I am conducting a cohort study in which I'm trying to model an outcome which can occur over 365 days of follow-up after exposure.  Due to changes in proportional hazards over follow-up, I want to seperately model the effect of exposure on the outcome (event) over three separate time intervals (0-14 days, 15-90 days, 90-365 days). Just to note - exposure status cannot actually change over time (this is why I think the standard time-varying covariate documentation doesn't apply to my question). Exposure status cannot change but I want to separately calculate effect estimates reflecting hazards 0-14 days after exposure, 15-90 days after exposure, and 90-365 days after exposure.  It also may be important to mention, no events can actually occur during the period 0-14 days (which is partially why I want to model that period separately).

In order to calculate independent hazard ratios for these different time periods, I want to use dummy variables.  I've attempted to code them as follows:

     IF time GT 14 AND time LE 90 THEN time_dummy1=1;

     ELSE time_dummy1=0;

     IF time GT 90 THEN time_dummy2=1;

     ELSE time_dummy2=0;

Time refers to the amount of time spent in the cohort by each subject.  For people with events or who lose eligibility during follow-up, time < 365.  For the vast majority who experienced no event and were not censored, time = 365.

Next, I used the following PROC PHREG code to calculate parameter estimates:

     proc phreg data=CollapsedFlags;

     MODEL time*event(0) = exposure exposure*time_dummy1 exposure*time_dummy2 / rl;


The problem is for the exposure*time_dummy2 interaction, I get no parameter estimate (or standard error). I assumed the output would allow me to calculate the HR for the second time period by combining the parameter estimates for exposure and exposure*time_dummy1 and for the third time period by combining the estimates for exposure and exposure*time_dummy 2.  Wouldn't these results (exposure*time_dummy2 estime = 0) imply that the hazard in time period 3 is the same as the hazard in time period 1?  Am I miscoding this?  Any guidance (or recommendations for references) would be helpful and appreciated.

Posts: 50

Re: Modeling effect of fixed exposure in multiple time-windows in follow-up using PROC PHREG

First of all, thanks to everyone who spent time reviewing this question.

Not sure I have a complete handle on this issue yet but wanted to share what I've learned over the weekend.  I found some illuminating information in a textbook of mine on time-varying covariates (even though this covariate doesn't vary over time - it's effect potentially does).  On page 154 of Survival Analysis using SAS: A Practical Guide (2nd edition), Paul D. Allison  describes the two methods PROC PHREG can use to deal with time-dependant covariates: 1) counting process method and 2) programming statements method. 

In the counting process method, the dataset being analyzed has numerous observations per subject, each observation referring to a time-period over which time-varying covariates remained constant. The programming statements method considers a summary dataset with one observation per subject which contains numerous variables which  refer to variable values for time-varying confounders.  The programming statements method requires that the programming that generates the time-dependant covariates must be a part of every PROC PHREG run.  As a result, the time-varying covariates must be coded within the actual PROC PHREG step.

Still trying to figure out exactly why and how this is working but I'm pretty sure now that I've incorporated my time-variable coding into PROC PHREG I'm getting the correct estimates.  Please refer to the Hazard Ratios (& associated standard errors) below.

                        Contrast Estimation and Testing Results by Row


Contrast                                   Type             Estimate        SE

Exposure: time 0 to 14              EXP              0.00006       0.01

Exposure: time 14 to 180          EXP              0.20         0.15

Exposure: time 180 to 365        EXP              0.85        0.09

Ask a Question
Discussion stats
  • 1 reply
  • 1 in conversation