| simstdybcf {bcfrailph} | R Documentation |
Simulation study for bivariate correlated frailty models.
Description
Simulation study for bivariate correlated gamma and lognormal frailty models with and without covariates.
Usage
simstdybcf(
Rep,
mfit = NULL,
psize,
cenr = c(0),
beta = c(0.5),
frailty,
frailpar = c(0.5, 0.25),
bhaz = c("weibull"),
bhazpar = list(shape = c(0.5), scale = c(0.01)),
covartype = c("B"),
covarpar = list(fargs = c(1), sargs = c(0.5)),
inpcovar = NULL,
inpcen = NULL,
comncovar = NULL
)
Arguments
Rep |
number of replications. |
mfit |
A type of frailty model to be fit in addition to |
psize |
pair size. |
cenr |
censored rate. The default is zero.. |
beta |
Covariate coefficient. |
frailty |
A type of frailty distribution to be used. Either gamma or lognormal. |
frailpar |
vector of frailty parameters, variance and correlation respectively. The default is c(0.5,0.25) meaning variance 0.5 and correlation 0.25. |
bhaz |
A type of baseline hazard distribution to be used. it can be weibull, gompertz or exponential. |
bhazpar |
is a |
covartype |
specified the distribution from which covariate(s) are goining to be sampled. covartype can be c("B","N","U")denoting binomial, normal or uniform, respectively. For example, |
covarpar |
is a |
inpcovar |
is a |
inpcen |
is a |
comncovar |
if common covariates are needed. |
Value
An object of class simstdybcf that contain the following:
Resulta summary result containing true parameter, mean of estimates, mean of the standard errors of the estimates, standard deviation of estimates, and 95% CI coverage probability.estimatesa matrix containing estimates of parameters at each replications.estimateSEa matrix containing standard error of estimates at each replications.coveragea matrix containing an indicator whether the true parameter lies within a 95% CI at each replications or not.TMATa matrix containing the generated artificial unique event times at each replications for gamma model.h0MATa matrix containing the estimated baseline hazards at each replications for gamma model.h0SEMATa matrix containing SE of the estimated baseline hazards at each replications for gamma model.
See Also
Examples
set.seed(2)
sim<-simstdybcf(Rep=5,psize=100, cenr= c(0.2),beta=c(1,-0.7,0.5),
frailty=c("lognormal"),frailpar=c(0.5,-0.25),bhaz=c("exponential"),
bhazpar=list(scale = c(0.1)),covartype= c("N","N","B"),
covarpar=list(fargs=c(0,0,1),sargs=c(1,1,0.5)),comncovar=2)
Res<-sim$Result
Res
# In addition to bcfrailph fit, if coxph with univariate lognormal frailty model is desired to run,
sim<-simstdybcf(Rep=5,mfit="cox",psize=100, cenr= c(0.2),beta=c(1,-0.7,0.5),
frailty=c("lognormal"),frailpar=c(0.5,-0.25),bhaz=c("exponential"),
bhazpar=list(scale = c(0.1)),covartype= c("N","N","B"),
covarpar=list(fargs=c(0,0,1),sargs=c(1,1,0.5)),comncovar=2)
Res<-sim$Result # bcfrailph fit result
Res
Resc<-sim$Resultc # coxph with univariate lognormal frailty model fit result
Resc