This internal function is designed to handle failures in cluster-specific model fitting and variable dropping issues in the context of cluster-adjusted robust inference functions. It checks for model fitting failures and whether independent variables have been dropped in the model.
fail_drop(drop, fail, clust.mod, ind_variables)If fail is TRUE and drop is FALSE, the function stops with an
error message.
If fail is TRUE and drop is TRUE, it returns NA.
If fail is FALSE, it returns the coefficients for the independent
variables in clust.mod.
Logical; if TRUE, allows the function to return NA for failed
model fits, otherwise stops execution with an error message.
Logical; indicates whether the model fitting process has failed.
A model object resulting from cluster-specific fitting.
A character vector of independent variable names expected in the model.