Re: [R] Schoenfeld residuals for a null model coxph

2012-02-24 Thread Terry Therneau
begin included message --- I have a coxph model like coxph(Surv(start, stop, censor) ~ x + y, mydata) I would like to calculate the Schoenfeld residuals for the null, i.e the same model where the beta hat vector (in practical terms, the coeff vector spat out by summary()) is constrained to

[R] Schoenfeld residuals for a null model coxph

2012-02-23 Thread Federico Calboli
Hi, I have a coxph model like coxph(Surv(start, stop, censor) ~ x + y, mydata) I would like to calculate the Schoenfeld residuals for the null, i.e the same model where the beta hat vector (in practical terms, the coeff vector spat out by summary()) is constrained to be all 0s --all lese

Re: [R] Schoenfeld Residuals with tied data

2009-06-16 Thread Bessy
Thank you for the reply. I really appreciate it. I calculated the Scoenfeld residual per event and my results are the following: finage race 17 -0.33942334 -2.0722187270.29024804 20 0.394600944 5.303968774 0.517689472 25

Re: [R] Schoenfeld Residuals with tied data

2009-06-16 Thread Terry Therneau
-- begin included message Thank you for the reply. I really appreciate it. I calculated the Scoenfeld residual per event and my results are the following: finage race 17 -0.33942334 -2.0722187270.29024804 20 0.394600944

[R] Schoenfeld Residuals with tied data

2009-06-15 Thread Bessy
Dear all, I am struggling with calculation of Schoenfeld residuals of my Cox Ph models. Based on the formula as attached, I calculated the Schoenfeld residuals for both non tied and tied data, respectively. And then I validated my results with R using the same data sets. However, I found that

Re: [R] Schoenfeld Residuals with tied data

2009-06-15 Thread Terry Therneau
Formally, the Schoenfeld residuals are defined as one residual per event time. I found that when there are tied events, however, that plots of the residuals could be hard to visually interpret: sometimes a residual was large because of a lack of fit at that point, sometimes because several

Re: [R] Schoenfeld residuals

2009-04-14 Thread Laura Bonnett
Hi, Thank you for your comments and apologies for the delay in replying. rem.Rcens =1 for the censored variables. The problem arises because I am not strictly looking at time to death. Instead I am looking at time to 12-month remission in epilepsy. Therefore a lot of people have the same event

Re: [R] Schoenfeld residuals

2009-04-06 Thread Terry Therneau
Laura Bonnett was kind enough to send me a copy of the data that caused the plotting error, since it was an error I had not seen before. 1. The latest version of survival gives a nicer error message: fit - coxph(Surv(rem.Remtime, rem.Rcens) ~ all.sex, nearma) cfit - cox.zph(fit) plot(cfit)

[R] Schoenfeld Residuals

2009-04-03 Thread Laura Bonnett
Dear All, Sorry to bother you again. I have a model: coxfita=coxph(Surv(rem.Remtime/365,rem.Rcens)~all.sex,data=nearma) and I'm trying to do a plot of Schoenfeld residuals using the code: plot(cox.zph(coxfita)) abline(h=0,lty=3) The error message I get is: Error in plot.window(...) : need

Re: [R] Schoenfeld Residuals

2009-04-03 Thread David Winsemius
I am not sure that ties are the only reason. If I create a few ties in the ovarian dataset that Therneau and Lumley provide, all I get are some warnings: ovarian[4:5, 1] - mean(ovarian[4:5, 1]) ovarian[6:8, 1] - mean(ovarian[6:8, 1]) fit - coxph( Surv(futime, fustat) ~ age + rx, ovarian)

Re: [R] Schoenfeld Residuals

2009-04-03 Thread Laura Bonnett
Thank you for your comments. I have about 200 out of 2000 tied data points which makes the situation more complicated! I'll have at look at the book section you referred to. With regards to making the ylim finite, I'm not sure how I can go about that given that I don't understand why it isn't