No slash command · from anofox-statistics
Documents the plot-ready long-table outputs of the anofox_statistics DuckDB extension: schemas (terms, summary, obs, prediction, curve, test), which table macro produces each, and how to pass them to anofox-visualization for plotting.
Ships in anofox-statistics. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Extension: anofox_statistics v0.17.0 | DuckDB: v1.5.6 / v2.0 | Contract version: anofox_contract_version() = '1'
New in 0.15.0: every contract producer
*_bymacro ends withrow_order BIGINT(1..n per group in display order); collect rows withlist(t ORDER BY t.row_order)instead of sorting by the struct.New in 0.16.0:
predict_grid_by,pspline_prediction_by(prediction);calibrate_by(curve,curve_type = 'calibrate');bootcov_by,cox_tidy_by,gls_tidy_by(terms);cox_glance_by,gls_glance_by(summary);cox_augment_by,gls_augment_by,aft_augment_by(obs);glm_score_test_by(test). Fitting details are in anofox-statistics-regression, residual meaning in anofox-statistics-diagnostics.
Fit functions return STRUCTs and LISTs. For charts, the _by table macros return long tables with fixed columns (one row per mark), the schemas of the anofox integration contract shared by anofox-statistics, anofox-forecast and the plotting extension anofox-visualization. Optional columns are always present (NULL when not computed) and the group column is kept.
Identifiers. Macros that fit one of the extension's models (_tidy_by, _glance_by, _partial_residuals_by, _rolling_tidy_by, _path_by, _cv_by, quantile_process_by, _prediction_by, _effects_by, cox_ / gls_tidy_by / _glance_by, predict_grid_by, pspline_prediction_by, calibrate_by, bootcov_by) return the group column, id (the group as VARCHAR), model_id and model_name (the method: 'ols', 'poisson', …), in that order, before the schema columns. _augment_by keeps all source columns and adds model_id / model_name but no id (a source column named id would collide). Macros whose groups are the things compared (roc_curve_by, pr_curve_by, calibration_curve_by, acf_by, pacf_by, kaplan_meier_by, pairwise_t_test_by, tukey_hsd_by, dunn_test_by) set model_id = the group value.
| Question / chart | Macro (per group of source) | Schema | anofox-visualization |
|---|---|---|---|
| Coefficients with intervals (forest plot), several models | <model>_tidy_by | terms | anofox_plot_terms |
| How coefficients change over time | <model>_rolling_tidy_by (ols, wls, ridge, elasticnet, huber, poisson) | terms (index_name = 'window_end') | anofox_plot_terms (one panel per term over the index) |
| Regularisation path | ridge_path_by, elasticnet_path_by, lars_path_by | terms ('lambda'; 'alpha' for LARS) | anofox_plot_terms |
| Effect across quantiles | quantile_process_by | terms ('tau') | anofox_plot_terms |
| Compare fit statistics (R², AIC, …) across models | <model>_glance_by | summary | anofox_plot_summary |
| Mixed model: fixed effects, BLUPs per level (caterpillar) | glmm_tidy_by(source, group_col, y_col, x_cols, re_group) | terms (+ effect: filter 'fixed' or 'ran_vals') | anofox_plot_terms |
| Residuals vs fitted, QQ, leverage, Cook's distance | ols_augment_by, wls_augment_by, <glm>_augment_by, ridge_augment_by (leverage and LOO only), glmm_augment_by (no leverage / Cook's) | obs | anofox_plot_obs, anofox_plot_diagnostics (plot.lm 2×2) |
| Fitted line / band, train vs test vs future | <model>_prediction_by (23 models) | prediction | anofox_plot_prediction |
| Marginal effect of one feature (effect plot) | <model>_effects_by (ols, wls, ridge, six GLMs) | prediction | anofox_plot_prediction |
rms Predict curve of a spline / categorical term (adjusted to datadist, pointwise or simultaneous band) | predict_grid_by(source, group_col, x_cols, model, terms, term[, grid_values, simultaneous, level]) (model and terms are columns of source, e.g. a view joining each group to its fit) | prediction (model_id = 'predict_grid', focal_name = term, y NULL) | anofox_plot_prediction |
Smooth of y on one x with band | pspline_prediction_by(source, group_col, x_col, y_col[, options, level, split]) | prediction (model_id = 'pspline') | anofox_plot_prediction |
| Overfitting-corrected calibration curve | calibrate_by(source, group_col, y_col, x_cols[, options := {'model', 'B', …}]) | curve ('calibrate'; x = predicted, y = bias-corrected) | anofox_plot_curve |
| Bootstrap SEs / percentile intervals of coefficients | bootcov_by(source, group_col, y_col, x_cols[, options, cluster, names]) | terms (model_id = 'bootcov', statistic / p_value NULL) | anofox_plot_terms |
| Cox hazard ratios, GLS coefficients and variance parameters | cox_tidy_by(source, group_col, time_col, x_cols, event_col[, names]) (log scale, no intercept), gls_tidy_by(…, subject_col, time_col[, options, names]) (effect: 'coefficient', 'correlation', 'variance', 'sigma') | terms | anofox_plot_terms (exponentiate Cox estimate / conf_* for an HR forest) |
| Cox / AFT / GLS residual plots | cox_augment_by (martingale residual + Schoenfeld, dfbeta), aft_augment_by (cox_snell_residual), gls_augment_by (normalized_residual) | obs (no leverage / Cook's) | anofox_plot_obs (resid_fitted) |
| ROC / PR / calibration curve | roc_curve_by, pr_curve_by, calibration_curve_by | curve | anofox_plot_curve |
CV error over lambda (lambda.min, lambda.1se) | ridge_cv_by, elasticnet_cv_by | curve ('lambda_cv') | anofox_plot_curve |
| Survival curves per stratum | kaplan_meier_by | curve ('km') | anofox_plot_curve |
| Residual autocorrelation | acf_by, pacf_by | curve ('acf' / 'pacf') | anofox_plot_curve |
| Scatterplot smoother | lowess_by(source, group_col, x_col, y_col[, frac, iterations]) | curve ('lowess'; not yet in the contract's curve_type vocabulary) | anofox_plot_curve |
| Time-varying coefficients | lm_dynamic_tidy_by(source, group_col, order_col, y_col, x_cols) | terms ('window_end', as rolling coefficients) | anofox_plot_terms |
| Pairwise comparisons (significance brackets) | pairwise_t_test_by, tukey_hsd_by, dunn_test_by | test | no dedicated plot macro |
| Score test for adding predictors to a GLM, per group | glm_score_test_by | test | no dedicated plot macro |
| Partial-residual / added-variable plot | <model>_partial_residuals_by (ols, wls, six GLMs) | not a contract schema | plot x vs partial_residual (or x_residual vs y_residual) with a generic scatter |
Signatures of these macros are in the anofox-statistics-batch skill; the source is always a table-name string ('my_table'), columns are unquoted.
The model macros also carry id (not _augment_by) and model_name next to model_id (see Identifiers above).
| Schema | Columns |
|---|---|
terms | model_id, term, estimate, std_error, statistic, p_value, conf_low, conf_high, conf_level, index_name, index_value (rolling adds window_end before term and n_window at the end) |
summary | model_id, model_type, metric, value |
obs | all source columns + model_id, model_name, row_id, fitted, residual, resid_type, std_residual, stud_residual, leverage, cooks_d, dffits, weight, is_training, n_params (+ loo_residual, loo_fitted for OLS / WLS / Ridge; + approx_loo_fitted, approx_loo_residual for GLMs) |
prediction | id, model_id, model_name, x, y, yhat, yhat_lower, yhat_upper, level, split (effects_by adds focal, se_fit and focal_name, the axis label: names[focal] with names := [...], else `'x' |
curve | model_id, series, curve_type, x, y, y_low, y_high, threshold, weight, n_censor (+ n_risk, n_event, std_err for KM; lambda, cv_mean, cv_se, n_nonzero, is_min, is_1se, n_folds for CV) |
test | model_id, test_id, method, statistic, p_value, group1, group2, p_adj, df1, df2, estimate, conf_low, conf_high, conf_level, effect_size, effect_name, alternative, p_adjust_method |
What the prediction columns mean: x is the x_col you pass (time or the main feature), id is the group as text (one panel per id), model_name is the method ('ols', …) so models overlay, split is 'train', 'test' (held out with split :=) or 'future' (NULL y), level is NULL for models without a band (PLS, quantile, isotonic).
SELECT anofox_contract_version(); -- '1'
-- Every producer and the schema it emits
SELECT DISTINCT function_name, tags['anofox.output'] AS output
FROM duckdb_functions()
WHERE tags['anofox.contract'] = '1'
ORDER BY output, function_name;
All functions of this extension also carry tags['anofox.family'] = 'statistics'. The test aggregates (t_test_agg, …) are tagged anofox.output = 'test': they return the test fields as a STRUCT, not a table.
curve_type per curve plot. ROC and calibration rows share columns (so UNION ALL works) but are plotted separately: GROUP BY curve_type or filter.UNION ALL BY NAME. Same schema, same columns; model_id tells the methods apart and id the groups. Filter or facet on id (or the group column) when one plot should show one group.lars_path_by has index_name = 'alpha' (upstream's LARS alpha), the ridge / elastic-net paths 'lambda' (glmnet's). Do not overlay them without rescaling.*_fit_predict_by is not the prediction schema. It keeps the source columns and adds yhat, yhat_lower, yhat_upper, is_training; use <model>_prediction_by for the contract columns (x, id, split, level).unnest(tidy(model), recursive := true) gives terms columns for one model; unnest(acf_agg(resid, 12 ORDER BY t), recursive := true) gives the ACF points. The _by macros do this per group for you.lambda is a SQL keyword: quote "lambda" in the CV tables, or use x.calibrate_by vs calibration_curve_by. calibration_curve_by bins given probabilities (apparent); calibrate_by fits the model and returns the bootstrap overfitting-corrected lowess curve (rms::calibrate). Both are curve rows with different curve_type, so they can share one plot only after filtering to one group.validate_by (one row per index), calibrate_cph_by (one row per risk group: km vs mean_predicted — plot as points with a scatter), pentrace_by, pca_by (scores appended to source rows).CREATE OR REPLACE TABLE plot_demo AS
SELECT i AS id, CASE WHEN i % 2 = 0 THEN 'A' ELSE 'B' END AS grp, i::DOUBLE AS x1,
((i * 3) % 7)::DOUBLE AS x2, 1.0 + 0.5 * i - 0.3 * ((i * 3) % 7) + sin(i) AS y,
round(exp(0.2 + 0.05 * i))::DOUBLE AS y_count, (sin(i) + 0.05 * i > 0.5) AS label,
1.0 / (1.0 + exp(-(sin(i) + 0.05 * i - 0.5))) AS prob
FROM range(1, 41) t(i);
-- terms: two models' coefficients in one table (model_id = the method)
SELECT * FROM ols_tidy_by('plot_demo', grp, y, [x1, x2], names := ['trend', 'cycle'])
UNION ALL BY NAME
SELECT * FROM huber_tidy_by('plot_demo', grp, y, [x1, x2], names := ['trend', 'cycle'])
ORDER BY grp, term, model_id;
-- summary: R² and AIC per group
SELECT grp, metric, round(value, 4) AS value
FROM ols_glance_by('plot_demo', grp, y, [x1, x2]) WHERE metric IN ('r_squared', 'aic');
-- obs: the most influential rows
SELECT grp, row_id, round(fitted, 3) AS fitted, round(residual, 3) AS residual, round(cooks_d, 3) AS cooks_d
FROM ols_augment_by('plot_demo', grp, y, [x1, x2])
ORDER BY cooks_d DESC LIMIT 3;
-- prediction: fitted line and 90% band over id, held-out rows marked 'test'
SELECT id, x, y, round(yhat, 2) AS yhat, round(yhat_lower, 2) AS lo, round(yhat_upper, 2) AS hi, split
FROM ols_prediction_by('plot_demo', grp, id, y, [x1, x2], level := 0.9,
split := CASE WHEN id > 36 THEN 'test' ELSE 'train' END)
WHERE x > 34 ORDER BY id, x;
-- prediction: expected count as x1 varies, x2 at its mean (GLM band on the response scale)
SELECT id, focal_name, round(x, 1) AS x1, round(yhat, 2) AS yhat, round(yhat_lower, 2) AS lo, round(yhat_upper, 2) AS hi
FROM poisson_effects_by('plot_demo', grp, y_count, [x1, x2], focal := 1, n_points := 3, names := ['x1', 'x2'])
ORDER BY id, x1;
-- curve: ROC and calibration curves of a classifier per group (plot each curve_type separately)
SELECT * FROM roc_curve_by('plot_demo', grp, label, prob)
UNION ALL
SELECT * FROM calibration_curve_by('plot_demo', grp, label, prob, n_bins := 4);
-- test: Tukey HSD of y across the x2 levels, per group
SELECT grp, test_id, round(estimate, 3) AS estimate, round(p_adj, 4) AS p_adj
FROM tukey_hsd_by('plot_demo', grp, y, x2::BIGINT) ORDER BY grp, test_id LIMIT 4;
-- New producers in 0.16.0 (same plot_demo table)
-- prediction: P-spline smooth of y on x1 with a 90% band
SELECT id, round(x, 1) AS x1, round(yhat, 2) AS yhat, round(yhat_lower, 2) AS lo, round(yhat_upper, 2) AS hi
FROM pspline_prediction_by('plot_demo', grp, x1, y, level := 0.9) WHERE x <= 4 ORDER BY id, x;
-- curve: bootstrap overfitting-corrected calibration of a logistic model (x predicted, y corrected)
SELECT id, curve_type, round(x, 3) AS predicted, round(y, 3) AS corrected
FROM calibrate_by('plot_demo', grp, label::INTEGER, [x1, x2], options := {'model': 'logistic', 'B': 20})
WHERE row_order <= 2;
-- terms: Cox hazard ratios for a forest plot (exponentiate the log-scale columns)
CREATE OR REPLACE TABLE surv_demo AS
SELECT *, round(exp(2 + 0.03 * id + 0.5 * sin(id)), 1) AS days, (id % 4 <> 0)::DOUBLE AS died FROM plot_demo;
SELECT grp, term, round(exp(estimate), 3) AS hr, round(exp(conf_low), 3) AS lo, round(exp(conf_high), 3) AS hi
FROM cox_tidy_by('surv_demo', grp, days, [x1, x2], died, names := ['x1', 'x2']) ORDER BY grp, term;
anofox-visualization is a separate DuckDB extension that renders SQL results to SVG. Its contract macros are aggregates over whole rows: alias the table and pass the alias. They are not part of this extension; load it first.
LOAD anofox_visualization;
-- Coefficient forest for group A: OLS and Huber dodged and coloured by model_id
SELECT anofox_plot_terms(t)
FROM (SELECT * FROM ols_tidy_by('plot_demo', grp, y, [x1, x2], names := ['trend', 'cycle'])
UNION ALL BY NAME
SELECT * FROM huber_tidy_by('plot_demo', grp, y, [x1, x2], names := ['trend', 'cycle'])) t
WHERE grp = 'A';
-- Fit + band, one panel per group (id), coloured by split
SELECT anofox_plot_prediction(p)
FROM ols_prediction_by('plot_demo', grp, id, y, [x1, x2], level := 0.9) p;
-- One curve plot per curve_type
SELECT curve_type, anofox_plot_curve(c)
FROM (SELECT * FROM roc_curve_by('plot_demo', grp, label, prob)
UNION ALL SELECT * FROM calibration_curve_by('plot_demo', grp, label, prob, n_bins := 4)) c
GROUP BY curve_type;
-- plot.lm 2x2 for group A
SELECT anofox_plot_diagnostics(o) FROM ols_augment_by('plot_demo', grp, y, [x1, x2]) o WHERE grp = 'A';
-- Fit statistics of two models side by side
SELECT anofox_plot_summary(s)
FROM (SELECT * FROM ols_glance_by('plot_demo', grp, y, [x1, x2])
UNION ALL BY NAME SELECT * FROM huber_glance_by('plot_demo', grp, y, [x1, x2])) s
WHERE grp = 'A';
Its plot macros: anofox_plot_terms, anofox_plot_prediction(tbl, x := NULL, y := NULL, facet := NULL), anofox_plot_curve, anofox_plot_summary, anofox_plot_obs(tbl, kind := 'resid_fitted' | 'qq' | 'scale_location' | 'leverage' | 'cooks', label_top := 3), anofox_plot_diagnostics and anofox_plot (picks the chart from the columns); all take width := / height :=. It has no macro for the test schema. For a *_fit_predict_by result name the position column: anofox_plot_prediction(p, x := 'x1', facet := 'grp').
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub datazoode/anofox-statistics --plugin anofox-statistics5 skills in this plugin
/anofox-statistics-batchAI-ready batch and per-group model fitting for the anofox_statistics DuckDB extension — training thousands of regression models in a single SQL query. Covers the *_fit_predict_by table macros (ols_fit_predict_by, huber_fit_predict_by, ransac_fit_predict_by, theil_sen_fit_predict_by, ridge_fit_predict_by, elasticnet_fit_predict_by, wls_fit_predict_by, rls_fit_predict_by, bls_fit_predict_by, alm_fit_predict_by, poisson_fit_predict_by, binomial_fit_predict_by, logistic_fit_predict_by, negbinom_fit_predict_by, gamma_fit_predict_by, tweedie_fit_predict_by, pls_fit_predict_by, isotonic_fit_predict_by, quantile_fit_predict_by, bayesian_ridge_fit_predict_by, ard_fit_predict_by, passive_aggressive_fit_predict_by, lm_dynamic_fit_predict_by) with split := and order_by :=, the per-group long-table macros <model>_tidy_by and <model>_glance_by (25 models), ols/wls/ridge/GLM _augment_by, <model>_partial_residuals_by, <model>_prediction_by (23 models), <model>_effects_by (marginal effects), <model>_rolling_tidy_by (rolling coefficients), ridge/elasticnet/lars_path_by, ridge/elasticnet_cv_by, ridge/elasticnet_nested_cv_by, quantile_process_by, acf_by / pacf_by, kaplan_meier_by, roc/pr/calibration_curve_by and pairwise_t_test_by / tukey_hsd_by / dunn_test_by, per-group aggregate fitting with GROUP BY plus predict / tidy / glance on the per-group model structs, the *_fit_predict_agg aggregates, rolling *_fit_predict window functions, the glmm_fit_by / eb_shrink_by / aid_by macros, and scaling patterns for fitting a separate model per segment / SKU / cohort over large panels. Also glmm_tidy_by / glance_by / augment_by, ols_anova_by / ols_anova_table_by, mediation_by, p_adjust_by, ridge / elasticnet_nested_cv_by, the split := rule and order_by := for rls_tidy_by. Since 0.16.0 also cox_fit_by / cox_tidy_by / cox_glance_by / cox_augment_by, gls_fit_by / gls_tidy_by / gls_glance_by / gls_augment_by, aft_augment_by, ordinal_fit_predict_by, continuation_ratio_fit_predict_by, multinomial_fit_predict_by, pspline_fit_predict_by / pspline_prediction_by / pspline_fit_predict_agg, predict_grid_by, validate_by / calibrate_by / calibrate_cph_by / bootcov_by, pentrace_by / penalized_ols_fit_by, glm_score_test_by, areg_impute_by, pca_by and dataset_drift_by; since 0.17.0 the monitoring macros cbpe_by, pca_reconstruction_drift_by, alert_band_by, classification_metrics_by, regression_metrics_by, ranking_metrics_by and data_quality_by. Use when the task is "fit one model per group" at scale, or "give me a coefficient / fit / residual / prediction table per group", rather than a single global fit.
/anofox-statistics-diagnosticsModel diagnostics, residual analysis, influence, multicollinearity, separation, predictive-accuracy indexes, data reduction, model-selection criteria, residual autocorrelation / heteroskedasticity checks, and demand-pattern classification in the anofox_statistics DuckDB extension. Covers per-row influence tables (ols_augment_by, wls_augment_by, poisson/binomial/logistic/negbinom/gamma/tweedie_augment_by: fitted, residual, std / studentized residuals, leverage, Cook's distance, DFFITS), partial residuals and added-variable data (<model>_partial_residuals_by, car::crPlots / avPlots), Variance Inflation Factor (vif / vif_agg) and generalized VIF for multi-column terms (gvif_agg, car::vif GVIF^(1/(2df))), Belsley-Kuh-Welsch condition indexes and variance-decomposition proportions (condition_diagnostic_agg, perturb::colldiag), separation of logistic / count fits (detect_separation_agg, separation_check_agg, count_sparsity_agg), rms / Hmisc accuracy indexes (somers2_agg, concordance_agg, rcorr_cens_agg, lrm_stats_agg, val_prob_agg, gini_md_agg, r2_measures), PCA (pca_agg with scale, pca_transform, pca_by), Harrell-style data reduction (spearman2_agg, hoeffding_d_agg, varclus_agg, redun_agg, box_cox_agg / box_cox_transform / box_cox_inverse), survival and GLS residuals (cox_zph_agg, cox_augment_by, aft_augment_by, gls_augment_by), AIC / BIC, residual diagnostics (residuals_diagnostics / residuals_diagnostics_agg), residual ACF / PACF with the white-noise band (acf_agg, pacf_agg, acf_by, pacf_by), Ljung-Box / Box-Pierce, Durbin-Watson (with p-value), Breusch-Pagan and White heteroskedasticity tests, AID demand-pattern and anomaly classification (aid_agg, aid_anomaly_agg, aid_by, aid_anomaly_by), plus tidy / glance and model-aware predict for fitted values. Also leave-one-out diagnostics: exact loo_residual / loo_fitted in ols / wls / ridge_augment_by (ridge leverage), PRESS, press_rmse and loo_r_squared in glance_by (compute_loo), one-step approx_loo_fitted for GLMs. Use when checking whether a fitted regression is sound — influential points, outliers, nonlinearity, multicollinearity, separation, autocorrelated or heteroskedastic residuals, proportional hazards — when measuring discrimination / calibration of a prediction, when screening or clustering predictors before modelling, or classifying a series' demand regime before choosing a model.
/anofox-statistics-regressionRegression models and the fit / fit_agg / predict API surface of the anofox_statistics DuckDB extension. Covers OLS, WLS, robust estimators (Huber incl. joint scale, RANSAC, Theil-Sen), penalized regression (Ridge incl. conditioning-aware lambda, Elastic Net, LARS, rms penalized OLS and pentrace), Bayesian Ridge / ARD, Passive-Aggressive, lmDynamic, LOWESS, P-splines (pspline_fit_agg), RLS, BLS/NNLS, PLS, isotonic, quantile regression (se iid / nid / boot, L1 alpha, quantile_process_agg), GLMs (Poisson, Binomial/Logistic, Negative Binomial, Tweedie, Gamma; prior weights, cluster-robust vcov, profile-likelihood CIs), multinomial logistic, ordinal (orm / polr cumulative link, continuation ratio), ALM, AFT and Cox proportional hazards survival (cox_fit_agg ties / strata / entry / robust, cox_zph_agg, cox_survival, cox_augment_agg), GLS with correlation / variance structures (nlme::gls), mixed-effects GLMM (n_agq), areg optimal transformations, and empirical-Bayes shrinkage. Also the Harrell / rms model-building workflow: spline bases (rcs, lsp, bspline, rcs_knots_agg, spline_spec, spline_basis, restricted_interaction), effects / contrast_agg / predict_grid_agg / nomogram_agg, Wald chunk tests (wald_anova) and fastbw, lr_test and glm_score_test_agg, validate_agg / calibrate_agg / calibrate_cph_agg / bootcov_agg, multiple imputation (areg_impute_agg) with pool_rubin_agg; HC and cluster-robust vcov (vcov follows hc_type), the stable return-struct fields, the call surfaces (scalar fit, aggregate fit_agg, window *_fit_predict, *_fit_predict_agg), predict(model, x) with se_fit / intervals (incl. stored multinomial / ordinal / pspline / areg models), tidy and glance, regularisation paths and cross-validation (ridge_cv_agg, cv_strategy, nested CV), nested F tests and ANOVA tables, and exact LOO PRESS. Use when picking a regression method, choosing a penalty, getting standard errors or intervals, modelling survival / ordinal / multiclass / longitudinal outcomes, or validating a prediction model in SQL. For per-group long tables see the batch skill; for VIF / condition indexes / separation / accuracy indexes the diagnostics skill; for t / TOST / ANOVA / Kaplan-Meier style tests the tests skill.
/anofox-statistics-testsStatistical hypothesis tests, post-hoc comparisons, correlation, effect sizes, equivalence testing, classifier evaluation, and time-series and survival tests in the anofox_statistics DuckDB extension. Covers the unified test-result fields (method, alternative, statistic, df1, df2, p_value, estimate, conf_low, conf_high, conf_level, effect_size, effect_name, n) and their deprecated aliases, normality tests (Shapiro-Wilk, Jarque-Bera, D'Agostino K2), parametric tests (two-sample, one-sample and paired t-tests with one-sided intervals, one-way, two-way Type III and repeated-measures ANOVA with Mauchly / Greenhouse-Geisser / Huynh-Feldt, Yuen, Brown-Forsythe), bootstrap confidence intervals of the mean (IID, stationary, circular and moving block), nonparametric tests (Mann-Whitney U, Kruskal-Wallis, Wilcoxon signed-rank with rank-biserial, Brunner-Munzel, permutation t-test), pairwise post-hoc tests (pairwise_t_test_agg, tukey_hsd_agg, dunn_test_agg and their _by macros, ptukey / qtukey), multiple-testing correction of any p-values (p_adjust_by, p_adjust_agg, p_adjust_list, p_adjust window function on DuckDB 2.0; R p.adjust), correlation (Pearson, Spearman, Kendall, partial and semi-partial, distance correlation, Spearman rho^2, Hoeffding's D, ICC with all six Shrout-Fleiss types), categorical / contingency tests (chi-squared, chi-squared GOF, G-test, Fisher's exact, McNemar), effect sizes (Cramér's V, phi, contingency coefficient, Cohen's kappa), proportion tests, TOST equivalence tests (t, paired, correlation, one-sample, one / two proportions, Wilcoxon, Yuen, bootstrap), distribution comparison (energy distance, MMD, multivariate energy / MMD permutation tests), evidently-style data drift (KS, Anderson-Darling, Cramér-von Mises, Epps-Singleton, Wasserstein, PSI, KL, Jensen-Shannon, Hellinger, TVD, z / chi-squared / G drift, column_drift_agg, dataset_drift_by, embedding_drift_agg, category_proportions_agg), NannyML-style model monitoring (CBPE performance estimation without labels: cbpe_fit_agg / cbpe_estimate_agg / cbpe_by; PCA reconstruction-error drift; alert_band_agg / alert_band_by reference-band thresholds), performance metrics (classification_metrics_agg, regression_metrics_agg, ranking_metrics_agg, data_quality_by), forecast-evaluation tests (Diebold-Mariano, Clark-West, Hansen SPA, MSPE-adjusted SPA, Model Confidence Set), residual autocorrelation and heteroskedasticity tests (Ljung-Box, Box-Pierce, Durbin-Watson with p-value, Breusch-Pagan, White), survival tests (Kaplan-Meier, log-rank with Peto-Peto rho and strata), causal mediation analysis (mediation_by / mediation_agg: ACME, ADE, total effect, proportion mediated), and classifier evaluation (ROC / PR / calibration curves, AUC, AUC-vs-chance p-values auc_null_p_value / auc_null_quantile, Brier score, log loss, roc_curve_by). Also: the nested-model F test (ols_anova_by), type I / II ANOVA tables (ols_anova_table_by), and seeded, bitwise-reproducible Monte Carlo, bootstrap and permutation tests. Use when running a significance test, comparing many groups or repeated conditions, testing equivalence, measuring association/effect size, evaluating a classifier or forecast models, detecting data or embedding drift, monitoring a deployed model, or comparing distributions or survival in SQL.
Other plugins' skills for the same job