[R] multi-level cox ph with time-dependent covariates

Mattia Prosperi ahnven at gmail.com
Wed Nov 3 21:38:23 CET 2010

Dear all,

I would like to know if it is possible to fit in R a Cox ph model with
time-dependent covariates and to account for hierarchical effects at
the same time. Additionally, I'd like also to know if it would be
possible to perform any feature selection on this model fit.

I have a data set that is composed by multiple marker measurements
(and hundreds of covariates) at different time points from different
tissue samples of different patients. Suppose that the data were
coming from animal model with very few subjects (n=6) that were
followed up given a pathogen exposure, measured several times,
sampling different tissues in the same days, until a certain outcome
was reached (or outcome censored). Suppose that the pathogen can vary
over time (might be a bacteria that selects for drug-resistance) and
that also it can vary across different tissue reservoirs within the
same patient.

In other words: names(data) = patient_id, start_time, stop_time,
tissue_id, pathogen_type, marker1, ..., marker100, ..., outcome

If I had multiple observations per patient at different time
intervals, I would model it like this (hope it is correct)


But now I have both the patient and the tissue, and hundreds of
different variables. I thought I could use the coxme library, since it
has also a ridge regression feature. Shall I then model nested random
effects by considering both the patient_id and the tissue_id?

Like model<-coxme(Surv(start_time,stop_time,outcome) ~ covariates + (1
| patient_id/tissue_id))

Then, how could I shrink the coefficients in order to select a subset
of them with non-neglegible effects? May I also consider the
possibility to run an AIC-based forward-backward selection?

thanks and apologies if I am completely out of the trails,


More information about the R-help mailing list