cfboost: Likelihood Based Boosting for Flexible, Structured Survival...

Description Usage Arguments Details Value References See Also Examples

View source: R/cfboost.R

Description

Likelihood-based boosting algorithm to fit flexible, structured survival models with component-wise linear or P-spline base-learners. Variable selection and model choice are built in features.

Usage

1
2
3
4
cfboost(x, ...)
## S3 method for class 'formula'
cfboost(formula, data = list(), weights = NULL,
   na.action = na.omit, control = boost_control(), ...)

Arguments

x

an object to be pased to cfboost.formula.

formula

formula of the model to be fit. The response y must be of class Surv. The model is specified using the base-learner bols and bbs.

data

data frame. Contains the data of the model that is to be fitted.

weights

integer vector. Optional weights of the observations in data. Currently only weights 0 or 1 are supported. See Details.

na.action

a function that defines how to handle NAs in the data.

control

an object of class boost_control.

...

further arguments to be passed to subfunctions.

Details

A structured, flexible Cox-type survival model is fitted to the data by likelihood-based boosting. The (component-wise) base-learners are specified via the formula. Examples for the specification of base-learners can be found either in bols or in bbs.

The weights (a.t.m.) can only be used to specify a learning sample which consists of observations with weights == 1 and and an out-of-bag sample with weights == 0. The latter can for example be used to determine the appropriate stopping iteration of the algorithm.

Value

An object of class cfboost is returned:

data

data object after data pre-processing (a list of class boost_data).

ensemble

vector of selected base-learners.

ensembless

list of coefficient estimates for each iteration. Only the coefficient of the selected base-learner is stored; i.e., ensembless[[i]] is the coefficient vector of base-learner ensemble[i] (in iteration i).

fit

vector of fitted values (in the last iteration).

offset

offset value.

control

control parameters as specified.

response

the specified response variable (an object of class Surv).

risk

vector of the risk (negative log likelihood) computed on the training or validation sample (see boost_control).

weights

weights used for model fitting.

df

matrix of estimated degrees of freedom for smooth base-learners.

coefs

(list of) estimated coefficients (in the final boosting iteration).

predict

function for prediction (to be accessed via predict).

call

the model call.

References

Benjamin Hofner, Torsten Hothorn and Thomas Kneib (2008), Variable Selection and Model Choice in Structured Survival Models. Department of Statistics, Technical Report No. 43. http://epub.ub.uni-muenchen.de/7901/

See Also

boost_control for the control arguments for cfboost and bols or bbs for the available base-learners. Methods to process the output can be found in methods. A complete example can be found in CoxFlexBoost-package.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
## a simple example (without time-varying effects)

set.seed(1234)

## sample covariates first
X <- matrix(NA, nrow=400, ncol=3)
X[,1] <- runif(400, -1, 1)
X[,2] <- runif(400, -1, 1)
X[,3] <- runif(400, -1, 1)

## time-dependent hazard rate
lambda <- function(time, x){
  exp(0 * time + 0.7 * x[1] + x[2]^2)
}

## specify censoring function
cens_fct <- function(time, mean_cens){
  censor_time <- rexp(n = length(time), rate = 1/mean_cens)
  event <- (time <= censor_time)
  t_obs <- apply(cbind(time, censor_time), 1, min)
  return(cbind(t_obs, event))
}
data <- rSurvTime(lambda, X, cens_fct, mean_cens = 5)

ctrl <- boost_control( mstop = 100, risk="oobag")
weights <- sample(c(0,1), 400, replace=TRUE, prob=c(0.25, 0.75))

## fit (a simple) model
model <- cfboost(Surv(time, event) ~ bbs(x.1) + bbs(x.2) + bbs(x.3),
                 control = ctrl, data = data, weights = weights)

model <- model[mstop(model)]
summary(model)

## fit (a simple) model with model choice
## i.e., with decomposition of base-learners
model_2 <- cfboost(Surv(time, event) ~ bols(x.1) + bbs(x.1, df=1, center=TRUE)
                   + bols(x.2) + bbs(x.2, df=1, center=TRUE)
                   + bols(x.3) + bbs(x.3, df=1, center=TRUE),
                   control = ctrl, data = data, weights = weights)

model_2 <- model_2[mstop(model_2)]
## only bols(x.1) and bbs(x.2, ...)  are selected (as desired)
summary(model_2)

CoxFlexBoost documentation built on May 2, 2019, 6:53 p.m.