Learn R Programming

EMGCR (version 0.2.0)

MCRfit: Fit a Mixture Cure Rate (MCR) Survival Model

Description

Fits a cure rate model using a flexible link function and a variety of survival distributions. The model accounts for a cured fraction through a logistic-type link and estimates the model via an EM-like algorithm.

Usage

MCRfit(
  formula,
  data,
  dist = "weibull",
  link = "logit",
  tau = 1,
  maxit = 1000,
  tol = 1e-05
)

Value

An object of class "MCR", which is a list containing:

coefficients

Estimated regression coefficients for the survival part.

coefficients_cure

Estimated coefficients for the cure part.

scale

Estimated scale parameter of the baseline distribution.

loglik

Final log-likelihood value.

n

Number of observations used in the model.

deleted

Number of incomplete cases removed before fitting.

ep

Estimated standard errors.

iter

Number of iterations used for convergence.

dist

Distribution used.

link

Link function used.

tau

Tau parameter used (if applicable).

Arguments

formula

A two-part formula of the form Surv(time, status) ~ x | w, where x are covariates for the survival part, and w are covariates for the cure fraction.

data

A data frame containing the variables in the model.

dist

A character string indicating the baseline distribution. Supported values are "weibull", "exponential", "rayleigh", "lognormal", "loglogistic", and "invgauss".

link

A character string specifying the link function for the cure fraction. Options are "logit", "probit", "plogit", "rplogit", and "cauchit".

tau

A numeric value used when link = "plogit" or "rplogit". Defaults to 1.

maxit

Maximum number of iterations for the EM-like algorithm. Defaults to 1000.

tol

Convergence tolerance. Defaults to 1e-5.

Examples

Run this code
require(EMGCR)

data(liver2)
names(liver2)
liver2$sex <- factor(liver2$sex)
liver2$grade <- factor(liver2$grade)
liver2$radio <- factor(liver2$radio)
liver2$chemo <- factor(liver2$chemo)
str(liver2)
model <- MCRfit(
  survival::Surv(time, status) ~ age + sex + grade + radio + chemo |
    age + medh + grade + radio + chemo,
  dist = "loglogistic",
  link = "plogit",
  tau = 0.15,
  data = liver2
)
model

Run the code above in your browser using DataLab