Initialize {cmpp} | R Documentation |
Initialize Data for the Cmpp Model
Description
This function initializes the data used in the Cmpp model by storing the feature matrix, failure times, and the competing risks indicators in the model environment. These are required for subsequent computations.
Usage
Initialize(features, x, delta1, delta2, h)
Arguments
features |
A numeric matrix of predictor variables. Each row corresponds to an observation. |
x |
A numeric vector of failure times corresponding to observations. |
delta1 |
A binary vector indicating the occurrence of the first competing event (1 for observed). |
delta2 |
A binary vector indicating the occurrence of the second event (1 for observed). |
h |
A numeric value specifying the step size for numerical gradient computations. |
Details
This function does not return any value but sets up internal data structures required for model computation.
Ensure that features
, x
, delta1
, and delta2
have matching lengths or dimensions.
Value
This function returns NULL
. The initialized data is stored in the package environment.
Examples
library(cmpp)
features <- matrix(rnorm(100), ncol = 5)
x <- rnorm(20)
delta1 <- sample(0:1, 20, replace = TRUE)
delta2 <- 1 - delta1
Initialize(features, x, delta1, delta2, h = 1e-5)