Learn R Programming

frailtypack (version 2.7.1)

timedep: Identify time-varying effects

Description

This is a special function used in the context of Cox models and shared and joint frailty models. It identifies time-varying effects of covariates in the model. It is used in 'frailtyPenal' on the right hand side of formula or of formula.terminalEvent. When considering time-varying effects in a survival model, regression coefficients can be modeled with a linear combination of B-splines $B(t)$ with coefficients $\zeta$ of order $q$ with $m$ interior knots : $$\beta(t)=\sum_{j=-q+1}^m\zeta_jB_{j,q}(t)$$ You can notice that a linear combination of B-splines of order 1 without any interior knots (0 interior knot) is the same as a model without time-varying effect (or with constant effect over time). Statistical tests (likelihood ratio tests) can be done in order to know whether the time-dependant coefficients are significantly different from zero or to test whether a covariate has a time-dependant effect significantly different from zero or not. These tests are correct only with a parametric approach yet. - Proportional Hazard assumption ? Time-dependency of a covariate effect can be tested. We need to estimate $m+q$ parameters $\zeta_j$ for $j=-q+1,...,m$ for a time-varying coefficient. Only one ($q=1$,$m=0$) parameter is estimated for a constant effect. A global test is done. $$H_0:\beta (t)=\beta$$ The corresponding LR statistic has a $\chi^2$ distribution of degree $m+q-1$. - Significant association ? We can also use a LR test to test whether a covariate has a significant effect on the hazard function. The null hypothesis is : $$H_0:\beta (t)=0$$ For that we fit a model considering the covariate with a regression coefficent modeled using B-splines and a model without the covariate. Hence, the LR statistic has a $\chi^2$ distribution of degree $m+q$.

Usage

timedep(x)

Arguments

x
A numerical or a factor variable that would have a time-varying effect on the event

Value

  • xA variable identified with a time-varying effect

References

Y. Mazroui, A. Mauguen, S. Mathoulin-Pelissier, G. MacGrogan, V. Brouste, V. Rondeau (2013). Time-varying coefficients in a multivariate frailty model: Application to breast cancer recurrences of several types and death. To appear.

Examples

Run this code
data(readmission)

###--- Shared Frailty model with time-varying effect ---###

sha.time <- frailtyPenal(Surv(time,event)~cluster(id)+dukes+charlson+
timedep(sex)+chemo,data=readmission,n.knots=8,kappa=1,
betaknots=3,betaorder=1)

#-- print results of the fit and the associated curves for the
#-- time-dependant effects
print(sha.time)

###--- Joint Frailty model with time-varying effect ---###

joi.time <- frailtyPenal(Surv(time,event)~cluster(id)+timedep(sex)+
chemo+terminal(death),formula.terminalEvent=~timedep(sex)+chemo,
data=readmission,n.knots=8,kappa=c(1,1),betaknots=3,betaorder=1)

print(joi.time)

Run the code above in your browser using DataLab