BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
haoduonge
Quartz | Level 8

Hi All,

Have you ever run the PROC PHREG in which you include more than one time varying covariate using counting process?

I understand that in counting process approach, for each variable (x, y), we need to restructure data into: event, start, stop, and var (x,y)/covariate value.

How can we run a multivariate model including x and y with 2 different data set, and more complicated if we have many more variables?

I really appreciate any help on this.

Thanks so much!

Hao

FU_TIMEEventX1X5Y1Y5

 

1 ACCEPTED SOLUTION

Accepted Solutions
sbxkoenk
SAS Super FREQ

Hello @haoduonge ,

 

I am not familiar enough with survival analysis to be able to answer the latter question.

I recommend you to <start a new topic> in the 'Statistical Procedures' board under 'Analytics' (and possibly to mark this topic as solved).

 

For your new topic / question you could use the title:

PHREG Counting Process Style of Input and binary time-varying covariate.

And in the body of your post you can ask what to do if the nature of your time-varying covariates does not allow you to align all values in the (T1,T2] intervals.

 

Of course you can also consider to use another style of input (and / or another style of model).

 

Kind regards,

Koen 

View solution in original post

7 REPLIES 7
sbxkoenk
SAS Super FREQ

Hello,

As nobody has answered you until now, I will try to help.

Just a remark first: It would have been better to post this question in the 'Statistical Procedures' board under the 'Analytics' heading. Probably you would have got an earlier answer there. This is just a reminder for your future questions on SAS/STAT procedures. Don't post / duplicate this question again as a new topic in the other board. [It will maybe be moved by someone having this power (the power to move between boards).]

To come back on your question:

Why are you talking about two different data sets?

And what's the problem to have multiple time varying (time dependent) covariates?

To me, your model statement in PROC PHREG can look like this:

 

/* Counting Process Style of Input */
model (T1,T2) * Status(0) = Treatment X1 X2 X3 X4 Z1 Z2 Z3;

 

where X1-X4 are fixed explanatory variables and Z1-Z3 are time-dependent covariates.

Why do you think you can only have one Z? Do you experience any problems when using >1 Z-var?

Or do you have a problem aligning Z1, Z2, Z3 (i.e. giving them all three a value for the same at-risk interval (T1,T2] )?

Kind regards,

Koen

haoduonge
Quartz | Level 8

Thanks so much for your reply.

I understand that for Z1-Z3, I need to restructure data, what if I have another set of Y1-Y3 - also time-dependent covariate.

Thanks again!

Hao

sbxkoenk
SAS Super FREQ

Hello,

Why can't you merge both data sets?

You merge keys would be the triple ( ID , T1 , T2 ).

Koen 

haoduonge
Quartz | Level 8

I will try that.

Thanks so much!!!

Hao

haoduonge
Quartz | Level 8

Hi,

It worked great for variables with same format z1-z3, y1-y3, thanks so much!

However, I have another variable, also time varying covariate but the format is not z1-z3 y1-y3.

For example, one person took a medication during the FU time, and the time before taking medication is counted as non-exposure time, and event=0, and time after taking med will be counted as exposure and their event =0 or 1, and its T1, T2 are different from those from z1-z3, y1-y3. 

Do you have way to cover this example?

Thanks!

Hao  

sbxkoenk
SAS Super FREQ

Hello @haoduonge ,

 

I am not familiar enough with survival analysis to be able to answer the latter question.

I recommend you to <start a new topic> in the 'Statistical Procedures' board under 'Analytics' (and possibly to mark this topic as solved).

 

For your new topic / question you could use the title:

PHREG Counting Process Style of Input and binary time-varying covariate.

And in the body of your post you can ask what to do if the nature of your time-varying covariates does not allow you to align all values in the (T1,T2] intervals.

 

Of course you can also consider to use another style of input (and / or another style of model).

 

Kind regards,

Koen 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 1757 views
  • 0 likes
  • 2 in conversation