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 bcfrailph. mfit can be c("cox","shrg") where cox is for univariate or bivariate shared lognormal and gamma model fit using coxph and shrg is for univariate or bivariate shared gamma model fit using shrgamsp.

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 list containing scale andshape of the specified baseline hazard distribution.

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, covartype=c("B","B") to generate two covariates both from a binomial distribution.

covarpar

is a list containing parmeters of the specified covariate distribution with first and second arguments denoted by fargs and sargs, respectively. For example, if covartype=c("B","U") and covarpar=list(fargs=c(1,0.3),sargs=c(0.5,1.3)), generates two independent covariates from a binomial distribution (with parameters size=1 and probs=0.5) and from uniform distributions (with parameters min=0.3 and max=1.3).

inpcovar

is a list i.e,list(covar1=x1,covar2=x2) to input covariates with both x1 and x2 is in matrix form.

inpcen

is a list containing cent1 and cent2 denoting censoring time for the first and the second subjects in pairs respectively.

comncovar

if common covariates are needed.

Value

An object of class simstdybcf that contain the following:

See Also

simbcfrailph

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



[Package bcfrailph version 0.1.1 Index]