Andersen-Gill - multistate and time varying covariate

Hi

I understand that the cph function of rms allows me to solve this problem. I do not know how to create the covariate matrix. I cannot find the solution from the vignette of the rms package and the book.

I also do not understand the time-varying example of the cph() function. Why the failure times are 1:10? I do not think that I have to order the failure time in order to do the analysis. The data structures are different from what I read from other books or paper. For survival package, we use start and stop time for building a cox model with time-varying covariate. I can only have two types of events - 0/1. I think only cph() can solve my problem. Alternatively, I do the compromised analysis (2 types of outcomes) and convert it to an cph() fit object to benefit from the rest of the rms facilities.

Many thanks for any possible help.

Best wishes

Sandro

Please move this to the end of datamethods.org/rms and I’ll remove it here. That’s the page for rms software questions.

Hi Professor Harrell

Please excuse me for not knowing how to move this post to rms.

I still do not understand why the failure.time of the cph() example. Why they are 1:10?

However, I guess I solved two questions. I use more than two types of events. Then I state the even of interest like event=“death”. I learn this from an example of the older version of your rms notes. I state the command as if I were using the survival package, then I add surv=T, x=T, y=T into the option and I get what I wanted :).

The package claims to be able to convert the fit object to and fro the two packages did not work. Now, I can use the facilities you heartedly created.

Best wishes

Sandro

Copy and paste then I’ll remove this post

Dear Frank @f2harrell, apologies for hijacking the question, but may I please advise against this practice?
I have seen you ask it before, and I don’t use RMS enough to feel like I have a say, but I think this approach is suboptimal in terms of knowledge management. The conversation in that discussion page prolongs, making it harder to scroll down and find new questions; different discussions end up intertwined in the linear page, making it harder to follow; and I think it is harder for Google to come up with results when searching from outside Discourse.
I personally believe a stackoverflow-like discussion management would be better - let users ask their questions in dedicated posts and make them use an rms tag, rather than force all rms related questions into a single long thread.

Just putting it out there for you to consider. Thank you.

I agree 60% with you :grinning:

I agree with you in terms of science. However, there is only ONE Professor Harrell. You cannot expect that he is a super statistician and also in informatics?

Sandro

1 Like