validate_lmm_initialization_input {catalytic} | R Documentation |
Validate Inputs for Catalytic Linear Mixed Model (LMM) Initialization
Description
This function validates the parameters needed for initializing a catalytic Linear Mixed Model (LMM) or Generalized Linear Model (GLM) based on the input formula, data, and column specifications.
Usage
validate_lmm_initialization_input(
formula,
data,
x_cols,
y_col,
z_cols,
group_col,
syn_size
)
Arguments
formula |
An object of class |
data |
A |
x_cols |
A character vector of column names to be used as predictor variables in the model. |
y_col |
A single character string specifying the name of the response variable column. |
z_cols |
A character vector of column names to be used as additional predictors or grouping factors, depending on the model structure. |
group_col |
A single character string specifying the name of the grouping variable for random effects. |
syn_size |
Optional. A positive integer indicating the synthetic data size, typically for use in data augmentation or model diagnostics. |
Details
This function performs the following checks:
Ensures
syn_size
is a positive integer.Verifies that
formula
is not for survival analysis (e.g., does not containSurv
terms).Checks that the formula is not overly complex by confirming it has fewer terms than the total columns in
data
.Ensures
y_col
andgroup_col
each contain only one column name.Confirms
data
is adata.frame
.Validates that all specified columns in
x_cols
,y_col
,z_cols
, andgroup_col
exist indata
without overlap or missing values.Warns if
syn_size
is set too small relative to the data dimensions, recommending a larger value. If any of these conditions are not met, the function raises an error or warning to guide the user.
Value
Returns nothing if all checks pass; otherwise, raises an error or warning.