Validate model and data inputs before running diagnostics (deprecated)¶
Source: R/validation.R ยท Help: ?validateTestInputs
Deprecated since 0.14.0: an internal helper of the package, which leaves the exports in 1.0.0. It still works and warns.
Usage¶
Arguments¶
model- A fitted model created by
stats::lm()orstats::glm(). data- A
data.framecontaining the variables used to fitmodel. test_name- Character scalar naming the diagnostic that is about to run; included in error messages for clarity.
min_obs- Non-negative integer giving the minimum sample size accepted
by the diagnostic. Defaults to
10.
Value¶
Invisibly returns TRUE when validation succeeds. Execution stops
with an informative error when any check fails.
Details¶
Provides the compatibility wrapper used by the public testing interface to ensure that fitted-model objects and their associated data satisfy minimal quality requirements. The helper guards against the most common issues that invalidate heteroscedasticity tests and produces actionable error messages that reference the calling diagnostic.
The routine performs four layers of validation:
- confirm that
modelinherits fromlmorglmand that its coefficients and residuals are finite; - verify that
datais adata.framewith at leastmin_obsrows; - ensure the residual vector is available, finite, and aligned with the supplied data;
- emit warnings when studentised residuals exceed five standard deviations in absolute value or when the dataset is very large (more than 10,000 observations).
Results are cached (when the digest package is installed) so repeated calls with unchanged inputs return immediately.
References¶
Fox, J. (2015). Applied Regression Analysis and Generalized Linear Models (3rd ed.). SAGE.
Belsley, D. A., Kuh, E., & Welsch, R. E. (1980). Regression Diagnostics: Identifying Influential Data and Sources of Collinearity. Wiley.
See also¶
checkModel(), rvalidateModelInputs(),
rvalidateTestRequirements()