Title: | NPMLE for Logistic-Cox Cure-Rate Model |
---|---|
Description: | Expectation-Maximization (EM) algorithm for point estimation and variance estimation to the nonparametric maximum likelihood estimator (NPMLE) for logistic-Cox cure-rate model with left truncation and right- censoring. See Hou, Chambers and Xu (2017) <doi:10.1007/s10985-017-9415-2>. |
Authors: | Jue (Marquis) Hou, Evan Ren |
Maintainer: | Jue (Marquis) Hou <[email protected]> |
License: | GPL-2 |
Version: | 0.3.0 |
Built: | 2024-11-29 08:54:19 UTC |
Source: | CRAN |
Fit NPMLE for Logistic-CoxPH Cure-Rate Model
cureph (formula, formula2 , data, subset, na.action, init, control, method = c("EM"), singular.ok = TRUE, var = c("Louis"),...)
cureph (formula, formula2 , data, subset, na.action, init, control, method = c("EM"), singular.ok = TRUE, var = c("Louis"),...)
formula |
a |
formula2 |
a |
data |
a |
subset |
expression indicating which subset of the rows of data should be used in the fit. All observations are included by default. |
na.action |
a missing-data filter function. This is applied to the model.frame after any subset argument has been used. Default is |
init |
a |
control |
Object of class |
method |
a character string specifying the method for estimation. The default method is the EM algorithm. |
singular.ok |
logical value indicating how to handle collinearity in the model matrix. If |
var |
a character string specifying the method for variance estimation. The default method is derived from the Louis formula. |
... |
other parameters passed to |
The function can handle left truncation.
"BFGS-Newton"
method optimizes the discretized nonparametric likelihood directly. It has 3 steps. First, it roughly search for a local maximal by BFGS method with default setup. Second, it rescales the parameters proportional to the reciprocal of current gradient in another BFGS optimization. Finally, it searches for a solution to the score equations through a Newton's method with Armijo line search.
The "EM"
method uses a “ghost copy” algorithm to accomodate left-truncation.
Both variance estimation methods are asymptotically correct, but they have undercoverage issue in case of a small event number. "Louis"
is recommended among the two.
See Hou et al. (2016) for detail.
Jue (Marquis) Hou
Hou, J., Chambers, C. and Xu, R. (2016). "A nonparametric maximum likelihood approach for partially observed cured data with left truncation and right-censoring". To be submitted.
cureph.object
, summary.cureph
, survpred.cureph
# A simulated data set data('sim.cureph.data') # Or you may generate another one sim.cureph.data = cureph.simgen() # Check out the true coefficients and baseline survival attributes(sim.cureph.data) # Fit logistic-CoxPH cure-rate model fit=cureph(Surv.cure(time,time2,event,origin=0,end=20)~Z1+Z2+Z3+Z4,data=sim.cureph.data) # Check out the summary summary(fit) # Baseline cummulative hazard basehaz.cureph(fit)
# A simulated data set data('sim.cureph.data') # Or you may generate another one sim.cureph.data = cureph.simgen() # Check out the true coefficients and baseline survival attributes(sim.cureph.data) # Fit logistic-CoxPH cure-rate model fit=cureph(Surv.cure(time,time2,event,origin=0,end=20)~Z1+Z2+Z3+Z4,data=sim.cureph.data) # Check out the summary summary(fit) # Baseline cummulative hazard basehaz.cureph(fit)
Assign the ancillary arguments for controling cureph fits
cureph.control(n.data,eps = 1e-09, toler.chol = .Machine$double.eps^0.75, iter.max = 1000, toler.inf = eps^(1/3), line.search=0.5,init.step = 1/n.data)
cureph.control(n.data,eps = 1e-09, toler.chol = .Machine$double.eps^0.75, iter.max = 1000, toler.inf = eps^(1/3), line.search=0.5,init.step = 1/n.data)
n.data |
Sample size of the data |
eps |
Iteration continues until the relative change in the log partial likelihood is less than eps. Must be positive. |
toler.chol |
Tolerance for detection of singularity during a Cholesky decomposion of the variance matrix, i.e., for detecting a redundant predictor variable. |
iter.max |
Maximum number of iterations to attempt for convergence. |
toler.inf |
Tolerance criteria for the warning message about a possible infinite coefficient value. |
line.search |
The scale of shrinkage in each Armijo line search step. |
init.step |
The initial size of step in Newton's method. |
line.search
and init.step
only matter when method = "BFGS-Newton"
.
a list containing the values of each of the above constants
Jue (Marquis) Hou
This class of objects is returned by the cureph
class of functions to represent a fitted cure-rate logistic-CoxPH model. Objects of this class have methods for the functions summary
and survpred
.
coefficients |
the vector of coefficients. If the model is over-determined there will be missing values in the vector corresponding to the redundant columns in the model matrix. |
var |
the variance matrix of the coefficients. Rows and columns corresponding to any missing coefficients are set to zero. |
loglik |
the log-likelihood with the final values of the coefficients. |
baseline |
the step-function for baseline cummulative hazard. |
wald.test |
the Wald test of whether the final coefficients differ from the initial values. |
iter |
number of iterations used. |
means |
vector of column means of the X matrix. Subsequent survival curves are adjusted to this value. Factors are set to be the baseline level. |
n |
the number of observations used in the fit. |
nevent |
the number of events (usually deaths) used in the fit. |
method |
the computation method used. |
na.action |
the na.action attribute, if any, that was returned by the |
... |
The object will also contain the following: |
cureph
, summary.cureph
, survpred.cureph
.
cureph
A simulated data for cureph
example.
data("sim.cureph.data") cureph.simgen()
data("sim.cureph.data") cureph.simgen()
A data frame with 200 observations on the following 7 variables.
time
entry time.
time2
exit time.
event
binary event indicator.
Z1
numerical vector.
Z2
factor with levels '0' and '1'.
Z3
factor with levels 'A', 'B' and 'C'.
Z4
factor with levels '0', '1' and '2', colinear with Z2
and Z3
.
attr(,"true.coef")
the true coefficients.
attr(,"true.surv0")
the true baseline survival function.
These functions are all methods for class cureph
or summary.cureph
objects.
## S3 method for class 'cureph' summary(object,combine = T,...) ## S3 method for class 'summary.cureph' print(x, digits = max(3, getOption("digits") - 3), signif.stars = getOption("show.signif.stars"),...)
## S3 method for class 'cureph' summary(object,combine = T,...) ## S3 method for class 'summary.cureph' print(x, digits = max(3, getOption("digits") - 3), signif.stars = getOption("show.signif.stars"),...)
object |
an object of class " |
x |
an object of class " |
combine |
logical; if |
digits |
the number of significant digits to use when printing. |
signif.stars |
logical. If TRUE, "significance stars" are printed for each coefficient. |
... |
Other parameters to match the generic S3 method. |
Create a Survival Object with Cure Portion
Surv.cure(time, time2, event, type=c("right","counting"), origin = 0, end = Inf) ## S3 method for class 'Surv.cure' print(x, digit = getOption("digits"),...)
Surv.cure(time, time2, event, type=c("right","counting"), origin = 0, end = Inf) ## S3 method for class 'Surv.cure' print(x, digit = getOption("digits"),...)
time |
for right censored data, this is the follow up time. For left truncated data, the first argument is the truncation time. |
event |
The status indicator, normally |
time2 |
ending time of the counting process data only. Intervals are assumed to be open on the left and closed on the right, |
type |
character string specifying the type of censoring. Possible values are |
origin |
for counting process data, the hazard function origin. This option was intended to be used in conjunction with a model containing time dependent strata in order to align the subjects properly when they cross over from one strata to another, but it has rarely proven useful. |
end |
the upper bound for event time. Any subject survives beyond this time is considered as an observed cure. |
x |
a 'Surv.cure' object. |
digit |
number of decimal digits in the output. |
... |
Other parameters to match the generic S3 method. |
# A simulated data set data("sim.cureph.data") attach(sim.cureph.data) # Construct and print a Surv.cure object Surv.cure(time,time2,event,origin=0,end=20) # Detach the simulated data detach(sim.cureph.data)
# A simulated data set data("sim.cureph.data") attach(sim.cureph.data) # Construct and print a Surv.cure object Surv.cure(time,time2,event,origin=0,end=20) # Detach the simulated data detach(sim.cureph.data)
Compute Predictions and Survival Curves from a Logistic-CoxPH Cure-Rate Model
## S3 method for class 'cureph' survpred(object, newdata , time, center = F) basehaz.cureph(object) ## S3 method for class 'survpred.cureph' plot(x, pooled = T, censor = x$censored,...)
## S3 method for class 'cureph' survpred(object, newdata , time, center = F) basehaz.cureph(object) ## S3 method for class 'survpred.cureph' plot(x, pooled = T, censor = x$censored,...)
object |
a |
newdata |
a data frame with the same variable names as those that appear in the The curve(s) produced will be representative of a cohort whose covariates correspond to the values in |
time |
a numeric vector; all the time points to be evaluated in the survival table in addition to the observed event times. |
center |
logical; if |
x |
a |
pooled |
logical; if |
censor |
a numeric vector of the observed censoring times. If not |
... |
Other parameters to match the generic S3 method. |
The means of factor variables are not computed. Instead, the baseline level is used.
The NPMLE baseline survival is estimated in a Breslow-Nelson-Aalen fashion.
logistic.linear.predict |
the linear predictions for cure indicator logistic model. |
logistic.linear.prob |
the estimated probability for NOT being cured. |
cox.linear.predict |
the linear predictions for event time CoxPH model. |
cox.cumhaz |
the baseline cummulative hazard for event time CoxPH model. |
surv.cox |
the marginal survival table for the cure-rate model. |
surv.cureph |
the conditional survival table for event time CoxPH model. |
... |
The object will also contain the following: |
Jue (Marquis) Hou
library(curephEM) # A simulated data set data("sim.cureph.data") # Fit logistic-CoxPH cure-rate model fit=cureph(Surv.cure(time,time2,event,origin=0,end=20)~Z1+Z2+Z3+Z4,data=sim.cureph.data) # The survival-prediction object mysurv = survpred(fit,center=TRUE) oldpar = par() par(mfrow=c(1,2)) plot(mysurv) plot(mysurv,FALSE) par(oldpar)
library(curephEM) # A simulated data set data("sim.cureph.data") # Fit logistic-CoxPH cure-rate model fit=cureph(Surv.cure(time,time2,event,origin=0,end=20)~Z1+Z2+Z3+Z4,data=sim.cureph.data) # The survival-prediction object mysurv = survpred(fit,center=TRUE) oldpar = par() par(mfrow=c(1,2)) plot(mysurv) plot(mysurv,FALSE) par(oldpar)