crrFits: 'crr' model selection table

View source: R/stat.R

crrFitsR Documentation

crr model selection table

Description

Return several types of fit statistics for a crr saturated model compared to the null model. Note that comparisons among models only make sense for ones fit to the same data set.

Usage

crrFits(..., p)

Arguments

...

one or more objects of class crr

p

an optional penalty term to be multiplied by, k, the number of free parameters estimated in each model including the intercept term

References

Scrucca L, Santucci A, Aversa F (2009). Regression Modeling of Competing Risk Using R: An In Depth Guide for Clinicians. Bone Marrow Transplantation (2010) 45, 1388-1395.

See Also

crrfit; crrwald.test

Examples

## Not run: 
## example, figures, tables from
## http://www.nature.com/bmt/journal/v45/n9/full/bmt2009359a.html

bmt <- read.csv('http://www.stat.unipg.it/luca/misc/bmtcrr.csv')
bmt <- within(bmt, {
  Sex <- relevel(Sex, 'M')
  Phase <- relevel(Phase, 'Relapse')
})
cov1 <- with(bmt, model.matrix(~ Age + Sex + D + Phase + Source)[, -1])

m1 <- with(bmt, crr(ftime, Status, cov1))
summary(m1)
crrwald.test(m1, c(Phase = 'Phase'))

## model selection
m2 <- with(bmt, crr(ftime, Status, cov1[, c(4:6)]))
m3 <- with(bmt, crr(ftime, Status, cov1[, c(4:6, 7)]))
m4 <- with(bmt, crr(ftime, Status, cov1[, c(4:6, 7, 1)]))
m5 <- with(bmt, crr(ftime, Status, cov1[, c(4:6, 7, 2)]))
m6 <- with(bmt, crr(ftime, Status, cov1[, c(4:6, 7, 3)]))

crrFits(m1, m2, m3, m4, m5, m6, p = 3)


par(mfrow = c(2, 2))
with(m2, {
  for (ii in seq.int(ncol(res)))
    scatter.smooth(uftime, res[, ii], main = names(coef)[ii],
                   xlab = 'Failure time', ylab = 'Schoenfeld residuals')
})

pred <- with(bmt, model.matrix(~ levels(Phase)))[, -1L]
pred <- predict(m2, pred)

plot(
  pred, col = 1:4, lty = 1, ylim = c(0, 1),
  xlab = 'Failure time', ylab = 'CIF'
)
legend(
  'top', lty = 1L, col = 1:4, horiz = TRUE, bty = 'n',
  title = 'Phase', legend = levels(bmt$Phase),
  x.intersp = 0.1, y.intersp = 0.5
)

## End(Not run)


raredd/cmprsk2 documentation built on March 29, 2024, 5:34 a.m.