Inside the QuantumLayers Statistical Pipeline: Every Test, What It Checks, and When It Runs

Every dataset loaded into QuantumLayers passes through the same statistical pipeline. Which tests run depends on the column types, on what earlier tests found, and on whether a result survives correction for multiple comparisons. This post walks through the pipeline stage by stage, names every test in it, states the thresholds each one applies, and explains how the surviving results are ranked into the findings you read.


Why the Tests Run as a Pipeline

A statistics library will run any test on any pair of columns and return a number. It will not tell you that the test was wrong for the data, that the result duplicates an earlier one, or that it is one of hundreds of tests and likely to include false positives.

The pipeline has three properties that separate it from a list of tests. First, it is type-aware: numeric, categorical, and datetime columns each route to the tests that suit them. Second, it is conditional: earlier results switch later tests on or off and change the data they operate on. Third, it is corrected: every hypothesis-test result is adjusted for the total number of tests before anything is reported.

The QuantumLayers statistical pipeline Column types route the tests; FDR correction filters every hypothesis-test result 1. Type and profile each column skewness, kurtosis, outliers, entropy 2. Number vs number Pearson, Spearman OLS regression VIF 3. Category vs number ANOVA, eta-squared Cohen’s d Kruskal-Wallis, Mann-Whitney 4. Category vs category Chi-square Cramér’s V 5. Over time ADF, CUSUM, level autocorrelation, trend STL seasonality Holt-Winters, SARIMA 6. Benjamini-Hochberg FDR correction 7. Rank, label severity, suggest a chart

Stage 1: Typing and Profiling Each Column

Every column is first classified as numeric, categorical, or datetime and profiled on its own: count, mean, median, standard deviation, range, and percentiles for numeric columns.

A highly skewed column produces a skewness finding with a recommendation to summarize it by the median or log-transform it. Excess kurtosis (the fourth standardized moment minus 3) flags tails that are heavier than a normal distribution would produce. Outlier detection uses the interquartile range rule, flagging values more than 1.5 times the IQR beyond the first or third quartile.

For categorical columns the profile measures entropy, which describes how evenly records are spread across categories. Profiling also decides eligibility for later stages: categorical columns need between 2 and 20 distinct values to be used in group comparisons and contingency tables.

Stage 2: Numeric Against Numeric

Pearson and Spearman correlation

Every pair of numeric columns is correlated twice. Pearson’s r measures linear association on the raw values. Spearman’s rho applies the same calculation to ranks, so it captures any monotonic relationship and is far less sensitive to the outliers flagged in Stage 1. Both coefficients appear in the correlation matrix.

Predictive regression

Correlation describes pairs. The regression stage fits ordinary least squares models in which one numeric column is predicted from others, and keeps only predictors whose coefficients are individually significant. The finding reports R², the number of significant predictors, and their names. On the USGS earthquake data, the pipeline found that magnitude and station count together explain 13.6 percent of the variance in depth (R² = 0.136). The predictors are real, and most of the variation remains unexplained, which is exactly what R² lets a reader see. The matching regression chart shows each coefficient with ±1 standard error bars, colored by significance.

Variance Inflation Factor

The Variance Inflation Factor detects redundancy spread across several columns by regressing each numeric column on all the others with ordinary least squares and computing VIF as 1 / (1 − R²). When any column exceeds 5, the pipeline reports the five highest values and names the worst offender with its explained-variance share. This is the check that keeps the regression stage honest, because coefficients estimated on redundant predictors are unstable.

Stage 3: Category Against Number

One-way ANOVA with effect sizes

For each eligible categorical column paired with each numeric column, the pipeline runs a one-way ANOVA. Significance alone is a poor guide on large datasets, so two effect sizes are attached to every result. Eta-squared gives the share of the numeric column’s variance explained by the grouping, labeled small below 0.06, medium from 0.06 to 0.14, and large above 0.14. Cohen’s d is computed for every pair of groups, and the pair with the largest standardized difference is reported by name.

The table below comes from the public USGS dataset used in What 10,877 Earthquakes in 30 Days Look Like, where the pipeline tested whether magnitude type (the method used to measure an earthquake’s size) relates to other columns.

ComparisonF statisticp-valueEta-squaredReading
magType vs mag1,545.4< 0.00010.587 (large)The grouping explains most of the variation
magType vs depth167.3< 0.00010.133 (medium)A real, moderate difference
magType vs gap8.0< 0.00010.006 (small)Statistically certain and practically negligible

All three p-values are effectively zero; eta-squared separates them. The first explains close to 59 percent of the variance in magnitude, while the third explains about half of one percent. With 10,877 rows, even a trivial difference reaches significance.

Kruskal-Wallis and Mann-Whitney U as fallbacks

ANOVA assumes roughly normal values with similar spread in each group. When ANOVA finds no significant effect for a pair, the pipeline runs the Kruskal-Wallis test, which ranks all observations and tests whether average ranks differ between groups. Because it uses ranks, extreme values cannot dominate it.

If Kruskal-Wallis is significant, a Mann-Whitney U test compares the two largest groups directly. ANOVA goes first because it has more power when its assumptions hold. Kruskal-Wallis runs only when ANOVA comes back empty, which prevents the same grouping effect from being reported twice under two test names.

Stage 4: Category Against Category

Pairs of categorical columns are tested with the chi-square test of independence. Sparse tables are skipped: the test requires at least 20 total observations and no more than 80 percent of cells with expected counts below 5.

Like ANOVA, chi-square reaches significance on almost any association once the sample is large. Cramér’s V addresses this by scaling the chi-square statistic to a range from 0 to 1 that does not grow with sample size. A categorical association is reported only when it clears two thresholds together: p below 0.05 and V above 0.1. Associations with V above 0.3 are marked high severity.

Stage 5: Analysis Over Time

When a dataset contains a datetime column, each numeric column is aggregated by a time interval and analyzed as a series. The temporal stage is the most conditional part of the pipeline: each test changes what the following tests operate on, and the descriptive results decide which series are forecast.

Stationarity: the Augmented Dickey-Fuller test

A series whose mean drifts over time is non-stationary, and most standard tests give misleading answers on it. The Augmented Dickey-Fuller test checks each series for a unit root. When one is found, the pipeline emits a stationarity warning and applies first differencing, so every later temporal test analyzes period-to-period changes instead of levels.

Structural breaks: CUSUM

A series can be stationary within each period and still shift abruptly between them, for example after a pricing change. The CUSUM test accumulates deviations from the overall mean, locates the point of largest departure, and compares the normalized departure to a critical value of 1.36 at the 5 percent level. A significant break is reported with its date, the mean before and after, and the percentage change. On the earthquake data it located a shift in hourly mean magnitude around August 6, from 1.89 to 1.67, a drop of 11.6 percent (CUSUM = 2.08). Detecting a break also suppresses the average-level test for that series, since a single mean across two regimes describes neither of them.

Level, autocorrelation, and trend

Three descriptive tests follow on the prepared series. The average-level z-test checks whether the aggregated mean differs significantly from zero; on differenced data, a significant mean indicates consistent growth or decline per period. Lag-1 autocorrelation measures whether consecutive periods resemble each other, with values above 0.3 indicating momentum and values below minus 0.3 indicating oscillation. Trend detection fits a linear regression over time and reports a direction when R² exceeds 0.1.

Seasonality: STL decomposition

Every time series column is also decomposed, STL-style, into trend, seasonal, and residual components. The seasonal period follows the aggregation interval: hourly data is checked for a daily cycle, daily data for a weekly cycle, monthly data for a yearly one. The finding reports a seasonal strength between 0 and 1, which measures how much of the detrended variation the recurring cycle accounts for, along with where the cycle peaks and where it bottoms out. Separating the cycle from the trend also prevents a December spike from being read as growth.

Forecasting: Holt-Winters and SARIMA

The pipeline produces forecasts with two complementary models: Holt-Winters exponential smoothing, which projects level, trend, and season forward, and a SARIMA model, which adds autoregressive and moving-average terms to a seasonal component. Forecasts are not produced for every column. They are reserved for the columns that showed the strongest trend, seasonality, autocorrelation, or a structural break in the earlier stages, so modeling effort goes to series with a pattern worth projecting rather than to flat noise.

Each forecast finding names the model and its order, the horizon, the starting and projected values, and the percentage change. On the earthquake data, a SARIMA(2,0,1)(1,1,1)[24] model, whose seasonal term reflects the 24-hour cycle of hourly data, projected the hourly mean station count rising 30.5 percent over the next 12 hours. When the two models disagree in direction, the recommendation says so and asks for a cross-check.

Lead and lag: cross-correlation

Cross-correlation shifts one series against another to find delayed relationships. Each series is checked with the ADF test and differenced if needed before this step, which removes the shared-trend correlations that would otherwise appear at every lag. Lag 0 is excluded because Stage 2 already covers simultaneous correlation. The maximum lag tested is the smaller of 10 or one quarter of the number of periods, and a result must exceed the larger of 0.3 or 2/√n to be reported.

Stage 6: Benjamini-Hochberg False Discovery Rate Correction

Twenty numeric and five categorical columns produce 300 pairwise tests before any temporal work. At a 5 percent level, that many tests yield around fifteen false positives by chance alone.

The pipeline applies the Benjamini-Hochberg procedure across every hypothesis-test result in the run. P-values are ranked, each is adjusted by the total number of tests divided by its rank, and monotonicity is enforced so that adjusted values never decrease down the ranking. Results whose adjusted p-value exceeds 0.05 are removed entirely. Surviving results carry both the raw and the adjusted p-value. Descriptive measures that are not hypothesis tests, such as VIF, skewness, seasonal strength, and forecasts, are kept on their own thresholds.

Stage 7: Ranking the Findings

What survives correction is ranked rather than listed. Each finding receives an importance score built from its statistical strength and effect size, which places it in a band from low to critical, plus a severity label such as high, warning, positive, or info. Each carries a plain-language message, a recommendation, and a chart matched to the test, such as a box plot for outliers or a line chart for a forecast.

The pipeline is deterministic. The same data produces the same findings in the same order. When the optional AI narrative is switched on, the language model writes from these validated findings, so it interprets results the statistics have already established instead of computing its own. The case for that design is laid out in Why Statistical Preprocessing Matters.

The Full Statistical Pipeline at a Glance

TestRuns onWhat it decidesReporting threshold
IQR outlier ruleEach numeric columnShare of extreme valuesBeyond 1.5 × IQR
Skewness and excess kurtosisEach numeric columnDistribution shape and tail weightHigh skewness or excess kurtosis
EntropyEach categorical columnHow informative a grouping is2 to 20 categories to qualify
Pearson and SpearmanNumeric pairsLinear and monotonic associationFDR-adjusted p < 0.05
OLS regressionNumeric columnsWhich variables jointly predict anotherSignificant predictors, R² reported
VIFAll numeric columns togetherMulticollinearityVIF > 5
One-way ANOVACategory vs numberGroup mean differences, with eta-squared and Cohen’s dFDR-adjusted p < 0.05
Kruskal-WallisCategory vs number, when ANOVA is not significantRank differences, resistant to skewFDR-adjusted p < 0.05
Mann-Whitney UTwo largest groupsDirect two-group comparisonFollows a significant Kruskal-Wallis
Chi-square with Cramér’s VCategory pairsAssociation strengthp < 0.05 and V > 0.1
Augmented Dickey-FullerEach time seriesStationarity; triggers differencingUnit root detected
CUSUMEach time seriesStructural break date and sizeCritical value 1.36
Average-level z-testEach time seriesBaseline or consistent growthSkipped after a break
Lag-1 autocorrelationEach time seriesMomentum or oscillation|r| > 0.3
Linear trendEach time seriesDirection over timeR² > 0.1
STL decompositionEach time seriesRecurring cycle, peak and troughSeasonal strength 0 to 1
Holt-Winters and SARIMAStrongest-pattern seriesProjected direction and size of changeReserved for real trend, season, or break
Cross-correlationPairs of time seriesLeading and lagging relationshipsmax(0.3, 2/√n), lag 0 excluded
Benjamini-HochbergAll hypothesis-test resultsWhich findings are reportedAdjusted p < 0.05

Where the Pipeline Runs

The same statistical pipeline sits behind every analytical feature in QuantumLayers. AI Insights runs it on demand, narrowed by columns, rows, or a custom prompt. Scheduled reports rerun the pipeline on refreshed data, and Monitors use it to decide whether a change between syncs is statistically real before sending an alert by email, Slack, or webhook. AI agents reach the same findings through the QuantumLayers MCP server.

Rigor as a Default Setting

Each test in the pipeline is standard and well documented. What QuantumLayers adds is the sequencing: profiling before testing, the right test for each pair of column types, seasonality separated from trend, forecasts only where a pattern is real, non-parametric fallbacks when assumptions fail, stationarity checks before any time-series comparison, effect sizes beside every p-value, and a false discovery rate correction over the whole run. Applied automatically, that sequence runs the same way on every dataset, and the findings that reach you have already passed it.


This post is part of the QuantumLayers blog series on making data-driven decisions you can trust. For the foundations behind each test, see Understanding Your Data: A Comprehensive Guide to Statistical Analysis and Beyond the Basics: Advanced Statistical Tests That Separate Signal from Noise. Run the pipeline on your own data at www.quantumlayers.com.