Skip to content

Intelligent recommendations for heteroscedasticity diagnostics

Source: man/generateHeteroRecommendations.Rd ยท Help: ?generateHeteroRecommendations

These helpers assemble an end-to-end recommendation workflow that profiles the input dataset, selects appropriate heteroscedasticity diagnostics, interprets results with qualitative confidence labels, and suggests remediation strategies with decision-tree style guidance.

Usage

analyseDatasetCharacteristics(data, response = NULL)

suggestDiagnosticsForProfile(profile)

interpretHeteroTestResults(test_results, alpha = 0.05)

recommendRemediationStrategies(test_results, model, data, profile = NULL)

warnDiagnosticAssumptions(profile, interpretations, model, data, test_results)

buildDiagnosticDecisionTree(profile, recommendations)

composeDiagnosticNarrative(profile, interpretations, remediation,
  assumption_warnings, decision_tree)

generateHeteroRecommendations(model, data = NULL, test_results = NULL,
  alpha = 0.05, include_report = TRUE)

Arguments

data
A data.frame containing the modelling variables. For recommendRemediationStrategies() and generateHeteroRecommendations(), its rows are matched to the observations of the fit as the tests match them, and those rows, in the order of the fit, are read by the tests and the advice, which read the residuals, grouped data keeping their groups (the profile of generateHeteroRecommendations(), its size and missing values, describes data as given): rows with row names of their own by name, in any order; rows that only number themselves (a tibble, a data.table, a data frame whose row names were reset) by the row numbers of the fit, or in the order of the fit when they hold one row per observation; the rows the fit dropped may be there or not. Data whose rows cannot be shown to hold the observations of the fit are refused (see test_results). Before 0.17.0 the i-th row was read with the i-th observation: named data in another order than the fit gave the advice of other rows, and the full data of a fit that dropped rows were refused.
response
Optional response variable name used for labelling.
profile
Dataset profile produced by analyseDatasetCharacteristics().
test_results
Named list of htest objects, typically returned by runHeteroTests().
alpha
Significance level applied when interpreting p-values.
model
Fitted lm, or glm with the Gaussian family and the identity link, or model formula. The tests refuse a glm of any other family or link since 0.15.0.
interpretations
Output from interpretHeteroTestResults().
recommendations
Output from suggestDiagnosticsForProfile(), used to build the decision tree.
remediation
Output from recommendRemediationStrategies().
assumption_warnings
Character vector of generated warnings.
decision_tree
Data frame returned by buildDiagnosticDecisionTree().
include_report
Logical; include a plain-language narrative in the output.

Value

analyseDatasetCharacteristics() returns a list describing dataset size, missingness, skewness, and risk factors. suggestDiagnosticsForProfile() returns a data frame of recommended diagnostics with rationales. interpretHeteroTestResults() yields a tidy data frame of interpretations and an overall summary. recommendRemediationStrategies() produces a structured remediation plan. warnDiagnosticAssumptions() returns warnings about assumption violations. buildDiagnosticDecisionTree() constructs a tidy decision tree. composeDiagnosticNarrative() outputs a plain-language character vector, and generateHeteroRecommendations() returns an object of class hetero_recommendation_report bundling all components.

Details

The recommendation engine analyses dataset characteristics such as sample size, missingness, and predictor skewness to propose diagnostics tailored to the context. It automatically interprets test outcomes, attaches qualitative confidence labels, warns when assumptions are at risk, and suggests remediation strategies matched to detected variance patterns. The generated decision tree and narrative target non-specialist audiences who need actionable guidance.

See also

runHeteroTests(), suggestRemediation(), generateDiagnosticReport()

Examples

model <- lm(mpg ~ wt + hp, data = mtcars)
recs <- generateHeteroRecommendations(model, mtcars)
print(recs)