validate_cox_initialization_input: Validate Inputs for Catalytic Cox proportional hazards model...

validate_cox_initialization_inputR Documentation

Validate Inputs for Catalytic Cox proportional hazards model (COX) Initialization

Description

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.

Usage

validate_cox_initialization_input(
  formula,
  data,
  syn_size,
  hazard_constant,
  entry_points,
  x_degree
)

Arguments

formula

An object of class formula. The model formula specifying the Cox model structure. It must contain a Surv object to indicate survival analysis.

data

A data.frame containing the dataset to be used for model fitting. It should include all variables referenced in formula.

syn_size

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.

hazard_constant

A positive numeric value representing the hazard constant for the Cox model.

entry_points

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.

x_degree

A numeric vector indicating degrees for each covariate. It should be non-negative and match the number of covariates (i.e., ncol(data) - 2).

Details

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.

Value

Returns nothing if all checks pass; otherwise, raises an error.


catalytic documentation built on April 4, 2025, 5:51 a.m.