Package: heteroTests 0.12.0

heteroTests: Heteroscedasticity Diagnostics for Linear Models

Provides a unified set of heteroscedasticity diagnostics for linear-model workflows. It implements classical auxiliary-regression tests, including those of White (1980) <doi:10.2307/1912934>, Breusch and Pagan (1979) <doi:10.2307/1911963>, Koenker (1981) <doi:10.1016/0304-4076(81)90062-2>, Goldfeld and Quandt (1965) <doi:10.1080/01621459.1965.10480811> and Harvey (1976) <doi:10.2307/1913974>; the score test of Cook and Weisberg (1983) <doi:10.1093/biomet/70.1.1>; the ARCH test of Engle (1982) <doi:10.2307/1912773>; and group-wise tests of equal variance, including those of Bartlett (1937) <doi:10.1098/rspa.1937.0109>, Brown and Forsythe (1974) <doi:10.1080/01621459.1974.10482955> and Hartley (1950) <doi:10.2307/2332383>. Resampling and scalable variants, simulation utilities, diagnostic visualisation and remediation helpers share a consistent interface designed for reproducible statistical workflows and integration with common modelling tools.

Authors:Diogo Ribeiro [aut, cre]

heteroTests_0.12.0.tar.gz
heteroTests_0.12.0.zip(r-4.7-any)heteroTests_0.12.0.zip(r-4.6-any)heteroTests_0.12.0.zip(r-4.5-any)
heteroTests_0.12.0.tgz(r-4.6-any)heteroTests_0.12.0.tgz(r-4.5-any)
heteroTests_0.12.0.tar.gz(r-4.7-any)heteroTests_0.12.0.tar.gz(r-4.6-any)
heteroTests_0.12.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
heteroTests/json (API)

# Install 'heteroTests' in R:
install.packages('heteroTests', repos = c('https://diogoribeiro7.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/diogoribeiro7/heterotests/issues

Pkgdown/docs site:https://diogoribeiro7.github.io

Datasets:
  • diagnostic_data - Simulated dataset with collinearity and mild nonlinearity
  • hetero_data - Simulated dataset with heteroscedastic errors

On CRAN:

Conda:

6.29 score 69 scripts 407 downloads 129 exports 21 dependencies

Last updated from:d2c02cfb3e. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK265
source / vignettesOK247
linux-releaseOK247
macos-releaseOK210
macos-oldrelOK218
windows-develOK201
windows-releaseOK198
windows-oldrelOK146
wasm-releaseOK139

Exports:analyseDatasetCharacteristicsanalyzeMLResidualsautoCompareRemediationsautoTransformbuildDiagnosticDecisionTreecachedTestcheckDatacheckModelcheckModelEnhancedclearAnalysisCacheclearTestCachecompareModelDiagnosticscompareTestResultscomposeDiagnosticNarrativedownloadTeachingDatafitRobustfitWLSgenerate_benchmark_reportgenerateDiagnosticReportgenerateHeteroRecommendationsHeteroDiagnosticht_clear_log_historyht_enable_log_captureht_log_historyht_set_log_levelinterpretHeteroTestResultslaunchDiagnosticDashboardlistDiagnosticsperformArchLMTestperformBartlettTestperformBoxMTestperformBPRandomEffectsTestperformBPTestperformBPTestRobustperformBPTestStreamingperformBreuschPaganTestperformBrownForsytheTestperformCookWeisbergTestperformDavidianCarrollTestperformFlignerKilleenTestperformGlejserTestperformGQTestperformHarrisonMcCabeTestperformHartleyFmaxTestperformHarveyTestperformHighDimensionalTestperformInfluenceDiagnosticsperformKoenkerTestperformKoenkerTestStreamingperformLeveneTestperformMcLeodLiTestperformNCVTestperformOBrienTestperformParkTestperformPesaranTestperformQuantileRegressionTestperformRankPermutationTestperformRESETTestperformScatterDiagnosticperformSpatialHeteroTestperformSpearmanTestperformSpreadLevelTestperformStudentizedBPTestperformSzroeterTestperformVarianceFormTestperformVIFDiagnosticperformWhiteTestperformWhiteTestBootstrapperformWhiteTestRobustperformWhiteTestStreamingperformWildBootstrapTestplotBeforeAfterplotBubbleVarianceplotDiagnosticSuiteplotDiagnosticSuiteEnhancedplotResidualDensityplotResidualQQplotResidualsFittedplotResidualsFittedEnhancedplotSpreadLevelrbootstrap_test_statisticrcalculateEffectSizerecommendRemediationStrategiesregisterDiagnosticregisterPlotrestimate_test_powerrrunAdvancedDiagnosticsrun_benchmark_suiterunDiagnosticPlotsrunDiagnosticsrunHeteroTestsrunHeteroTestsParallelrunMultivariateTestsrunPanelTestsrunSurveyHeteroTestsrunTimeSeriesTestsrvalidate_against_referencescale_colour_hetero_diagnosticscale_fill_hetero_diagnosticsigma_exp_decaysigma_exponentialsigma_gaussian_peaksigma_groupsigma_inversesigma_linearsigma_logisticsigma_multiplicativesigma_piecewisesigma_piecewise_linearsigma_polysigma_powersigma_sinsigma_spatialsigma_stepsigma_u_shapesimulate_arch1simulate_heterosimulate_power_analysissimulate_type_I_errorsstd_errorstd_warningsuggestDiagnosticsForProfilesuggestRemediationtesttest_factoryTestFactorytheme_heterovalidateTestInputswarnDiagnosticAssumptions

Dependencies:clicpp11curlfarvergenericsggplot2gluegtableisobandlabelinglifecycleMASSR6RColorBrewerrlangS7scalesSuppDistsvctrsviridisLitewithr

Statistical Theory and Implementation Details
Motivation | White's test | Breusch–Pagan test | Koenker's studentised test | Park and Harvey logarithmic tests | Visual interpretation | Further reading

Last update: 2026-10-10
Started: 2025-09-23

heteroTests Walkthrough
1. Fit an initial model | 2. Diagnose heteroscedasticity | 3. Apply a remedy | 4. Compare models | 5. Check the variance function

Last update: 2026-10-08
Started: 2025-08-13

Real-world Case Studies
Case study 1: Seismic station counts | Case study 2: Income volatility in simulated survey data | Case study 3: Engineering reliability assessment | Summary

Last update: 2026-09-03
Started: 2025-09-23

Using heteroTests
Other available tests | Earthquake station-count example | Theophylline dosing example | Step-by-step workflow | Statistical Accuracy and Validation | Cross-Package Validation | Performance and Memory Considerations | Large Datasets | Recommendations for Large Datasets | Memory Management Tips

Last update: 2026-09-03
Started: 2025-08-13

Complete Bibliography and References

Last update: 2026-08-31
Started: 2025-08-20

Comprehensive Guide to Heteroscedasticity Testing
Introduction | Theoretical Background | What is Heteroscedasticity? | When Does It Matter? | Test Catalog | Regression-Based Tests | White's Test | Breusch-Pagan Test | Graphical Diagnostics | Practical Examples | Example 1: Financial Time Series | Example 2: Cross-Sectional Data | Example 3: Panel Data | Remediation Strategies | Comparison with Other Packages | References

Last update: 2026-08-31
Started: 2025-08-13

Performance Comparison Guide
Simulation design | Type I error control | Power against structured alternatives | Practical guidance

Last update: 2026-08-31
Started: 2025-09-23

Troubleshooting Common Issues
Common Error Messages and Solutions | "Auxiliary regression failed" | "Log of negative values" | Performance Issues | Large Datasets | Convergence Problems | Interpretation Guidelines | When Tests Disagree | Power Considerations

Last update: 2025-08-13
Started: 2025-08-13

Readme and manuals

Help Manual

Help pageTopics
Diagnostics registry.diagnostic_registry
Additional heteroscedasticity testsadditional_tests
Machine-learning residual analysisanalyzeMLResiduals
Automatically compare remedial modelsautoCompareRemediations
Autoplot heteroscedasticity diagnosticsautoplot.hetero_grouped_suite autoplot.hetero_test_suite
Automatic transformation helperautoTransform
Bootstrap utilities for heteroscedasticity diagnosticsbootstrap_methods
Cache results of a heteroscedasticity testcachedTest
Validate data argumentcheckData
Validate model argumentcheckModel
Enhanced model diagnosticscheckModelEnhanced
Clear cached diagnostic run resultsclearAnalysisCache
Clear cached test resultsclearTestCache
Compare diagnostics across modelscompareModelDiagnostics
Summarise heteroscedasticity test resultscompareTestResults
Simulated dataset with collinearity and mild nonlinearitydiagnostic_data
Download example teaching datasetdownloadTeachingData
Robust regression wrapperfitRobust
Weighted Least Squares wrapperfitWLS
Automated diagnostic report generationgenerateDiagnosticReport
Intelligent recommendations for heteroscedasticity diagnosticsanalyseDatasetCharacteristics buildDiagnosticDecisionTree composeDiagnosticNarrative generateHeteroRecommendations interpretHeteroTestResults print.hetero_recommendation_report recommendRemediationStrategies suggestDiagnosticsForProfile warnDiagnosticAssumptions
Simulated dataset with heteroscedastic errorshetero_data
S3 containers for heteroscedasticity diagnosticshetero_grouped_suite hetero_test_suite
Create a diagnostic objectHeteroDiagnostic
Control logging for heteroTests diagnosticsht_clear_log_history ht_enable_log_capture ht_log_history ht_set_log_level
Interactive diagnostic dashboardlaunchDiagnosticDashboard
List the registered diagnosticslistDiagnostics
Modern heteroscedasticity diagnosticsmodern_diagnostics
Perform Engle's ARCH LM testperformArchLMTest
Perform Bartlett's test for equality of variancesperformBartlettTest
Box's M Test for Equality of Covariance MatricesperformBoxMTest
Breusch-Pagan LM test for random effectsperformBPRandomEffectsTest
Perform Breusch-Pagan test for heteroscedasticityperformBPTest performBreuschPaganTest
Robust Breusch–Pagan test with bootstrap and effect sizesperformBPTestRobust
Streaming Breusch\–Pagan test for large datasetsperformBPTestStreaming
Perform Brown-Forsythe test for equality of variancesperformBrownForsytheTest
Perform Cook-Weisberg test for heteroscedasticityperformCookWeisbergTest
Perform Davidian-Carroll testperformDavidianCarrollTest
Perform Fligner-Killeen test for homogeneity of variancesperformFlignerKilleenTest
Perform Glejser test for heteroscedasticityperformGlejserTest
Perform Goldfeld-Quandt test for heteroscedasticityperformGQTest
Harrison-McCabe test for heteroscedasticityperformHarrisonMcCabeTest
Perform Hartley's Fmax testperformHartleyFmaxTest
Perform Harvey test for multiplicative heteroscedasticityperformHarveyTest
High-dimensional projection heteroscedasticity testperformHighDimensionalTest
Identify influential observationsperformInfluenceDiagnostics
Perform Koenker studentized Breusch-Pagan testperformKoenkerTest
Streaming Koenker studentized Breusch\–Pagan testperformKoenkerTestStreaming
Perform Levene's test for equality of variancesperformLeveneTest
Perform McLeod-Li testperformMcLeodLiTest
Perform the non-constant variance (NCV) score testperformNCVTest
Perform O'Brien test for equality of variancesperformOBrienTest
Perform Park test for heteroscedasticityperformParkTest
Perform Pesaran CD testperformPesaranTest
Quantile regression heteroscedasticity testperformQuantileRegressionTest
Rank-based permutation heteroscedasticity testperformRankPermutationTest
Ramsey's RESET test for nonlinearityperformRESETTest
Scatter-plot diagnostics for heteroscedasticityperformScatterDiagnostic
Spatial heteroscedasticity testperformSpatialHeteroTest
Perform Spearman rank correlation testperformSpearmanTest
Perform Spread-Level testperformSpreadLevelTest
Studentized Breusch–Pagan testperformStudentizedBPTest
Szroeter test for ordered alternativesperformSzroeterTest
Test the functional form of the error varianceperformVarianceFormTest
Variance inflation factorsperformVIFDiagnostic
Perform White's test for heteroscedasticityperformWhiteTest
Bootstrap White testperformWhiteTestBootstrap
Robust White test with bootstrap and effect sizesperformWhiteTestRobust
Memory-efficient White test for large datasetsperformWhiteTestStreaming
Wild bootstrap heteroscedasticity testperformWildBootstrapTest
Plot diagnosticsplot.HeteroDiagnostic
Plot method for power analysis resultsplot.power_analysis
Compare residuals before and after remediationplotBeforeAfter
Bubble plot of residual variance by covariateplotBubbleVariance
Generate a suite of diagnostic plotsplotDiagnosticSuite
Enhanced diagnostic plot suiteplotDiagnosticSuiteEnhanced
Density plot of residualsplotResidualDensity
QQ plot of residualsplotResidualQQ
Plot residuals vs fitted valuesplotResidualsFitted
Enhanced residuals vs fitted plotplotResidualsFittedEnhanced
Spread-Level plot for variance diagnosticsplotSpreadLevel
Print method for enhanced White test resultsprint.htest_enhanced
Bootstrap a test statisticrbootstrap_test_statistic
Effect size calculations for heteroscedasticity diagnosticsrcalculateEffectSize
Register a custom diagnosticregisterDiagnostic
Register a diagnostic plotregisterPlot
Estimate test power from observed effect sizerestimate_test_power
Robust heteroscedasticity diagnosticsrobust_implementations
Run enhanced heteroscedasticity diagnosticsrrunAdvancedDiagnostics
Benchmark 'heteroTests' against reference implementationsgenerate_benchmark_report run_benchmark_suite
Run registered diagnostic plotsrunDiagnosticPlots
Run a suite of model diagnosticsrunDiagnostics
Run multiple heteroscedasticity diagnosticsrunHeteroTests
Parallel test execution helperrunHeteroTestsParallel
Run multivariate heteroscedasticity testsrunMultivariateTests
Run panel-data heteroscedasticity testsrunPanelTests
Run heteroscedasticity diagnostics on the data of a survey designrunSurveyHeteroTests
Run time-series heteroscedasticity testsrunTimeSeriesTests
Validate diagnostics against reference implementationsrvalidate_against_reference
Colour scale for heteroscedasticity diagnosticsscale_colour_hetero_diagnostic scale_fill_hetero_diagnostic
Simulate heteroscedastic datasigma_exponential sigma_exp_decay sigma_gaussian_peak sigma_group sigma_inverse sigma_linear sigma_logistic sigma_multiplicative sigma_piecewise sigma_piecewise_linear sigma_poly sigma_power sigma_sin sigma_spatial sigma_step sigma_u_shape simulate_arch1 simulate_hetero
Advanced simulation framework for test validationsimulate_power_analysis simulate_type_I_errors simulation_framework
Generate standardized error messagestd_error
Generate standardized warning messagestd_warning
Suggest remediation actions for heteroscedasticityprint.remediation_suggestions suggestRemediation
Summarize diagnosticssummary.HeteroDiagnostic
Shared instance of the test factorytest_factory
Run diagnostic teststest test.HeteroDiagnostic
Heteroscedasticity Test FactoryTestFactory
Heteroscedasticity diagnostic themetheme_hetero
broom methods for heteroscedasticity diagnosticsaugment.hetero_test augment.hetero_test_suite glance.hetero_test glance.hetero_test_suite tidy.hetero_grouped_suite tidy.hetero_test tidy.hetero_test_suite
Validate model and data inputs before running diagnosticsvalidateTestInputs