This package performs parameter estimation for the cure mixture and nonmixture models based on right-censored data. The two-parameter Weibull distribution is assumed for the latency component. The cure mixture model assumes a logistic model for the incidence component, and the non-mixture model assumes the complementary log-log model for the incidence component. The parameter estimation for both parametric cure models is performed based on the EM algorithm.
install.packages("devtools")
library(devtools)
source_url("https://github.com/lcyjames/WeibullCMs/blob/main/CoreFunctions.R?raw=TRUE")
wmcmEM(Yi, cen, X, Z, trace=FALSE, tolerance=10^{-4})
This is the estimation procedure of the Weibull Mixture Cure Model based on the EM algorithm.
wnmcmEM(Yi, cen, X, Z, trace=FALSE, tolerance=10^{-4})
This is the estimation procedure of the Weibull Non-Mixture Cure Model based on the EM algorithm
Both functions take the arguments below:
Yi
is a vector of the right censored observed failure times, with size ncen
is the corresponding censoring indicator with 1 being cases and 0 being censored, with size nX
is a covariate matrix for the incidence component with size n times the number of covariatesZ
is a covariate matrix for the latency component with size n times the number of covariates; X and Z do not contain a column of 1 (i.e. no intercept is required); X can be completely, partially, or not different from Z.trace
=FALSE by default. For tracking the converging path of the parameter estimation, set trace=TRUEtolerance
is the converging criteria typically assigned to be 10^{-4}