This function performs validation checks on input parameters for initializing a catalytic Cox proportional hazards model. It ensures that essential parameters meet requirements, such as being of the correct type, appropriate length, and having valid values.
validate_cox_initialization_input(
formula,
data,
syn_size,
hazard_constant,
entry_points,
x_degree
)
Returns nothing if all checks pass; otherwise, raises an error.
An object of class formula
. The model formula specifying the Cox model structure. It must contain a Surv
object to indicate survival analysis.
A data.frame
containing the dataset to be used for model fitting. It should include all variables referenced in formula
.
A positive integer indicating the size of the synthetic dataset. It is recommended that this value is at least four times the number of columns in data
.
A positive numeric value representing the hazard constant for the Cox model.
A numeric vector representing entry times for observations. This vector should be non-negative and have a length equal to the number of rows in data
.
A numeric vector indicating degrees for each covariate. It should be non-negative and match the number of covariates (i.e., ncol(data) - 2
).
This function checks:
That syn_size
, hazard_constant
, entry_points
, and x_degree
are positive values.
That formula
includes a Surv
object to be suitable for Cox models.
That data
is a data.frame
.
The complexity of formula
to ensure it has fewer terms than the number of columns in data
.
The length of x_degree
and entry_points
to match the dimensions of data
.
If the conditions are not met, descriptive error messages are returned.