shrgamsp {bcfrailph}R Documentation

Cox PH model with univariate and bivariate shared gamma frailty model.

Description

Fit Cox PH model with univariate and bivariate shared gamma frailty model.

Usage

shrgamsp(
  formula,
  data,
  weights = NULL,
  initfrailp = NULL,
  control = bcfrailph.control(),
  ...
)

Arguments

formula

A formula object, with the response on the left of a ~ operator, and the terms on the right. The response must be a survival object as returned by the Surv function.

data

A dataframe contain survival time, censor, covariate etc with data in columns.

weights

vector of case weights for gamma model. the default is NULL.

initfrailp

Initial estimates for the frailty parameters. The default is c(0.5).

control

Arguments to control the fit. The default is bcfrailph.control.

...

further arguments

Value

An object of shrgamsp contains the following components.

Note

This is just a coxph model with gamma frailty and the differences between coxph with gamma frailty fit and shrgamsp fit is on the standard errors of the covariates cofficients. Here, the standard errors of the estimated covariate coefficients and the frailty variance parameter are obtained using the standard errors estimation approach given in Klein and Moeschberger (2003).

References

Duchateau, L., Janssen, P. (2008) The Frailty Model. Springer, New York.

Klein, J. P., and Moeschberger, M. L. (2003), Survival analysis: techniques for censored and truncated data, New York: Springer.

See Also

bcfrailph

Examples

set.seed(2)
n1=500;IID=array(1:n1)
X1<-runif(n1,  min=0, max=1)
z=rgamma(n1,shape=2,scale=0.5)
u1<-runif(n1,  min=0, max=1)
time<- 1/0.1*log(1-0.1*log(u1)/(0.0001*exp(3*X1)*z))
censor=rep(1,n1)
dataa <- data.frame(time=time, X1=X1,censor=censor,IID=IID)

fitcoxfr=shrgamsp(Surv(time,censor)~ X1+frailty(IID) ,data=dataa)
fitcoxfr


[Package bcfrailph version 0.1.1 Index]