mle_competing_risks: Maximum Likelihood Estimation for Competing Risks Analysis

View source: R/mle_est.R

mle_competing_risksR Documentation

Maximum Likelihood Estimation for Competing Risks Analysis

Description

Maximum Likelihood Estimation for Competing Risks Analysis

Usage

mle_competing_risks(data, pdf1, cdf1, pdf2, cdf2, init_par, method = "BFGS")

Arguments

data

Object of class comp_risk_rel_data generated by gen_competing_risks.

pdf1

Density function for Cause 1.

cdf1

CDF function for Cause 1.

pdf2

Density function for Cause 2.

cdf2

CDF function for Cause 2.

init_par

Vector of initial parameter values for both causes c(theta1, theta2).

method

Optimization method.

Value

S3 object of class mle_fit.

Examples

dat <- gen_competing_risks(
  pdf1 = function(x) dexp(x, rate = 1),
  cdf1 = function(x) pexp(x, rate = 1),
  pdf2 = function(x) dexp(x, rate = 1.5),
  cdf2 = function(x) pexp(x, rate = 1.5),
  lower = 0, upper = 10, n = 25,
  censoring_type = "type1_hybrid",
  r = 15, T_star = 1.0, seed = 123
)
mle_competing_risks(
  data = dat,
  pdf1 = function(x, th) dexp(x, rate = th[1]),
  cdf1 = function(x, th) pexp(x, rate = th[1]),
  pdf2 = function(x, th) dexp(x, rate = th[2]),
  cdf2 = function(x, th) pexp(x, rate = th[2]),
  init_par = c(0.8, 1.2), method = "BFGS"
)

CompRiskRel documentation built on Aug. 5, 2026, 9:08 a.m.