This is a brief guide on package cureph
illustrated with a simulated data set. First, you should load the package.
library(curephEM) devtools::load_all() set.seed(531)
You may generate a simulated dataset using the build-in function cureph.simgen()
sim.cureph.data = cureph.simgen()
The true parameters are stored in the attributes true.coef
and true.baseline.surv
.
attr(sim.cureph.data, 'true.coef')
You may use the conventional syntax for coxph
to fit a cureph
, except for the use of a newly defined Surv.cure
object instead of Surv
.
If only one formula is provided, the set of covariates goes into both the logistic part and the cox part of the model.
fit=cureph(Surv.cure(time,time2,event,origin=0,end=20)~Z1+Z2+Z3+Z4,data=sim.cureph.data)
Alternatively, you can provide two formulae---first formula
for logistic part, then formula2
for cox part.
fit2=cureph(Surv.cure(time,time2,event,origin=0,end=20)~Z1+Z2+Z3+Z4, formula2 = ~ Z1+Z2,data=sim.cureph.data)
A detailed summary can be produced in a generic way. A multivariate Wald test table is activated if the two sets of covariates are detected to be the same. The null hypothesis is all the coefficients associated with the listed covariate are all zero.
summary(fit)
Another function survpred
combines conventional predict
and survfit
. It returns the linear predictors for both part, the estimated probabilities, the mean-baselevel survival in cox part and the marginal mean-baselevel survival.
mysurv = survpred(fit)
The generic plot
function produces the survival curves.
plot(mysurv) plot(mysurv, pooled = F)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.