fail_drop {mmiCATs}R Documentation

Handle Model Fitting Failures and Variable Dropping

Description

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.

Usage

fail_drop(drop, fail, clust.mod, ind_variables)

Arguments

drop

Logical; if TRUE, allows the function to return NA for failed model fits, otherwise stops execution with an error message.

fail

Logical; indicates whether the model fitting process has failed.

clust.mod

A model object resulting from cluster-specific fitting.

ind_variables

A character vector of independent variable names expected in the model.

Value

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.


[Package mmiCATs version 0.1.1 Index]