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:
Direct parametric modeling for cumulative incidence functions.
Maximum likelihood estimation of parameters.
Regression analysis with covariates, including treatment effects.
Visualization of CIFs with confidence intervals.
Covariate-adjusted CIF estimation.
Bootstrap variance estimation for model parameters.
Commonly used functions include:
-
Initialize
: Initializes the data for the Cmpp model. -
LogLike1
: Computes the negative log-likelihood for the model without covariate effect. -
compute_grad
: Computes the gradient of the log-likelihood. -
compute_hessian
: Computes the Hessian matrix of the log-likelihood. -
estimate_parameters_GOR
: Estimates parameters using the Generalized odds rate (GOR). -
estimate_parameters_POM
: Estimates parameters using the Proportional Odds Model (POM). -
estimate_parameters_PHM
: Estimates parameters using the Proportional Hazards Model (PHM). -
CIF_res1
: Computes CIF results for competing risks without covariates. -
CIF_Figs
: Plots CIFs with confidence intervals (without covariate effect). -
Cmpp_CIF
: Computes and plots CIFs for competing risks using GOR, POM, and PHM. -
FineGray_Model
: Fits a Fine-Gray regression model for competing risks data and visualize CIF by Fine-Gray model result usingcmprsk::cuminc
andcmprsk::crr
. -
bootstrap_variance
: Estimates variance of parameters using the bootstrap method. -
GetData
: Retrieves initialized data from the Cmpp model. -
Cleanup
: Cleans up memory by deleting the Cmpp instance.
Author(s)
Habib Ezzatabadipour habibezati@outlook.com
References
Jeong, J.-H., & Fine, J. (2006). Direct parametric inference for the cumulative incidence function. Applied Statistics, 55(2), 187-200.
Jeong, J.-H., & Fine, J. (2007). Parametric regression on cumulative incidence function. Biostatistics, 8(2), 184-196.
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()