stats
The stats collection provides common statistical operations — descriptive statistics, hypothesis tests and regression models — over tabular data. It is written in R, which has first-class, well-tested implementations of these methods in its base stats package, so the blocks are thin, dependency-light wrappers around functions statisticians already trust (summary, cor, t.test, aov, chisq.test, table, lm, glm).
The descriptive and test blocks share one shape: a single data input (type: file, format: CSV) and a single result output (type: json). They compose behind any source that produces a CSV — including data.read, fiadb.fullreport, or upstream sae/base blocks — and feed any downstream consumer that accepts JSON. All other configuration (column names, methods, test options) is passed as scalar args, never wired inputs.
Descriptive statistics:
stats.summary— per-column descriptive statistics.stats.frequency— one-way or cross-tabulated frequency tables.stats.correlation— a correlation matrix over numeric columns.
Hypothesis tests:
stats.t_test— one- or two-sample Student's t-test.stats.chisq_test— chi-squared test of independence.stats.anova— one-way analysis of variance.
Models:
stats.lm— linear regression by least squares.stats.glm— generalised linear models: gaussian, binomial, poisson, Gamma.
The model blocks follow the model-fitting contract shared with the sae, ml and models collections. They read Parquet or CSV, and name the model either with an R formula or with a target and a features column selector (names, globs and exclusions such as B*,MB*,-B0), plus id_columns, weights, categorical and na_action. A missing or misspelled column fails with near-match suggestions and the list of columns that exist. Each writes a fitted model (a SpadeModel file), a coefficient table and fit statistics, with optional cross-validation by rows or by groups (cv_group). The model feeds models.predict, which scores it without R, and models.linear / models.glm fit the same models on tables too large for memory.
All blocks in this collection declare network: false — they operate purely on data already produced elsewhere in the pipeline.
Blocks🔗
| Block | Kind | Description |
|---|---|---|
stats.summary | standard | Per-column descriptive statistics (n, mean, sd, min, quartiles, max, missing) |
stats.frequency | standard | One-way frequency table, or a contingency table when by is set |
stats.correlation | standard | Correlation matrix over numeric columns (pearson/spearman/kendall) |
stats.t_test | standard | One-sample (vs mu) or two-sample/paired Student's t-test |
stats.chisq_test | standard | Pearson's chi-squared test of independence between two categorical columns |
stats.anova | standard | One-way analysis of variance of a numeric response across a grouping column |
stats.lm | standard | Linear regression (least squares); writes a SpadeModel, coefficients and fit statistics |
stats.glm | standard | Generalised linear model (gaussian, binomial, poisson, Gamma); writes a SpadeModel |
Installation🔗
spade install file:///path/to/blocks/statsstats.summary
Per-column descriptive statistics (n, mean, sd, min, quartiles, max, missing).
Read →stats.frequency
Build a frequency table for a categorical column, optionally cross-tabulated.
Read →stats.correlation
Compute a correlation matrix over the numeric columns of a tabular dataset.
Read →stats.t_test
Student's t-test on a numeric column - one-sample or two-sample.
Read →stats.chisq_test
Pearson's chi-squared test of independence between two categorical columns.
Read →stats.anova
One-way analysis of variance (ANOVA) of a numeric response across groups.
Read →stats.lm
Linear regression by least squares (R's lm), written as a SpadeModel.
Read →stats.glm
Generalised linear model (R's glm): gaussian, binomial, poisson or Gamma, written as a SpadeModel.
Read →