Learn R Programming

frailtypack (version 2.7.1)

num.id: Identify individuals in Joint model for clustered data

Description

This is a special function used in addition to the cluster() function in the context of survival joint models for clustered data. This function identifies subject index. It is used on the right hand side of a 'frailtyPenal' formula. Using num.id() in a formula implies that a joint frailty model for clustered data is fitted (Rondeau et al. 2011).

Usage

num.id(x)

Arguments

x
A character or numeric variable which is supposed to indicate the variable identifying individuals

References

V. Rondeau, J.P. Pignon, S. Michiels (2011). A joint model for the dependance between clustered times to tumour progression and deaths: A meta-analysis of chemotherapy in head and neck cancer. Statistical methods in medical research 897, 1-19.

See Also

frailtyPenal

Examples

Run this code
data(readmission)
#-- here is a generated cluster (31 clusters of 13 subjects)
readmission <- transform(readmission,group=id%%31+1)

###--- Joint Frailty model for clustered data ---###

#-- splines
joi.clus <- frailtyPenal(Surv(t.start,t.stop,event)~
cluster(group)+num.id(id)+dukes+charlson+sex+chemo+terminal(death),
formula.terminalEvent=~dukes+charlson+sex+chemo,
data=readmission,recurrentAG=TRUE,
n.knots=10,kappa=c(2.11e+08,9.53e+11))

Run the code above in your browser using DataLab