Description Usage Arguments Details Value Author(s) References See Also Examples
A regularization approach for Cox Frailty Models by penalization methods is provided.
1 2 
fix 
a twosided linear formula object describing the unpenalized
fixed (timeconstant) effects part of the model, with the response on the left of a

rnd 
a twosided linear formula object describing the
randomeffects part of the model, with the grouping factor on the left of a

vary.coef 
a onesided linear formula object describing the
timevarying effects part of the model, with the timevarying terms, separated by 
data 
the data frame containing the variables named in the three preceding

xi 
the overall penalty parameter that controls the strenght of both penalty terms in ξ*J(ζ,α) and, hence, controls the overall amount of smoothness (up to constant effects) and variable selection for a given proportion ζ. The optimal penalty parameter is a tuning parameter of the procedure that has to be determined, e.g. by Kfold cross validation. (See details or the quick demo for an example.) 
adaptive.weights 
a twocolumn matrix of adaptive weights passed to the procedure; the first column contains the weights w_k, the second column the weights v_k from ξ*J(ζ,α). If no adaptive weights are specified all weights are set to one. The recommended strategy is to first fit an unpenalized model (i.e. ξ=0) and then use the obtained adaptive weights (see value section) when fitting the model for all other combinations of ξ and ζ. 
control 
a list of control values for the estimation algorithm to replace the default values returned by the function 
The pencoxfrail
algorithm is designed to investigate
the effect structure in the Cox frailty model, which is a
widely used model that accounts for heterogeneity in survival data.
Since in survival models one has to account for possible variation of
the effect strength over time the selection of the relevant features distinguishes between the folllowing cases:
covariates can have timevarying effects, can have timeconstant effects
or be irrelevant. For this purpose, the following specific penality is applied on the vectors of Bspline coefficients α_k, assuming k=1,...,r different, potentially timevarying effects, each expanded in M Bspline basis functions:
ξ*J(ζ,α) = ξ * { ζ * ∑_k ψ * w_k * Δ_M*α_k_2 + (1ζ) * ∑_k φ* v_k * α_k_2 }.
This penalty is able to distinguish between these types of effects to obtain a sparse representation that includes the relevant effects in a proper form.
The penalty is depending on two tuning parameters, ξ and ζ, which have to be determined by a suitable technique, e.g. by (2dimensional) Kfold cross validation.
The first term of the penalty controls the smoothness of the timevarying covariate effects, whereby for values of ξ and ζ large enough, all differences (α_k,l  α_k,l1), l=2,... ,M, are removed from the model, resulting in constant covariate effects. As the Bsplines of each variable with varying coefficients sum up to one, a constant effect is obtained if all spline coefficients are set equal. Hence, the first penalty term does not affect the spline's global level. The second term penalizes all spline coefficients belonging to a single timevarying effect in the way of a group LASSO and, hence, controls the selection of covariates.
Package:  pencoxfrail 
Type:  Package 
Version:  1.0.1 
Date:  20160506 
License:  GPL2 
LazyLoad:  yes 
for loading a dataset type data(nameofdataset)
Generic functions such as print
, predict
, plot
and summary
have methods to show the results of the fit.
The predict
function uses also estimates of random effects for prediction, if possible (i.e. for known subjects of the grouping factor).
Either the survival stepfunction or the baseline hazard (not cumulative!) can be calculated by specifying one of two possible methods: method=c("hazard","survival")
. By default, for each new subject in new.data
an individual stepfunction is calculated on a prespecified time grid, also accounting for covariate changes over time. Alternatively, for new.data
a single vector of a specific (timeconstant) covariate combination can be specified.
Usage:
predict(pencoxfrail.obj,new.data,time.grid,method=c("hazard","survival"))
The plot
function plots all timevarying effects, including the baseline hazard.
call 
a list containing an image of the 
baseline 
a vector containing the estimated Bspline coefficients of the baseline hazard.
If the covariates corresponding to the timevarying effects are centered (and standardized, see 
time.vary 
a vector containing the estimated Bspline coefficients of all timevarying effects.
If the covariates corresponding to the timevarying effects are standardized (see 
coefficients 
a vector containing the estimated fixed effects. 
ranef 
a vector containing the estimated random effects. 
Q 
a scalar or matrix containing the estimates of the random effects standard deviation or variancecovariance parameters, respectively. 
Delta 
a matrix containing the estimates of fixed and random effects (columns) for each iteration (rows) of the main algorithm (i.e. before the final reestimation step is performed, see details). 
Q_long 
a list containing the estimates of the random effects variancecovariance parameters for each iteration of the main algorithm. 
iter 
number of iterations until the main algorithm has converged. 
adaptive.weights 
If ξ=0, a twocolumn matrix of adaptive weights is calculated; the first column contains the weights w_k, the second column the weights v_k from ξ*J(ζ,α). If ξ>0, the adaptive weights that have been used in the function's argument are displayed. 
knots 
vector of knots used in the Bspline representation. 
Phi.big 
large Bspline design matrix corresponding to the baseline hazard and all timevarying effects. For the timevarying effects, the Bspline functions (as a function of time) have already been multiplied with their associated covariates. 
time.grid 
the time grid used in when approximating the (Riemann) integral involved in the model's full likelihood. 
m 
number of metric covariates with timevarying effects. 
m2 
number of categorical covariates with timevarying effects. 
Andreas Groll [email protected]
Groll, A., T. Hastie and G. Tutz (2016). Regularization in Cox Frailty Models. LudwigMaximiliansUniversity. Technical Report 191.
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  ## Not run:
data(lung)
# remove NAs
lung < lung[!is.na(lung$inst),]
# transform inst into factor variable
lung$inst < as.factor(lung$inst)
# Random institutional effect
fix.form < as.formula("Surv(time, status) ~ 1")
vary.coef < as.formula("~ age")
pen.obj < pencoxfrail(fix=fix.form,vary.coef=vary.coef, rnd = list(inst=~1),
data=lung, xi=10,control=list(print.iter=TRUE))
# show fit
plot(pen.obj)
# predict survival curve of new subject, institution 1 and up to time 500
pred.obj < predict(pen.obj,newdata=data.frame(inst=1,time=NA,status=NA,age=26),
time.grid=seq(0,500,by=1))
# plot predicted hazard function
plot(pred.obj$time.grid,pred.obj$haz,type="l",xlab="time",ylab="hazard")
# plot predicted survival function
plot(pred.obj$time.grid,pred.obj$survival,type="l",xlab="time",ylab="survival")
# see also demo("pencoxfrailpbc")
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.