cmpp {cmpp}R Documentation

Direct Parametric Inference for the Cumulative Incidence Function in Competing Risks

Description

The cmpp package provides parametric (Direct) modeling methods for analyzing cumulative incidence functions (CIFs) in the context of competing risks. It includes Gompertz-based models, regression techniques, and parametric (Direct) approaches such as the Generalized odds rate (GOR), Proportional Odds Model (POM), and Proportional Hazards Model (PHM). The package enables users to estimate and compare CIFs using maximum likelihood estimation, perform regression analysis, and visualize CIFs with confidence intervals. It also supports covariate adjustment and bootstrap variance estimation.

Details

The cmpp package offers functions for modeling cumulative incidence functions (CIFs) Directly using the Gompertz distribution and generalized regression models.

Key features include:

Commonly used functions include:

Author(s)

Habib Ezzatabadipour habibezati@outlook.com

References

See Also

Initialize, LogLike1, compute_grad, compute_hessian, estimate_parameters_GOR, estimate_parameters_POM, estimate_parameters_PHM, CIF_res1, CIF_Figs, Cmpp_CIF, FineGray_Model, bootstrap_variance, GetData, Cleanup

Examples

## Example: Initialize the Cmpp model and compute CIFs
library(cmpp)
features <- matrix(rnorm(300, 1, 2), nrow = 100, ncol = 3)
delta1 <- sample(c(0, 1), 100, replace = TRUE)
delta2 <- 1 - delta1
timee <- rexp(100, rate = 1/10)
Initialize(features, timee, delta1, delta2, h = 1e-5)
# Initialize the Cmpp model
# Estimate parameters using the Generalized odds rate (GOR)
initial_params <- rep(0.001, 2 * (ncol(features) + 3))
result <- estimate_parameters_GOR(initial_params)
print(result)
# Compute CIFs for competing risks (without covariate effect | Not Regression model)
cif_results <- CIF_res1()
print(cif_results)
# Plot CIFs with confidence intervals
plot <- CIF_Figs(rep(0.01, 4), timee)
print(plot)
# Compute and plot adjusted CIFs
result_cif <- Cmpp_CIF(
featureID = c(1, 2),
featureValue = c(0.5, 1.2),
RiskNames = c("Event1", "Event2"),
TypeMethod = "GOR",
predTime = seq(0, 10, by = 0.5)
)
print(result_cif$Plot$Plot_InputModel) # Plot for the specified model
print(result_cif$CIF$CIFAdjusted) # Adjusted CIF values
# Fit a Fine-Gray model for competing risks
result_fg <- FineGray_Model(
CovarNames = c("Covar1", "Covar2", 'Covar3'),
Failcode = 1,
RiskNames = c("Event1", "Event2")
)
print(result_fg$Results)  # Summary of the Fine-Gray model
print(result_fg$Plot) # Plot of the CIFs

# Clean up memory
Cleanup()


[Package cmpp version 0.0.2 Index]