API reference¶
Every help topic in the package, generated from its help pages. In R, the
same text is available with ?name.
Tests of the variance¶
Each test returns an htest object, whose fields test_results documents. The tests are grouped by the family they belong to.
What every test returns¶
| Topic | Functions |
|---|---|
| What every test returns |
Auxiliary-regression tests¶
Tests on ordered observations¶
| Topic | Functions |
|---|---|
| Perform Goldfeld-Quandt test for heteroscedasticity | performGQTest() |
| Szroeter test for ordered alternatives | performSzroeterTest() |
| Harrison-McCabe test for heteroscedasticity | performHarrisonMcCabeTest() |
Group-wise tests¶
| Topic | Functions |
|---|---|
| Perform Levene's test for equality of variances | performLeveneTest() |
| Perform Brown-Forsythe test for equality of variances | performBrownForsytheTest() |
| Perform Fligner-Killeen test for homogeneity of variances | performFlignerKilleenTest() |
| Perform Bartlett's test for equality of variances | performBartlettTest() |
| Perform Hartley's Fmax test | performHartleyFmaxTest() |
| Perform O'Brien test for equality of variances | performOBrienTest() |
| Box's M Test for Equality of Covariance Matrices | performBoxMTest() |
Time series, panel and spatial tests¶
| Topic | Functions |
|---|---|
| Perform Engle's ARCH LM test | performArchLMTest() |
| Perform McLeod-Li test | performMcLeodLiTest() |
| Breusch-Pagan LM test for random effects | performBPRandomEffectsTest() |
| Perform Pesaran CD test | performPesaranTest() |
| Spatial heteroscedasticity test | performSpatialHeteroTest() |
Resampling and robust tests¶
| Topic | Functions |
|---|---|
| Bootstrap White test | performWhiteTestBootstrap() |
| Wild bootstrap heteroscedasticity test | performWildBootstrapTest() |
| Rank-based permutation heteroscedasticity test | performRankPermutationTest() |
| Quantile regression heteroscedasticity test | performQuantileRegressionTest() |
| Bootstrap a test statistic | bootstrapTestStatistic(), rbootstrap_test_statistic() |
| Bootstrap utilities for heteroscedasticity diagnostics | |
| Robust heteroscedasticity diagnostics | |
| Modern heteroscedasticity diagnostics | modern_diagnostics |
| Additional heteroscedasticity tests |
Model checks¶
Checks of the fitted model that are not tests of the variance: the functional form, collinearity, influence and the fit itself. They are listed apart so that they are not mistaken for heteroscedasticity tests.
| Topic | Functions |
|---|---|
| Ramsey's RESET test for nonlinearity | performRESETTest() |
| Variance inflation factors | performVIFDiagnostic() |
| Identify influential observations | performInfluenceDiagnostics() |
| Scatter-plot diagnostics for heteroscedasticity | performScatterDiagnostic() |
| Validate model argument | checkModel() |
| Enhanced model diagnostics (deprecated) | checkModelEnhanced() |
Running several diagnostics¶
Remediation¶
| Topic | Functions |
|---|---|
| Weighted Least Squares wrapper | fitWLS() |
| Robust regression wrapper | fitRobust() |
| Automatic transformation helper | autoTransform() |
| Suggest remediation actions for heteroscedasticity | suggestRemediation(), print(<remediation_suggestions>) |
| Automatically compare remedial models | autoCompareRemediations() |
Recommendations¶
| Topic | Functions |
|---|---|
| Intelligent recommendations for heteroscedasticity diagnostics | analyseDatasetCharacteristics(), suggestDiagnosticsForProfile(), interpretHeteroTestResults(), recommendRemediationStrategies(), warnDiagnosticAssumptions(), buildDiagnosticDecisionTree(), composeDiagnosticNarrative(), generateHeteroRecommendations() |
Simulation¶
The simulation functions are named in snake_case on purpose; the rest of the package uses camelCase.
| Topic | Functions |
|---|---|
| Simulate heteroscedastic data | simulate_hetero(), simulate_arch1(), sigma_linear(), sigma_exponential(), sigma_group(), sigma_piecewise(), sigma_poly(), sigma_sin(), sigma_multiplicative(), sigma_spatial(), sigma_logistic(), sigma_inverse(), sigma_power(), sigma_step(), sigma_u_shape(), sigma_exp_decay(), sigma_gaussian_peak(), sigma_piecewise_linear() |
| Advanced simulation framework for test validation | simulate_size(), simulate_power(), simulate_type_I_errors(), simulate_power_analysis() |
| Plot method for power analysis results | plot(<power_analysis>) |
Plotting¶
| Topic | Functions |
|---|---|
| Plot residuals vs fitted values | plotResidualsFitted() |
| Enhanced residuals vs fitted plot (deprecated) | plotResidualsFittedEnhanced() |
| Spread-Level plot for variance diagnostics | plotSpreadLevel() |
| Density plot of residuals | plotResidualDensity() |
| QQ plot of residuals | plotResidualQQ() |
| Bubble plot of residual variance by covariate | plotBubbleVariance() |
| Generate a suite of diagnostic plots | plotDiagnosticSuite() |
| Enhanced diagnostic plot suite (deprecated) | plotDiagnosticSuiteEnhanced() |
| Compare residuals before and after remediation | plotBeforeAfter() |
| Autoplot heteroscedasticity diagnostics | autoplot(<hetero_test_suite>), autoplot(<hetero_grouped_suite>) |
| Heteroscedasticity diagnostic theme | theme_hetero() |
| Colour scale for heteroscedasticity diagnostics | scale_colour_hetero_diagnostic(), scale_fill_hetero_diagnostic() |
Reporting and data¶
| Topic | Functions |
|---|---|
| Automated diagnostic report generation | generateDiagnosticReport() |
| Download example teaching dataset | downloadTeachingData() |
| Simulated dataset with collinearity and mild nonlinearity | diagnostic_data |
| Simulated dataset with heteroscedastic errors | hetero_data |
| Print method for enhanced White test results | print(<htest_enhanced>) |
Dashboard and benchmarks¶
To move to a companion package, once it has a name.
| Topic | Functions |
|---|---|
| Interactive diagnostic dashboard | launchDiagnosticDashboard() |
| Benchmark heteroTests against reference implementations | run_benchmark_suite(), generate_benchmark_report() |
Package infrastructure¶
| Topic | Functions |
|---|---|
| Control logging for heteroTests diagnostics | ht_set_log_level(), ht_enable_log_capture(), ht_log_history(), ht_clear_log_history() |
| Generate standardized error message (deprecated) | std_error() |
| Generate standardized warning message (deprecated) | std_warning() |
| Validate model and data inputs before running diagnostics (deprecated) | validateTestInputs() |
| Validate data argument (deprecated) | checkData() |
| Effect size calculations for heteroscedasticity diagnostics | rcalculateEffectSize() |
| Estimate test power from observed effect size | restimate_test_power() |
| Validate diagnostics against reference implementations | rvalidate_against_reference() |