crrstep-package: Stepwise regression procedure for the Fine & Gray regression...

Description Details Author(s) References Examples

Description

Performs forward and backward stepwise regression for the Fine & Gray regression model in competing risks. Procedure uses AIC, BIC and BICcr as selection criteria. BICcr has a penalty of k = log(n*), where n* is the number of Type I events.

Details

Package: crrstep
Type: Package
Version: 2014-07.16
Date: 2014-07.16
License: GPL (version 2)
LazyLoad: yes

The package contains a singe function crrstep, which implements backward and forward stepwise regression for the Fine & Gray regression model. The Fine & Gray model (Fine & Gray, 1999) estimates the hazard that corresponds to the cumulative incidence function of a certain event type. Selection criteria that are can be used are: AIC, BIC and BICcr. BICcr is a selection criteria based on the work by Volinksy and Raftery in which the penalty is k = log(n*), where n* is the total number of Type I events.

Author(s)

Ravi Varadhan & Deborah Kuk.

Maintainers: Ravi Varadhan <[email protected]>

References

Fine, J. P. and Gray, R. J. (1999). A proportional hazards model for the subdistribution of a competing risk. Journal of the American Statistical Association.

Volinsky, C. T. and Raftery, A. E. (2000). Bayesian information criterion for censored survival models. Biometrics.

Kuk, D. and Varadhan, R. (2013). Model selection in competing risks regression. Statistics in Medicine.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
set.seed(123)
n <- 500
ftime <- rexp(n)
fstatus <- sample(0:2,n,replace=TRUE)
cov1 <- matrix(runif(5*n),nrow=n)
x61 <- as.factor(sample(3, size=n, rep=TRUE))
x71 <- as.factor(sample(5, size=n, rep = TRUE))
cov1 <- cbind(cov1, x61, x71)
dimnames(cov1)[[2]] <- c('x1','x2','x3','x4','x5', 'x6', 'x7')
formula1 <- ftime ~ 1 + x1 + x2 + x3 + x4 + x5 + as.factor(x6) + as.factor(x7) 

crrstep(formula1, , fstatus, data = as.data.frame(cov1), direction = "backward", criterion = "BIC")
crrstep(formula1, , fstatus, data = as.data.frame(cov1), direction = "backward", criterion = "AIC")

ans2 <- crrstep(formula1, , fstatus, data = as.data.frame(cov1), direction = "forward", 
		failcode=2, criterion = "AIC")
ans2

Example output

Loading required package: cmprsk
Loading required package: survival
crrstep(formula = formula1, etype = fstatus, data = as.data.frame(cov1), 
    direction = "backward", criterion = "BIC")
                   BIC
-as.factor(x7) 2019.46
-as.factor(x6) 2031.49
-x2            2037.61
-x1            2037.66
-x3            2037.75
-x4            2038.72
-x5            2042.07
<none>         2043.62
[1] "as.factor(x7)"

Step: BIC= 2019.46
crr(ftime = ftime, fstatus = fstatus, cov1 = cov3.2, variance = TRUE)

                   BIC
-as.factor(x6) 2007.41
-x2            2013.46
-x1            2013.51
-x3            2013.65
-x4            2014.50
-x5            2017.91
<none>         2019.46
[1] "as.factor(x6)"

Step: BIC= 2007.41
crr(ftime = ftime, fstatus = fstatus, cov1 = cov3.2, variance = TRUE)

           BIC
-x2    2001.38
-x1    2001.46
-x3    2001.62
-x4    2002.50
-x5    2005.73
<none> 2007.41
[1] "x2"

Step: BIC= 2001.38
crr(ftime = ftime, fstatus = fstatus, cov1 = cov3.2, variance = TRUE)

           BIC
-x1    1995.42
-x3    1995.67
-x4    1996.44
-x5    1999.63
<none> 2001.38
[1] "x1"

Step: BIC= 1995.42
crr(ftime = ftime, fstatus = fstatus, cov1 = cov3.2, variance = TRUE)

           BIC
-x3    1989.76
-x4    1990.52
-x5    1993.50
<none> 1995.42
[1] "x3"

Step: BIC= 1989.76
crr(ftime = ftime, fstatus = fstatus, cov1 = cov3.2, variance = TRUE)

           BIC
-x4    1984.91
-x5    1988.12
<none> 1989.76
[1] "x4"

Step: BIC= 1984.91
crr(ftime = ftime, fstatus = fstatus, cov1 = cov3.2, variance = TRUE)

           BIC
-x5    1983.45
<none> 1984.91
[1] "x5"
[1] "The best model is the NULL model and the likelihood is:-991.73"

Step: BIC= 1978.7
crr(ftime = ftime, fstatus = fstatus, cov1 = cov3.2, variance = TRUE)


$coefficients
NULL

$log.likelihood
[1] -989.35

$coefficients
NULL

$log.likelihood
[1] -989.35

crrstep(formula = formula1, etype = fstatus, data = as.data.frame(cov1), 
    direction = "backward", criterion = "AIC")
                   AIC
-as.factor(x7) 1989.96
-as.factor(x6) 1993.56
-x2            1995.46
-x1            1995.51
-x3            1995.61
-x4            1996.58
<none>         1997.26
-x5            1999.92
[1] "as.factor(x7)"

Step: AIC= 1989.96
crr(ftime = ftime, fstatus = fstatus, cov1 = cov3.2, variance = TRUE)

                   AIC
-as.factor(x6) 1986.34
-x2            1988.17
-x1            1988.22
-x3            1988.36
-x4            1989.21
<none>         1989.96
-x5            1992.62
[1] "as.factor(x6)"

Step: AIC= 1986.34
crr(ftime = ftime, fstatus = fstatus, cov1 = cov3.2, variance = TRUE)

           AIC
-x2    1984.52
-x1    1984.60
-x3    1984.76
-x4    1985.64
<none> 1986.34
-x5    1988.87
[1] "x2"

Step: AIC= 1984.52
crr(ftime = ftime, fstatus = fstatus, cov1 = cov3.2, variance = TRUE)

           AIC
-x1    1982.78
-x3    1983.03
-x4    1983.79
<none> 1984.52
-x5    1986.99
[1] "x1"

Step: AIC= 1982.78
crr(ftime = ftime, fstatus = fstatus, cov1 = cov3.2, variance = TRUE)

           AIC
-x3    1981.33
-x4    1982.09
<none> 1982.78
-x5    1985.08
[1] "x3"

Step: AIC= 1981.33
crr(ftime = ftime, fstatus = fstatus, cov1 = cov3.2, variance = TRUE)

           AIC
-x4    1980.70
<none> 1981.33
-x5    1983.90
[1] "x4"

Step: AIC= 1980.7
crr(ftime = ftime, fstatus = fstatus, cov1 = cov3.2, variance = TRUE)

           AIC
<none> 1980.70
-x5    1983.45

$coefficients
   estimates std.error t-stat
x5     0.565     0.253   2.23

$log.likelihood
[1] -989.35

$coefficients
   estimates std.error t-stat
x5     0.565     0.253   2.23

$log.likelihood
[1] -989.35

crrstep(formula = formula1, etype = fstatus, failcode = 2, data = as.data.frame(cov1), 
    direction = "forward", criterion = "AIC")
NULL
                   AIC
<none>         1794.03
+as.factor(x7) 1794.52
+x1            1795.73
+x4            1795.79
+x2            1795.96
+x3            1796.01
+x5            1796.02
+as.factor(x6) 1796.29
[1] "The best model is the NULL model and the likelihood is:-897.01"
$coefficients
NULL

$log.likelihood
[1] -897.01

crrstep documentation built on May 29, 2017, 8 p.m.