简体   繁体   中英

Permuted observations in Cox PH model in R

I have a data frame in the format required for coxph function in the survival package. The status of a subject can be either 0 (alive) or 1 (dead). I want to run a permutation on the status of subjects and re-run the analysis. In this case, one person who was alive for 10 time periods, might be assigned as dead for time period 6 now.

Should I specifically ask my code to ignore any observation after time period 6 for that person, or the coxph function itself does it automatically?

As Gregor suggested, I simply created a small table of data and checked if coxph automatically ignores the observations after the first failure for each subject. It turned out that not really. You have to remove those observations manually if the nature of your failure indicates that there is no recovery from it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM