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 |
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 |
... |
further arguments |
Value
An object of shrgamsp contains the following components.
-
coefficients
- A vector of estimated Covariate coefficients. -
frailparest
- A vector of estimated Frailty parameters i.e. frailty variance and correlation. -
vcov
- Variance Covariance matrix of the Estimated Covariate coefficients obtained from the observed information matrix. -
stderr
-A vector containing the Standard error of the Estimated parameters both covariate coefficients and frailty parameter. -
loglik0
- Log likelihood of without frailty model. -
loglik
-Log likelihood of Cox PH model with frailty. -
Iloglilk
- Log likelihood of with frailty model after integrating out the frailty term. -
bhaz
- an array containing unique event times and estimated baseline hazard. -
X
-Matrix of observed covariates. -
time
-the observed survival time. -
censor
-censoring indicator. -
resid
-the martingale residuals. -
lin.prid
-the vector of linear predictors. -
frail
-estimated Frailty values. -
iteration
-Number of outer iterations. -
e.time
-the vector of unique event times. -
n.event
- the number of events at each of the unique event times. -
convergence
-an indicator of convergence . seenlminb
.
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
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