~ubuntu-branches/ubuntu/trusty/r-cran-rms/trusty

« back to all changes in this revision

Viewing changes to man/residuals.cph.Rd

  • Committer: Package Import Robot
  • Author(s): Dirk Eddelbuettel
  • Date: 2014-01-22 14:16:13 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20140122141613-frc51dglkjfisik0
Tags: 4.1-1-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
\code{\link{cph}}, \code{\link[survival]{coxph}}, \code{\link[survival]{residuals.coxph}}, \code{\link{cox.zph}}, \code{\link{naresid}}
62
62
}
63
63
\examples{
64
 
# fit <- cph(Srv(start, stop, event) ~ (age + surgery)* transplant, 
 
64
# fit <- cph(Surv(start, stop, event) ~ (age + surgery)* transplant, 
65
65
#            data=jasa1)
66
66
# mresid <- resid(fit, collapse=jasa1$id)
67
67
 
83
83
d.time <- pmin(d.time, cens)
84
84
 
85
85
 
86
 
f <- cph(Srv(d.time, death) ~ age + blood.pressure + cholesterol, iter.max=0)
 
86
f <- cph(Surv(d.time, death) ~ age + blood.pressure + cholesterol, iter.max=0)
87
87
res <- resid(f) # This re-inserts rows for NAs, unlike f$resid
88
88
yl <- quantile(res, c(10/length(res),1-10/length(res)), na.rm=TRUE)
89
89
# Scale all plots from 10th smallest to 10th largest residual
98
98
 
99
99
 
100
100
# Assess PH by estimating log relative hazard over time
101
 
f <- cph(Srv(d.time,death) ~ age + sex + blood.pressure, x=TRUE, y=TRUE)
 
101
f <- cph(Surv(d.time,death) ~ age + sex + blood.pressure, x=TRUE, y=TRUE)
102
102
r <- resid(f, "scaledsch")
103
103
tt <- as.numeric(dimnames(r)[[1]])
104
104
par(mfrow=c(3,2))