Description Usage Arguments Details Value Note References See Also Examples
Defines a P-spline base-learner for boosting flexible, structured survival models. Both, time-constant base-learners and time-varying effects (and thus the baseline hazard) can be specified.
1 2 3 |
x |
factor or numeric. A vector containing data. |
z |
factor or numeric. A vector containing data. |
knots |
a single numerical value defines the number of
equidistant interior knots of the P-spline, a vector defines the
knots itself, or |
degree |
degree of the P-spline. |
differences |
order of the difference penalty used for the P-spline. Accepted values are 1,2 and 3. |
df |
degrees of freedom. Used to specify the smoothness of the
base-learner. Lower values for |
center |
logic. If |
xname |
optional. Name of the variable given in |
zname |
optional. Name of the variable given in |
timedep |
logic. If |
... |
further arguments passed to |
The function bbsTime(...)
is a wrapper to bbs(..., timedep=TRUE)
.
Time-dependent base-learners can be utilzed to specify the (log-)
baseline hazard rate or time-varying effects. In the first case,
the base-learner is specified as bbsTime(time, z = NULL, ...)
and in the later case, the covariate with a (potential) time-dependent
effect is specified as z
.
In most settings the number of knots
should not exceed 20,
to keep the computational burden in a reasonable dimension. Thus,
a warning
is issued if more knots are used.
An object of class baselearner
(and class bbs
) is
returned. It consits of the design matrix of the base-learner. Further
elements are returned as attributes (see attr
) of the object.
The attributes are mainly for internal use. They consist, for example,
of the degrees of freedom df
. The corresponding value for
lambda
and the penalty (pen
) are stored as further
attributes. The current coefficient estimates are stored in
the base-learner as attr(...,"coefs")
.
The degrees of freedom df
are used to compute the corresponding
smoothing parameter for the used P-spline. For more details see
Hofner et al..
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/
Thomas Kneib, Torsten Hothorn and Gerhard Tutz (2008), Variable selection and model choice in geoadditive regression models. Biometrics. To appear. http://epub.ub.uni-muenchen.de/2063/
bols
for linear base-learners and
cfboost
for the boosting algorithm.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | x1 <- rnorm(100)
time <- rexp(100,1)
event <- sample(c(0,1), 100, replace=TRUE)
y <- Surv(time,event)
## example for time-constant base-learner
str(bbs(x1, knots = 20, df = 4))
## decomposition of a base-learner
decomp <- y ~ bols(x1) + bbs(x1,knots = 20, df = 1, center = TRUE)
## P-spline base-learner for the (log) baseline hazard
str(bbsTime(time)) # the same as bbs(time, timedep=TRUE)
## example for time-varying effect for x1
str(bbsTime(time, z = x1))
## decomposition of a time-varying effect
decomp <- y ~ bolsTime(time, z = x1) + bbsTime(time, z = x1, df = 1, center = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.