Type: | Package |
Title: | Semiparametric Bivariate Correlated Frailty Models Fit |
Version: | 0.1.1 |
Description: | Fit and simulate a semiparametric bivariate correlated frailty models with proportional hazard structure. Frailty distributions, such as gamma and lognormal models are supported. Bivariate gamma fit is obtained using the approach given in Iachine (1995) and lognormal fit is based on the approach by Ripatti and Palmgren (2000) <doi:10.1111/j.0006-341X.2000.01016.x>. |
Depends: | R (≥ 4.0.0),survival |
Imports: | stats |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Encoding: | UTF-8 |
RoxygenNote: | 7.2.1 |
NeedsCompilation: | no |
Packaged: | 2022-12-01 14:49:33 UTC; user |
Author: | Mesfin Tsegaye [aut, cre], Yehenew Kifle [aut, ctb] |
Maintainer: | Mesfin Tsegaye <mesfin.tsegaye@ddu.edu.et> |
Repository: | CRAN |
Date/Publication: | 2022-12-10 14:30:02 UTC |
Semi-parametric bivariate correlated frailty model.
Description
Fit a semiparametric Bivariate correlated frailty model with Proportional Hazard structure.
Usage
bcfrailph(
formula,
data,
initfrailp = NULL,
frailty = c("gamma", "lognormal"),
weights = 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. |
initfrailp |
Initial estimates for the frailty parameters. If not specified, initial frailty variance will be obtained from coxph with univariate frailty model and for correlation c(0.5) will be used. |
frailty |
A type of frailty distribution to be used in fit. Either gamma or lognormal. The default is gamma. |
weights |
vector of case weights for gamma model. the default is NULL. |
control |
Arguments to control bcfrailph fit. The default is |
... |
further arguments |
Value
An object of that contains the following components.
-
coefficients
- A vector of estimated Covariate coefficients. -
frailparest
- A vector of estimated Frailty parameters i.e. frailty variance and correlation. -
stderr
-A vector containing the Standard error of the Estimated parameters both covariate coefficients and frailty parameters. -
loglilk0
- Log likelihood of without frailty model or loglik of coxph fit. -
loglilk
-Log likelihood of Cox PH model with frailty. -
Iloglilk
- Log likelihood of with frailty. For gamma fit it is I-likelihood or the likelihood after integrating out the frailty term.For lognormal fit it is the approximate likelihood. -
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, 1 if converge and 0 otherwise. -
history
-an array containing records of estimates and other information on each iterations.
Note
Parameters of Bivariate correlated gamma frailty model was estimated using a modified EM approach given in Kifle et al (2022). Parameters of Bivariate correlated lognormal frailty model is based on the penalized partial likelihood approach by Rippatti and Palmgren (2000).
References
Kifle YG, Chen DG, Haileyesus MT (2022). Multivariate Frailty Models using Survey Weights with Applications to Twins Infant Mortality in Ethiopia. Statistics and Its Interface,106(4), 1\-10.
Rippatti, S. and Palmgren, J (2000). Estimation of multivariate frailty models using penalized partial likelihood. Biometrics, 56: 1016-1022.
See Also
bcfrailph.control
,simbcfrailph
Examples
set.seed(4)
simdata<-simbcfrailph(psize=300, cenr= c(0.3),beta=c(2),frailty=c("gamma"),
frailpar=c(0.5,0.5),bhaz=c("weibull"),
bhazpar=list(shape =c(5), scale = c(0.1)),
covartype= c("B"),covarpar=list(fargs=c(1),sargs=c(0.5)))
dataa<-simdata$data
fitbcfrgam=bcfrailph(Surv(time,censor)~ X1+frailty(PID) ,data=dataa,frailty="gamma")
fitbcfrgam
# for lognormal
set.seed(18)
simdata<-simbcfrailph(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)
dataa<-simdata$data
#fit
fitbcfrlogn=bcfrailph(Surv(time,censor)~ X1+X2+X3+frailty(PID) ,data=dataa,frailty="lognormal")
fitbcfrlogn
## one can set the initial parameter for the frailty parameters
fitbcfrailph=bcfrailph(Surv(time,censor)~ X1+frailty(PID),data=dataa,initfrailp = c(0.1,0.5),
frailty="lognormal")
fitbcfrailph
# Not run
#if covariates are not included
fitmoe=try(bcfrailph(Surv(time,censor)~0+frailty(PID),data=dataa,
frailty="lognormal"),silent = TRUE)
fitmoe=try(bcfrailph(Surv(time,censor)~1+frailty(PID),data=dataa),silent = TRUE)
# if control is not specified correctly.
# if one needs to change only max.iter to be 100,
fitmoe=try(bcfrailph(Surv(time,censor)~ X1+frailty(PID),data=dataa,
control=c(max.iter=100)),silent = TRUE)
#the correct way is
fitmoe=bcfrailph(Surv(time,censor)~ X1+frailty(PID),data=dataa,
control=bcfrailph.control(max.iter=100))
fitmoe
#if initial frailty parameters are in the boundary of parameter space
fitmoe=try(bcfrailph(Surv(time,censor)~ X1+frailty(PID),data=dataa,
initfrailp=c(0.2,1)),silent = TRUE)
fitmoe=try(bcfrailph(Surv(time,censor)~ X1+frailty(PID),data=dataa,
initfrailp=c(0,0.1)),silent = TRUE)
#if a frailty distribution other than gamma and lognormal are specified
fitmoe=try(bcfrailph(Surv(time,censor)~ X1,data=dataa,,frailty="exp"),silent = TRUE)
# End Not run
Arguments for controlling bcfrailph fits.
Description
This is used to set various numeric parameters controlling a bcfrailph model fits.
Usage
bcfrailph.control(
max.iter = 400,
tol = 1e-04,
eval.max = 500,
iter.max = 500,
trace = 0,
abs.tol = 1e-20,
rel.tol = 1e-10,
x.tol = 1.5e-08,
xf.tol = 2.2e-14,
step.min = 1,
step.max = 1
)
Arguments
max.iter |
Maximum number of outer iterations. The default is 400. |
tol |
A tolerance for convergence i.e the maximum differences of loglikelihood between succssive iterations.The default is 1e-04. |
eval.max |
argument used to control nlminb fits used. |
iter.max |
argument used to control nlminb fits used. |
trace |
argument used to control nlminb fits used. |
abs.tol |
argument used to control nlminb fits used. |
rel.tol |
argument used to control nlminb fits used. |
x.tol |
argument used to control nlminb fits used. |
xf.tol |
argument used to control nlminb fits used. |
step.min |
argument used to control nlminb fits used. |
step.max |
argument used to control nlminb fits used. |
Value
A list of control parameters.
See Also
Bivariate correlated gamma frailty model fitting function.
Description
Semi-parametric Bivariate correlated gamma frailty model fitting function.
Usage
fitbccv.gammasp(
X,
Y,
initfrailp,
weights = NULL,
control = bcfrailph.control(),
SE = TRUE
)
Arguments
X |
Matix of predictors. This should not include an intercept. |
Y |
a Surv object containing 2 columns (coxph.fit). |
initfrailp |
Initial estimates for the frailty parameters. If not specified, initial frailty variance will be obtained from coxph with univariate gamma frailty model and for correlation c(0.5) will be used. |
weights |
vector of case weights. the default is NULL. |
control |
Arguments to control the fit. The default is |
SE |
a logical statement whether standard errors are obtained from the mariginal log likelihood.The default is TRUE. |
Value
An object of that contains the following components.
-
coefficients
- A vector of estimated Covariate coefficients. -
frailparest
- A vector of estimated Frailty parameters i.e. frailty variance and correlation. -
stderr
-A vector containing the Standard error of the Estimated parameters both covariate coefficients and frailty parameters. -
loglilk0
- Log likelihood of without frailty model or loglik of coxph fit. -
loglilk
-Log likelihood of Cox PH model with frailty. -
Iloglilk
- Log likelihood of with frailty. For gamma fit it is I-likelihood or the likelihood after integrating out the frailty term.For lognormal fit it is the approximate likelihood. -
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, 1 if converge and 0 otherwise. -
history
-an array containing records of estimates and other information on each iterations.
Note
This function is important especially for simulation studies as it reduced checking time. Parameters of Bivariate correlated gamma frailty model was estimated using a modified EM approach given in Kifle et al (2022).
References
Kifle YG, Chen DG, Haileyesus MT (2022). Multivariate Frailty Models using Survey Weights with Applications to Twins Infant Mortality in Ethiopia. Statistics and Its Interface,106(4), 1\-10.
See Also
Examples
set.seed(4)
simdata<-simbcfrailph(psize=300, cenr= c(0.3),beta=c(2),frailty=c("gamma"),
frailpar=c(0.5,0.5),bhaz=c("weibull"),
bhazpar=list(shape =c(5), scale = c(0.1)),
covartype= c("B"),covarpar=list(fargs=c(1),sargs=c(0.5)))
Y<-simdata$Y;X<-simdata$X
bcspfit<-fitbccv.gammasp(X=X,Y=Y,initfrailp=NULL)
bcspfit$coef
bcspfit$frailpar
Bivariate correlated lognormal frailty model fitting function.
Description
Semi-parametric Bivariate correlated lognormal frailty model fitting function.
Usage
fitbccv.lognsp(X, Y, initfrailp, control = bcfrailph.control())
Arguments
X |
Matix of predictors. This should not include an intercept. |
Y |
a Surv object containing 2 columns (coxph.fit). |
initfrailp |
Initial estimates for the frailty parameters. If not specified, initial frailty variance will be obtained from coxph with univariate lognormal frailty model and for correlation c(0.5) will be used. |
control |
Arguments to control the fit. The default is |
Value
An object of that contains the following components.
-
coefficients
- A vector of estimated Covariate coefficients. -
frailparest
- A vector of estimated Frailty parameters i.e. frailty variance and correlation. -
stderr
-A vector containing the Standard error of the Estimated parameters both covariate coefficients and frailty parameters. -
loglilk0
- Log likelihood of without frailty model or loglik of coxph fit. -
loglilk
-Log likelihood of Cox PH model with frailty. -
Iloglilk
- Log likelihood of with frailty. For gamma fit it is I-likelihood or the likelihood after integrating out the frailty term.For lognormal fit it is the approximate likelihood. -
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, 1 if converge and 0 otherwise. -
history
-an array containing records of estimates and other information on each iterations.
Note
This function is important especially for simulation studies as it reduced checking time. Parameters of Bivariate correlated lognormal frailty model is based on the penalized partial likelihood approach by Rippatti and Palmgren (2000).
References
Rippatti, S. and Palmgren, J (2000). Estimation of multivariate frailty models using penalized partial likelihood. Biometrics, 56: 1016-1022.
See Also
Examples
set.seed(18)
simdata<-simbcfrailph(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)
Y<-simdata$Y;X<-simdata$X
bcspfit<-fitbccv.lognsp(X=X,Y=Y,initfrailp=NULL)
bcspfit$coef
bcspfit$frailpar
Plot bcfrailph
Description
Generics to print the S3 class bcfrailph.
Usage
## S3 method for class 'bcfrailph'
plot(
x,
lty = 1,
col = 1,
type = "l",
xlim = NULL,
ylim = NULL,
xlab = NULL,
main = NULL,
conf.int = FALSE,
...
)
Arguments
x |
A class |
lty |
Line type line type 1 is a solid line (the default). |
col |
Colors to be used for points. |
type |
The type of plot produced. type="l" Plot lines (the default) and type="p" Plot individual points. |
xlim |
range of variable on the x axis. |
ylim |
range of variable on the y axis. |
xlab |
Axis label for the x axis. |
main |
main is a string for figure title, placed at the top of the plot in a large font. |
conf.int |
whether confidence interval is included in the plot the deafault is FALSE. |
... |
ignored |
Details
Calls plot.bcfrailph()
.
Value
An plot of plot.bcfrailph
object.
Note
The plot of cumulative baseline hazard function.
See Also
Examples
set.seed(24)
simdata<-simbcfrailph(psize=100, cenr= c(0),beta=c(-1),frailty=c("gamma"),
frailpar=c(0.4,0.5),bhaz=c("weibull"),
bhazpar=list(shape =c(0.9), scale = c(2)),
covartype= c("B"),covarpar=list(fargs=c(1),sargs=c(0.5)))
dataa<-simdata$data ## the generated data set.
#fit
bcfit=bcfrailph(Surv(time, censor) ~ X1+frailty(PID),data=dataa)
plot(bcfit)
Print bcfrailph
Description
Generics to print the S3 class bcfrailph.
Usage
## S3 method for class 'bcfrailph'
print(x, ...)
Arguments
x |
A class |
... |
ignored |
Details
Calls print.bcfrailph()
.
Value
An object of print.bcfrailph
, with some more human-readable results from bcfrailph
object.
Note
The summary function is currently identical to the print function.
See Also
Examples
set.seed(4)
simdata<-simbcfrailph(psize=300, cenr= c(0.3),beta=c(2),frailty=c("gamma"),
frailpar=c(0.5,0.5),bhaz=c("weibull"),
bhazpar=list(shape =c(5), scale = c(0.1)),
covartype= c("B"),covarpar=list(fargs=c(1),sargs=c(0.5)))
dataa<-simdata$data
fitbcfrailph=bcfrailph(Surv(time,censor)~ X1+frailty(PID) ,data=dataa,frail_distrn=c("gamma"))
fitbcfrailph
Print shrgamsp
Description
Generics to print the S3 class shrgamsp.
Usage
## S3 method for class 'shrgamsp'
print(x, ...)
Arguments
x |
A class |
... |
ignored |
Details
Calls print.shrgamsp()
.
Value
An object of print.shrgamsp
, with some more human-readable results from shrgamsp
object.
Note
The summary function is currently identical to the print function.
See Also
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
Simulate data from bivariate correlated frailty models.
Description
Simulate data from bivariate correlated gamma or lognormal frailty models with or without covariates.
Usage
simbcfrailph(
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
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 simbcfrailph
that contain the following:
data
A data frame i.e, the simulated data set. IID is individual Id, PID is pair ID, time is the simulated survival time, censor is censoring indicator and X1 denote the simulated covariate.X
Covariates in Matrix form.Y
A matrix contains generated survival time and censoring.numberofpair
The specified number of pairs.censoredrate
The specified censored rate.fraildist
The specified frailty distribution.frailpar
The specified frailty parameters.
See Also
Examples
set.seed(4)
simdata<-simbcfrailph(psize=300, cenr= c(0.3),beta=c(2),frailty=c("gamma"),
frailpar=c(0.5,0.5),bhaz=c("weibull"),
bhazpar=list(shape =c(5), scale = c(0.1)),
covartype= c("B"),covarpar=list(fargs=c(1),sargs=c(0.5)))
dataa<-simdata$data
head(dataa)
# If data generation is from bivariate correlated lognormal frailty model,
set.seed(18)
simdata<-simbcfrailph(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)))
dataa<-simdata$data
head(dataa)
# If common covariate is desired, i.e., here out of
#the three covariates covariate 2 is common for the pair.
set.seed(18)
simdata<-simbcfrailph(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)
dataa<-simdata$data
head(dataa)
# If the data generation is from bivariate correlated gamma
# frailty model, weibull baseline and without covariate,
set.seed(4)
simdata<-simbcfrailph(psize=300, cenr= c(0.3),beta=NULL,frailty=c("gamma"),
frailpar=c(0.5,0.5),bhaz=c("weibull"),bhazpar=list(shape =c(5), scale = c(0.1)))
dataa<-simdata$data
head(dataa)
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:
Result
a 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.estimates
a matrix containing estimates of parameters at each replications.estimateSE
a matrix containing standard error of estimates at each replications.coverage
a matrix containing an indicator whether the true parameter lies within a 95% CI at each replications or not.TMAT
a matrix containing the generated artificial unique event times at each replications for gamma model.h0MAT
a matrix containing the estimated baseline hazards at each replications for gamma model.h0SEMAT
a 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
Print bcfrailph
Description
Generics to print the S3 class bcfrailph.
Usage
## S3 method for class 'bcfrailph'
summary(object, ...)
Arguments
object |
A class |
... |
ignored |
Details
Calls print.bcfrailph()
.
Value
An object of summary.bcfrailph
, with some more human-readable results from bcfrailph
object.
Note
The summary function is currently identical to the print function.
See Also
Examples
set.seed(4)
simdata<-simbcfrailph(psize=300, cenr= c(0.3),beta=c(2),frailty=c("gamma"),
frailpar=c(0.5,0.5),bhaz=c("weibull"),
bhazpar=list(shape =c(5), scale = c(0.1)),
covartype= c("B"),covarpar=list(fargs=c(1),sargs=c(0.5)))
dataa<-simdata$data
fitbcfrailph=bcfrailph(Surv(time,censor)~ X1+frailty(PID) ,data=dataa,frail_distrn=c("gamma"))
fitbcfrailph
summary(fitbcfrailph)
Print shrgamsp
Description
Generics to print the S3 class shrgamsp.
Usage
## S3 method for class 'shrgamsp'
summary(object, ...)
Arguments
object |
A class |
... |
ignored |
Details
Calls print.shrgamsp()
.
Value
An object of summary.shrgamsp
, with some more human-readable results from shrgamsp
object.
Note
The summary function is currently identical to the print function.