Command reference
Every command ChakataStat can run, with its arguments — the reference for writing syntax by hand in the Syntax editor, for a .cks script run by --run, or for driving the app from the Python client or an MCP agent.
Generated from the catalog. This page is produced by
dart run tool/gen_command_reference.dartfromlib/tools/tool_catalog.dart, the single source of truth for the tool surface, and a test fails if the two drift — so an argument listed here is an argument the engine accepts. Do not edit it by hand.
108 commands, by family.
- Discovering the dataset
- Descriptive statistics
- Comparing means
- Bayesian tests
- Nonparametric tests
- Correlation
- Regression and modeling
- Scale, reduction and classification
- Survival analysis
- Time series
- Evidence synthesis and resampling
- Power and sample size
- Complex samples
- Tables
- Charts
- Transforms
Reading an entry
Arguments are name=value. A variable is named bare (Age), a list is bracketed ([Age, Income]), text is quoted, and a boolean is true or false. The syntax line shows the required arguments only; the table under it lists every argument, required or not.
A ⚠️ marks an argument that writes new variables into your dataset (an analysis's "save …" option). A read-only session — the AI assistant by default, --mcp --read-only, a read-only batch run — withholds and refuses those.
Discovering the dataset
list_variables
List the dataset's variables — name, type, measurement level and label — so you know what is available to analyze. Call this first when you do not yet know the variable names.
list_variables
No arguments.
Descriptive statistics
descriptives
Descriptive statistics (N, missing, mean, std. dev., min, max, median, sum) for one or more numeric variables.
descriptives variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric variables to summarize. |
frequencies
A frequency table of each variable's distinct values (count, percent, cumulative percent). Works on numeric or text variables.
frequencies variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The variables to tabulate. |
explore
Extended descriptives — quartiles, IQR, skewness, kurtosis — for numeric variables, optionally split by a factor.
explore variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric variables to explore. |
factor |
variable | no | Optional variable to split the statistics by. |
crosstabs
A contingency table of one variable against another, optionally with chi-square tests of independence (Pearson, likelihood-ratio, and Fisher's exact for a 2×2 table) and association measures (phi, Cramér's V, Goodman & Kruskal's gamma and lambda; for a matched square table, Cohen's kappa and McNemar's test). Add a layer variable for a stratified table with the Cochran/Mantel-Haenszel statistics.
crosstabs row=VarName column=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
row |
variable | yes | The row variable. |
column |
variable | yes | The column variable. |
chi_square |
true / false | no | Whether to include the chi-square tests and association measures. |
layer |
variable | no | An optional control (layer) variable: the table is computed separately within each of its values (a stratified three-way table). |
cmh |
true / false | no | With a layer variable and a 2×2 table in each layer, add the Cochran and Mantel-Haenszel tests of conditional independence, the Mantel-Haenszel common odds ratio, and the Breslow-Day homogeneity test. |
missing_value_analysis
Characterizes the missingness across several numeric variables: a per-variable missing summary, the distinct missingness patterns, Little's MCAR test (is the data missing completely at random?), the EM maximum-likelihood mean/SD under missingness, and optionally EM single-imputed values saved as new variables.
missing_value_analysis variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric variables to examine (at least two). |
save_imputed |
true / false | no | ⚠️ saves new variables — Save EM single-imputed values back as new variables (named |
multiple_imputation
Multiple imputation with Rubin pooling: generate m completed datasets by chained equations (each incomplete variable regressed on the others, redrawing its missing entries from the Bayesian predictive distribution), run an analysis on each completed dataset, and pool the estimates and standard errors by Rubin's rules (within- plus between-imputation variance, with a Barnard-Rubin df adjustment and the fraction of missing information, FMI). Reproducible for a fixed seed. The pooled analysis is a linear regression (the variables are the outcome then the predictors) or a single variable mean.
multiple_imputation variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The analysis variables to pool. For regression_linear, the outcome first then the predictors; for mean, a single variable. |
analysis |
one of regression_linear, mean |
no | The analysis run on each completed dataset and then pooled (default regression_linear). |
auxiliary |
variable list | no | Extra numeric variables used only to help impute the missing values; they are not part of the pooled analysis. |
imputations |
integer | no | The number of imputations m (default 5). |
iterations |
integer | no | The number of chained-equation cycles per imputation (default 10). |
confidence |
number | no | The confidence level between 0 and 1 (default 0.95). |
seed |
integer | no | The PRNG seed (default 1), making the imputation reproducible. |
Comparing means
means
Means (and N and std. dev.) of numeric variables across the levels of a factor.
means variables=[Var1, Var2] factor=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric dependent variables. |
factor |
variable | yes | The variable whose levels define the groups. |
one_sample_ttest
A one-sample t test comparing each variable's mean against a test value.
one_sample_ttest variables=[Var1, Var2] test_value=0.5
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric test variables. |
test_value |
number | yes | The value to compare each mean against. |
tails |
one of two, one |
no | Significance direction: "two" (two-tailed, the default) or "one" (one-tailed). |
confidence |
number | no | Confidence level (percent) for the interval of the mean difference; defaults to 95. |
independent_ttest
An independent-samples t test comparing a variable's mean between the two groups of a grouping variable.
independent_ttest variables=[Var1, Var2] grouping=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric test variables. |
grouping |
variable | yes | The variable defining the two groups to compare. |
tails |
one of two, one |
no | Significance direction: "two" (two-tailed, the default) or "one" (one-tailed). |
confidence |
number | no | Confidence level (percent) for the interval of the mean difference; defaults to 95. |
permutation |
true / false | no | Also run the permutation (randomization) test of the mean difference — no distributional assumptions: exact enumeration of every group assignment when feasible, otherwise a seeded Monte Carlo with a 99% interval on the permutation p. Not available under Weight Cases. Defaults to false. |
replicates |
number | no | Monte-Carlo resamples for the permutation test (default 10000); ignored when the exact enumeration runs. Only applies with permutation=true. |
seed |
number | no | Random seed for the Monte-Carlo permutation draws (default 1); the same seed reproduces the same p exactly. Only applies with permutation=true. |
paired_ttest
A paired-samples t test comparing the means of paired variables (e.g. before vs. after), tested on each case's difference.
paired_ttest pair1=[Var1, Var2] pair2=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
pair1 |
variable list | yes | The first variable of each pair. |
pair2 |
variable list | yes | The second variable of each pair, matched by position to pair1 (both lists must be the same length). |
tails |
one of two, one |
no | Significance direction: "two" (two-tailed, the default) or "one" (one-tailed). |
confidence |
number | no | Confidence level (percent) for the interval of the mean difference; defaults to 95. |
equivalence_ttest
An equivalence test (TOST — two one-sided t tests) of whether a mean difference lies inside declared equivalence bounds: "not significantly different" is not "equivalent", and this procedure can support equivalence where a t test only fails to reject. Covers a one-sample / paired design (against a test value or on the case differences) and two independent samples (pooled and Welch rows). Reports both one-sided tests, the TOST p (the larger one-sided p), the 1 − 2α confidence interval of the difference and an Equivalent / Not equivalent decision at α.
equivalence_ttest variables=[Var1, Var2] bound_lower=0.5 bound_upper=0.5
| Argument | Accepts | Required | Notes |
|---|---|---|---|
test |
one of one_sample, paired, independent |
no | The design: "one_sample" (the default; each variable's mean vs. test_value), "paired" (each variable vs. its pair2 partner, on the case differences) or "independent" (each variable's mean between the two groups of the grouping variable). |
variables |
variable list | yes | The numeric test variables (the first variable of each pair for a paired test). |
pair2 |
variable list | no | For a paired test: the second variable of each pair, matched by position to variables (same length). |
grouping |
variable | no | For an independent-samples test: the variable defining the two groups to compare. |
test_value |
number | no | For a one-sample test: the value the equivalence bounds are centered on; defaults to 0. |
bound_lower |
number | yes | The lower equivalence bound, in bound_unit units (must be below bound_upper; e.g. -2 raw units, or -0.5 with bound_unit "cohen_d"). |
bound_upper |
number | yes | The upper equivalence bound, in bound_unit units. |
bound_unit |
one of raw, cohen_d |
no | Units of the bounds: "raw" (the default — the variable's own units) or "cohen_d" (converted per design with the uncorrected standardizer; note that d-scale bounds are sample-dependent). |
alpha |
number | no | Significance level of each one-sided test; the decision reads Equivalent when the TOST p < α, and the interval shown is the 1 − 2α CI. Defaults to 0.05. |
anova
A one-way ANOVA of numeric variables across a factor's levels (between/within sums of squares, F and significance), optionally with a Levene homogeneity test, a Welch robust test and post-hoc comparisons.
anova variables=[Var1, Var2] factor=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric dependent variables. |
factor |
variable | yes | The factor whose levels are compared. |
homogeneity |
true / false | no | Add Levene's test of homogeneity of variance. |
welch |
true / false | no | Add Welch's robust test of equality of means (unequal variances). |
posthoc |
true / false | no | Add post-hoc pairwise comparisons (Bonferroni, Scheffé and Tukey HSD adjusted). |
contrast |
number list | no | A planned (a-priori) contrast: one coefficient per factor level (in sorted level order); they should sum to zero. Tested both assuming equal variances and not (Welch-Satterthwaite). |
confidence |
number | no | Confidence level (percent) for post-hoc comparison intervals; defaults to 95. |
levene
Levene's test of homogeneity of variance for numeric variables across a factor's levels (an assumption check for t tests and ANOVA).
levene variables=[Var1, Var2] factor=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric variables to test. |
factor |
variable | yes | The factor whose levels define the groups. |
Bayesian tests
bayesian_ttest
A Bayesian t test — the JZS (Jeffreys-Zellner-Siow) Bayes factor and a posterior summary for a mean, in place of a classical t test. Covers a one-sample / paired design (test against a value or on the case differences) and two independent samples. Reports BF₁₀ (evidence for a difference) and BF₀₁ (evidence for the null) — so, unlike a p-value, it can support the null — a verbal evidence category, and the posterior median and credible interval of the standardized effect size δ under a Cauchy(0, r) prior.
bayesian_ttest variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
test |
one of one_sample, paired, independent |
no | The design: "one_sample" (the default; each variable's mean vs. test_value), "paired" (each variable vs. its pair2 partner, on the case differences) or "independent" (each variable's mean between the two groups of the grouping variable). |
variables |
variable list | yes | The numeric test variables (the first variable of each pair for a paired test). |
pair2 |
variable list | no | For a paired test: the second variable of each pair, matched by position to variables (same length). |
grouping |
variable | no | For an independent-samples test: the variable defining the two groups to compare. |
test_value |
number | no | For a one-sample test: the value to compare each mean against; defaults to 0. |
prior_scale |
number | no | The Cauchy prior scale r on the standardized effect size; defaults to 0.707 (≈ 1/√2, the standard "medium" scale). |
confidence |
number | no | Credible level (percent) for the posterior interval of δ; defaults to 95. |
bayesian_correlation
A Bayesian test of correlation — the JZS / Ly Bayes factor and a posterior for Pearson's ρ — for each pair of variables. Reports BF₁₀ (evidence that the pair is correlated) and BF₀₁ (evidence for no correlation — which a p-value cannot give), a verbal evidence category, and the posterior median and credible interval of ρ under a stretched-beta prior.
bayesian_correlation variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric variables to correlate pairwise (at least two). |
prior_width |
number | no | The stretched-beta prior width κ on ρ; defaults to 1 (a uniform prior on −1…1). Smaller κ concentrates the prior near 0. |
confidence |
number | no | Credible level (percent) for the posterior interval of ρ; defaults to 95. |
bayesian_anova
A Bayesian one-way ANOVA — the Zellner-Siow g-prior Bayes factor for the group-means model against the no-effect null, for each dependent variable across a factor's levels. Reports BF₁₀ (evidence the factor matters) and BF₀₁ (evidence it does not — which a p-value cannot give), a verbal evidence category, and η² (the variance explained).
bayesian_anova variables=[Var1, Var2] factor=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric dependent variables. |
factor |
variable | yes | The factor whose levels define the groups to compare. |
prior_scale |
number | no | The Cauchy prior scale r on the standardized group effects; defaults to 0.5 (the standard "medium" fixed-effect scale). |
bayesian_regression
A Bayesian linear regression — the Normal-Inverse-Gamma posterior for the coefficients and residual variance, plus the regression Bayes factor for the full model against the intercept-only null. Reports each coefficient's posterior mean (the OLS estimate under the diffuse prior) and credible interval, the residual-variance posterior, R², and BF₁₀ / BF₀₁ (evidence the predictors matter, or do not).
bayesian_regression dependent=VarName predictors=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependent |
variable | yes | The continuous numeric dependent variable. |
predictors |
variable list | yes | The numeric predictor variables. |
prior_scale |
number | no | The Cauchy prior scale r for the Bayes factor's g-prior; defaults to √2/4 ≈ 0.354 (the standard "medium" continuous scale). |
confidence |
number | no | Credible level (percent) for the posterior intervals; defaults to 95. |
Nonparametric tests
mann_whitney
A Mann-Whitney U test: compares a numeric variable's distribution between the two groups of a grouping variable (the nonparametric alternative to the independent-samples t test). Asymptotic, tie-corrected.
mann_whitney variables=[Var1, Var2] grouping=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric test variables. |
grouping |
variable | yes | The variable defining the two groups to compare. |
exact |
true / false | no | When true, also report the exact small-sample significance beside the asymptotic one; it falls back to asymptotic for tied data or a sample too large to enumerate. Defaults to false. |
wilcoxon
A Wilcoxon signed-rank test: compares paired variables on their ranked differences (the nonparametric alternative to the paired-samples t test).
wilcoxon pair1=[Var1, Var2] pair2=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
pair1 |
variable list | yes | The first variable of each pair. |
pair2 |
variable list | yes | The second variable of each pair, matched by position to pair1 (both lists must be the same length). |
exact |
true / false | no | When true, also report the exact small-sample significance beside the asymptotic one; it falls back to asymptotic for tied absolute differences or a sample too large to enumerate. Defaults to false. |
sign_test
A sign test: compares paired variables using only the direction (sign) of each per-case difference — the simplest nonparametric alternative to the paired-samples t test, weaker than Wilcoxon.
sign_test pair1=[Var1, Var2] pair2=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
pair1 |
variable list | yes | The first variable of each pair. |
pair2 |
variable list | yes | The second variable of each pair, matched by position to pair1 (both lists must be the same length). |
runs_test
A Wald-Wolfowitz runs test: dichotomizes each variable at a cut point and tests whether the resulting sequence (in case order) is random — too few or too many runs signal non-randomness.
runs_test variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric test variables. |
cutpoint |
one of median, mean, custom |
no | How to dichotomize each variable: "median" (the default), "mean", or "custom" (then set cut_value). Cases below the cut point are split from those at or above it. |
cut_value |
number | no | The cut point when cutpoint is "custom"; ignored otherwise. |
exact |
true / false | no | When true, also report the exact small-sample significance (the exact run-count distribution) alongside the asymptotic one. Defaults to false (asymptotic only). |
binomial
A binomial test: dichotomizes each variable at a cut point and tests the observed proportion in group 1 against a hypothesized proportion. Exact by default (two-tailed for a 0.5 proportion, one-tailed otherwise), with an asymptotic normal-approximation method.
binomial variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric test variables. |
test_prop |
number | no | The hypothesized proportion for group 1, between 0 and 1 (default 0.5). |
cut_value |
number | no | The cut point: group 1 is values at or below it, group 2 above it. Defaults to the minimum observed value (so a 0/1 indicator splits naturally). |
method |
one of exact, asymptotic |
no | The significance method: "exact" (the default) or "asymptotic" (the continuity-corrected normal approximation). Exact falls back to asymptotic for non-integer weighted counts. |
kruskal_wallis
A Kruskal-Wallis test: compares a numeric variable's distribution across all levels of a grouping variable (the nonparametric alternative to one-way ANOVA). Tie-corrected.
kruskal_wallis variables=[Var1, Var2] grouping=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric dependent variables. |
grouping |
variable | yes | The variable whose levels define the groups. |
exact |
true / false | no | When true, also report the exact small-sample significance beside the asymptotic one; it falls back to asymptotic for tied data or a sample too large to enumerate. Defaults to false. |
posthoc |
true / false | no | When true, also report Dunn's pairwise post-hoc comparisons of the group mean ranks. Defaults to false. |
posthoc_adjust |
one of bonferroni, holm, none |
no | The multiplicity adjustment for Dunn's comparisons: 'bonferroni' (default), Holm's step-down 'holm', or 'none'. |
friedman
A Friedman test: compares three or more related (repeated) measures on their within-case ranks (the nonparametric alternative to a repeated-measures ANOVA).
friedman variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric related measures (one variable per condition), compared within each case. |
kendall_w
Kendall's coefficient of concordance W: the agreement among several rankers (the cases) who each rank the same set of items (one variable per item), on a 0..1 scale (1 = perfect agreement). The sibling of the Friedman test, reported with its equivalent chi-square significance.
kendall_w variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric items (two or more) each case ranks; W measures how consistently the cases rank them. |
cochran_q
Cochran's Q test: compares the success rate of three or more related dichotomous (0/1) variables measured on the same cases (the k-sample extension of McNemar's test, and the nonparametric counterpart of a repeated-measures ANOVA for a binary outcome).
cochran_q variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The related dichotomous variables (two or more), each value one of at most two distinct values across the set; the higher value counts as a success. Compared within each case. |
jonckheere
A Jonckheere-Terpstra test: compares a numeric variable across the ordered levels of a grouping variable, testing for a monotone trend (the ordered-alternative counterpart of the Kruskal-Wallis test). Tie-corrected.
jonckheere variables=[Var1, Var2] grouping=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric dependent variables. |
grouping |
variable | yes | The ordered grouping variable; its levels are taken in ascending order and the test looks for a trend across them. |
normality
Tests of normality for numeric variables: Shapiro-Wilk and Kolmogorov-Smirnov (with Lilliefors significance). A small significance suggests the variable departs from a normal distribution.
normality variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric variables to test for normality. |
significance |
number | no | Significance level (alpha, a fraction such as 0.05) for the Decision column, which rejects normality when the test significance falls below it; defaults to 0.05. |
Correlation
correlate
Bivariate correlations among numeric variables (a correlation matrix with significance), using Pearson, Spearman or Kendall coefficients.
correlate variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | Two or more numeric variables to correlate. |
method |
one of pearson, spearman, kendall |
no | The coefficient: "pearson" (linear, the default), "spearman" (rank) or "kendall" (tau-b, rank). Spearman and Kendall suit ordinal data or non-linear monotonic relationships. |
tails |
one of two, one |
no | Significance direction: "two" (two-tailed, the default) or "one" (one-tailed, when the sign of the correlation is predicted in advance). |
missing |
one of pairwise, listwise |
no | Missing-data deletion: "pairwise" (the default — each pair uses the cases valid on both) or "listwise" (every coefficient uses only the cases valid on all the chosen variables). |
plot |
true / false | no | Also draw the coefficient matrix as a heatmap: colored cells on a diverging scale (negative through neutral to positive), which shows the structure of a large matrix at a glance. |
permutation |
true / false | no | Also run the permutation (randomization) test of the coefficient — no distributional assumptions: exact enumeration of every arrangement when feasible, otherwise a seeded Monte Carlo with a 99% interval on the permutation p. Needs exactly two variables and the pearson or spearman method; not available under Weight Cases. Defaults to false. |
replicates |
number | no | Monte-Carlo resamples for the permutation test (default 10000); ignored when the exact enumeration runs. Only applies with permutation=true. |
seed |
number | no | Random seed for the Monte-Carlo permutation draws (default 1); the same seed reproduces the same p exactly. Only applies with permutation=true. |
partial_correlate
Partial Pearson correlations among variables, controlling for one or more other variables.
partial_correlate variables=[Var1, Var2] controls=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric variables to correlate. |
controls |
variable list | yes | The numeric variables to control for. |
tails |
one of two, one |
no | Significance direction: "two" (two-tailed, the default) or "one" (one-tailed). |
polychoric_correlation
Polychoric (or tetrachoric, for binary items) correlations: the maximum-likelihood latent correlation two ordinal/binary variables would have if each were a coarsened slice of an underlying continuous normal variable. This is the correct input to factor analysis of ordinal/Likert items. Reports the latent-correlation matrix and a pairwise table of estimates with standard errors. Integer-coded ordinal variables are expected (each distinct value is a category).
polychoric_correlation variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | Two or more integer-coded ordinal (or binary) variables; each distinct value is treated as an ordered category. |
method |
one of polychoric, tetrachoric |
no | "polychoric" (the default, any number of ordered categories) or "tetrachoric" (requires binary variables — the 2×2 special case). |
canonical_correlation
A canonical correlation analysis between two sets of numeric variables: the canonical correlations (with their squares), the Wilks-lambda / Bartlett dimension-reduction χ² tests of whether each function's correlation and those beyond it are zero, and the standardized canonical coefficients for each set.
canonical_correlation set1=[Var1, Var2] set2=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
set1 |
variable list | yes | The first set of numeric variables. |
set2 |
variable list | yes | The second set of numeric variables. |
Regression and modeling
linear_regression
A linear (OLS) regression of a numeric dependent variable on one or more predictors (coefficients with confidence intervals and standardized betas, collinearity diagnostics, R² and significance). Supports robust standard errors and forward/backward selection.
linear_regression dependent=VarName predictors=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependent |
variable | yes | The numeric dependent variable. |
predictors |
variable list | yes | The numeric predictor variables. |
confidence |
number | no | Confidence level (percent) for the coefficient intervals; defaults to 95. |
robust |
one of none, hc0, hc1, hc3 |
no | Heteroskedasticity-consistent (sandwich) standard errors; defaults to none (model-based). |
method |
one of enter, forward, backward |
no | Predictor entry: enter all (default), or forward/backward stepwise selection by significance. |
intercept |
true / false | no | Whether to fit the constant (intercept) term; defaults to true. false fits regression through the origin (y = b·x, no constant): R² and the ANOVA total sum of squares are then uncentred (about zero, total df n) and no standardized betas are shown. |
casewise |
true / false | no | Add a Casewise Diagnostics table — each case's predicted value, residual, standardized/studentized residual, leverage and Cook's distance. |
diagnostics |
true / false | no | Add the regression diagnostic panel's source tables: "Residuals vs Fitted" (predicted value against raw residual), "Scale-Location" (predicted value against the square root of the absolute standardized residual — the homoscedasticity check) and a Normal Q-Q plot of the standardized residuals with its reference line. |
save_predicted |
true / false | no | ⚠️ saves new variables — Save the per-case predicted values back into the dataset as a new variable. |
save_residuals |
true / false | no | ⚠️ saves new variables — Save the per-case residuals back into the dataset as a new variable. |
logistic_regression
A binary logistic regression of a 0/1 dependent variable on one or more predictors (coefficients and odds ratios with confidence intervals). Supports robust standard errors and forward/backward selection.
logistic_regression dependent=VarName predictors=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependent |
variable | yes | The binary (0/1) dependent variable. |
predictors |
variable list | yes | The numeric predictor variables. |
confidence |
number | no | Confidence level (percent) for the odds-ratio intervals; defaults to 95. |
robust |
one of none, hc0, hc1, hc3 |
no | Robust (sandwich) standard errors guarding the coefficient inference against model mis-specification; defaults to none (model-based). |
method |
one of enter, forward, backward |
no | Predictor entry: enter all (default), or forward/backward stepwise selection by significance. |
link |
one of logit, probit, cloglog |
no | The binary link function: logit (default, odds ratios), probit (normal latent variable) or cloglog (complementary log-log, an asymmetric link). Probit/cloglog report coefficients on the link scale (no odds ratio). |
hosmer_lemeshow |
true / false | no | When true, also report the Hosmer-Lemeshow goodness-of-fit test (observed vs. expected events across deciles of risk). Defaults to false. |
hl_groups |
number | no | The number of groups for the Hosmer-Lemeshow test (deciles of risk); defaults to 10. Ignored unless hosmer_lemeshow is set. |
diagnostics |
true / false | no | Add the GLM diagnostic panel's source tables: randomized quantile residuals against the linear predictor, and a normal Q-Q of the same residuals against the identity line. Quantile residuals rather than deviance ones, because the deviance residuals of a binary outcome form one band per outcome level and defeat the visual check. |
seed |
number | no | PRNG seed for the randomized quantile residuals; defaults to 1. The same seed always reproduces the same plot — vary it to check that a feature is the fit and not the draw. Ignored unless diagnostics is set. |
poisson_regression
A Poisson log-linear regression of a non-negative count dependent on one or more predictors (rate ratios Exp(B) with intervals, deviance/Pearson goodness-of-fit flagging over-dispersion). Supports robust standard errors.
poisson_regression dependent=VarName predictors=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependent |
variable | yes | The non-negative count dependent variable. |
predictors |
variable list | yes | The numeric predictor variables. |
confidence |
number | no | Confidence level (percent) for Exp(B); defaults to 95. |
robust |
one of none, hc0, hc1, hc3 |
no | Robust (sandwich) standard errors, guarding against mis-specified dispersion; defaults to none. |
diagnostics |
true / false | no | Add the GLM diagnostic panel's source tables: randomized quantile residuals against the linear predictor, and a normal Q-Q of the same residuals against the identity line. Quantile residuals rather than deviance ones, which band by count at small fitted means and defeat the visual check. |
seed |
number | no | PRNG seed for the randomized quantile residuals; defaults to 1. The same seed always reproduces the same plot — vary it to check that a feature is the fit and not the draw. Ignored unless diagnostics is set. |
negative_binomial_regression
A negative-binomial (NB2) log-linear regression for over-dispersed counts: like Poisson but with an estimated dispersion parameter, so standard errors are not understated when the variance exceeds the mean.
negative_binomial_regression dependent=VarName predictors=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependent |
variable | yes | The non-negative count dependent variable. |
predictors |
variable list | yes | The numeric predictor variables. |
confidence |
number | no | Confidence level (percent) for Exp(B); defaults to 95. |
diagnostics |
true / false | no | Add the GLM diagnostic panel's source tables: randomized quantile residuals against the linear predictor, and a normal Q-Q of the same residuals against the identity line. The residuals use the NB2 distribution at the fitted dispersion. |
seed |
number | no | PRNG seed for the randomized quantile residuals; defaults to 1. The same seed always reproduces the same plot — vary it to check that a feature is the fit and not the draw. Ignored unless diagnostics is set. |
zero_inflated
A zero-inflated or hurdle count model for counts with excess zeros (no-visit / no-purchase / no-defect cases) that a plain Poisson or negative-binomial fit cannot absorb. Reports a count component (rate ratios Exp(B)) and a zero component (a logit model for the excess / hurdle zeros), a Vuong test against the plain count model, and AIC/BIC. The count and zero components share the same predictors.
zero_inflated dependent=VarName predictors=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependent |
variable | yes | The non-negative integer count dependent variable. |
predictors |
variable list | yes | The numeric predictors, shared by the count and zero components. |
count_family |
one of poisson, negative_binomial |
no | The count distribution of the non-zero component; defaults to poisson (negative_binomial also models over-dispersion). |
model |
one of zero_inflated, hurdle |
no | zero_inflated mixes a structural-zero class with the counts; hurdle fits zero-vs-positive then a zero-truncated count. Defaults to zero_inflated. |
confidence |
number | no | Confidence level (percent) for Exp(B); defaults to 95. |
diagnostics |
true / false | no | Add the GLM diagnostic panel's source tables: randomized quantile residuals against the count component's linear predictor, and a normal Q-Q of the same residuals against the identity line. The residuals use the full mixture distribution, so the inflation (or hurdle) mass is reserved before the count distribution is consulted. |
seed |
number | no | PRNG seed for the randomized quantile residuals; defaults to 1. The same seed always reproduces the same plot — vary it to check that a feature is the fit and not the draw. Ignored unless diagnostics is set. |
regularized_regression
Regularized linear regression — ridge, lasso or elastic net — for prediction with many or collinear predictors and (lasso) automatic variable selection. The elastic-net penalty is fitted by coordinate descent along a path of penalties (λ), with λ chosen by k-fold cross-validation. Reports the coefficients at the selected λ (on the original and standardized scales), the regularization / CV path, and a model summary. Penalized estimates carry no standard errors.
regularized_regression dependent=VarName predictors=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependent |
variable | yes | The continuous numeric dependent variable. |
predictors |
variable list | yes | The numeric predictors (at least two); each is standardized before penalization. |
alpha |
number | no | The elastic-net mix in [0, 1]: 0 is ridge (L2), 1 is lasso (L1), between is elastic net. Defaults to 1 (lasso). |
lambda |
number | no | A fixed penalty λ. Omit to select λ by cross-validation (the default). |
folds |
integer | no | Cross-validation folds; defaults to 10. |
seed |
integer | no | Seed for the (reproducible) cross-validation fold assignment; defaults to 1. |
robust_regression
Robust linear regression by M-estimation (Huber or Tukey bisquare): down-weights outlying residuals in the fit itself, so a few influential points cannot drag the coefficients the way they do in OLS. Reports the robust coefficients with sandwich (H1) standard errors and t-tests, the robust scale, and the most down-weighted cases. Use when a diagnostic plot shows influential outliers.
robust_regression dependent=VarName predictors=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependent |
variable | yes | The continuous numeric dependent variable. |
predictors |
variable list | yes | The numeric predictor variables. |
method |
one of huber, tukey |
no | The influence function: "huber" (clips far residuals; the default) or "tukey" (redescending bisquare, rejecting gross outliers entirely). |
tuning |
number | no | The tuning constant c. Defaults to 1.345 (Huber) or 4.685 (Tukey) — each ~95% efficient under normality. Smaller is more resistant, larger is closer to OLS. |
confidence |
number | no | Confidence level (percent) for the intervals; defaults to 95. |
nonlinear_regression
Nonlinear least-squares regression of a user-specified model — a growth curve, a dose-response, a Michaelis-Menten — fitted by Levenberg-Marquardt over the named parameters. Reference predictors by name in the model; every other name is a parameter to estimate. Reports the parameter estimates with asymptotic (Gauss-Newton) standard errors, t-tests and confidence intervals, and a model summary (residual sum of squares, residual standard error, a 1−SSE/SST pseudo-R², iterations and whether the fit converged).
nonlinear_regression dependent=VarName predictors=[Var1, Var2] model="text" start="text"
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependent |
variable | yes | The continuous numeric dependent variable. |
predictors |
variable list | yes | The numeric predictor variables the model may reference by name. |
model |
text | yes | The model expression, e.g. "b0 + b1exp(b2x)". Operators + - * / ^ and functions (exp, ln, log10, sqrt, sin, cos, abs, pow, …) are supported. A name matching a predictor is that case's value; every other name is a parameter. |
start |
text | yes | Starting values as name=value pairs, e.g. "b0=1, b1=1, b2=0.1". The parameter set (and its order) is taken from these, so every parameter named in the model must appear exactly once. |
confidence |
number | no | Confidence level (percent) for the intervals; defaults to 95. |
iv_regression
Instrumental-variables regression by two-stage least squares (2SLS): consistent estimation when a regressor is endogenous (correlated with the error — from simultaneity, omitted confounders or measurement error). The endogenous regressors are projected onto the instruments and the outcome regressed on the projection. Reports the coefficients with corrected (2SLS) standard errors, t-tests and confidence intervals, a model summary, and the first-stage weak-instrument F for each endogenous regressor (rule of thumb F < 10 is weak). Needs at least as many excluded instruments as endogenous regressors.
iv_regression dependent=VarName endogenous=[Var1, Var2] instruments=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependent |
variable | yes | The continuous numeric dependent variable. |
endogenous |
variable list | yes | The endogenous regressor(s) — the variables being instrumented (suspected correlated with the error). |
instruments |
variable list | yes | The excluded instruments: numeric variables that move the endogenous regressors but are otherwise unrelated to the outcome. Need at least as many as there are endogenous regressors. |
exogenous |
variable list | no | Included exogenous regressors — predictors treated as their own instruments (they enter both the structural equation and the instrument set). |
confidence |
number | no | Confidence level (percent) for the intervals; defaults to 95. |
gamma_regression
A gamma generalized-linear model for a strictly positive, right-skewed continuous dependent (costs, durations, concentrations) with variance proportional to the mean squared. The log link (default) gives a multiplicative model (Exp(B)); the inverse link is also available. Reports an estimated dispersion, deviance and Pearson goodness-of-fit.
gamma_regression dependent=VarName predictors=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependent |
variable | yes | The strictly positive continuous dependent variable. |
predictors |
variable list | yes | The numeric predictor variables. |
confidence |
number | no | Confidence level (percent) for the intervals; defaults to 95. |
link |
one of log, inverse |
no | The link function: log (default, multiplicative on the mean, Exp(B)) or the canonical inverse link. |
diagnostics |
true / false | no | Add the GLM diagnostic panel's source tables: quantile residuals against the linear predictor, and a normal Q-Q of the same residuals against the identity line. The gamma outcome is continuous, so these residuals are exact — no randomization, and no seed. |
quantile_regression
A quantile regression of a numeric dependent variable on numeric predictors: instead of the mean (OLS), it models a chosen conditional quantile (the median by default) by minimizing the asymmetric check loss. Reports the coefficients with asymptotic standard errors and a pseudo-R¹ goodness of fit. Robust to outliers and to heteroscedastic effects that differ across the response distribution.
quantile_regression dependent=VarName predictors=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependent |
variable | yes | The numeric dependent variable. |
predictors |
variable list | yes | The numeric predictor variables. |
tau |
number | no | The conditional quantile to model, between 0 and 1 (default 0.5, the median). |
gee
A generalized estimating equations (GEE) population-averaged model for correlated / clustered data: it fits a GLM (Gaussian, binomial or Poisson) while accounting for within-subject correlation through a working correlation structure, and reports the coefficients with robust (sandwich) standard errors and the estimated correlation parameter.
gee dependent=VarName predictors=[Var1, Var2] subject=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependent |
variable | yes | The numeric dependent variable. |
predictors |
variable list | yes | The numeric predictor variables. |
subject |
variable | yes | The subject / cluster variable that groups correlated observations (repeated measures share a subject). |
family |
one of gaussian, binomial, poisson |
no | The response family and its canonical link: gaussian/identity (default), binomial/logit or poisson/log. |
correlation |
one of exchangeable, independence, ar1 |
no | The within-subject working correlation: exchangeable (default), independence or ar1 (first-order autoregressive). |
panel_regression
Panel-data regression for repeated observations of the same entities (firms, people, countries): fixed effects (the within transformation), random effects (Swamy–Arora GLS) or pooled OLS, reporting within/between/overall R², a side-by-side estimator comparison, the Hausman test of fixed vs random effects, and optionally cluster-robust (by entity) standard errors.
panel_regression dependent=VarName regressors=[Var1, Var2] entity=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependent |
variable | yes | The numeric dependent variable. |
regressors |
variable list | yes | The numeric regressor variables. |
entity |
variable | yes | The entity (panel) identifier that groups repeated observations of the same unit — the firm, person or country variable. |
time |
variable | no | The optional time-period identifier. When given, a duplicate entity–time pair is rejected as a data error and the period count is reported. |
estimator |
one of fixed, random, pooled |
no | The estimator: fixed effects / within (default), random effects (Swamy–Arora GLS) or pooled OLS. The Hausman test comparing fixed and random effects is reported whenever both can be fitted. |
se |
one of conventional, clustered |
no | Standard errors for the coefficient table: conventional (default) or cluster-robust by entity. |
confidence |
number | no | The confidence level for the interval, as a percent (default 95). |
loglinear
A loglinear (Poisson-GLM) model of the cell counts of a multi-way contingency table formed from two or more categorical variables: the parameter estimates and a deviance / Pearson goodness-of-fit test. The main-effects (independence) model tests whether the factors are independent; the saturated model fits the table perfectly.
loglinear factors=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
factors |
variable list | yes | The categorical variables whose cross-classification forms the contingency table (two or more). |
model |
one of independence, saturated |
no | Which model to fit: independence / main effects (default — tests independence of the factors) or saturated (all interactions). |
multinomial_regression
A multinomial logistic regression of a categorical dependent (3+ unordered categories) on one or more predictors: baseline-category logits versus the lowest category, with relative-risk ratios.
multinomial_regression dependent=VarName predictors=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependent |
variable | yes | The categorical dependent variable (its distinct values are the categories; the lowest is the reference). |
predictors |
variable list | yes | The numeric predictor variables. |
confidence |
number | no | Confidence level (percent) for Exp(B); defaults to 95. |
ordinal_regression
An ordinal (proportional-odds) logistic regression of an ordered categorical dependent on one or more predictors: ordered thresholds and one slope per predictor, with odds ratios.
ordinal_regression dependent=VarName predictors=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependent |
variable | yes | The ordered categorical dependent variable (its distinct values, ascending, are the ordered categories). |
predictors |
variable list | yes | The numeric predictor variables. |
confidence |
number | no | Confidence level (percent) for Exp(B); defaults to 95. |
glm
A factorial general linear model (between-subjects ANOVA/ANCOVA) of a numeric dependent on one or more categorical factors and all their interactions, with optional continuous covariates, Type III sums of squares and F tests.
glm dependent=VarName factors=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependent |
variable | yes | The numeric dependent variable. |
factors |
variable list | yes | The categorical factor variables (each distinct value is a level); all main effects and interactions are tested. |
covariates |
variable list | no | Optional continuous covariates (ANCOVA): numeric predictors entered with one slope (1 df) each. |
posthoc |
true / false | no | Add Bonferroni / Scheffé / Tukey post-hoc comparisons of the first factor's level means, using the model error term. |
contrast |
number list | no | A-priori contrast coefficients (one per level of the first factor, summing to zero) tested against the model error term. |
mixed_model
A two-level linear mixed model: a numeric dependent on optional predictors with a random intercept (and optional random slopes) for a grouping variable (fixed effects, variance components, the intraclass correlation). Supports ML or REML estimation.
mixed_model dependent=VarName group=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependent |
variable | yes | The numeric dependent variable. |
group |
variable | yes | The grouping variable that gets the random intercept. |
predictors |
variable list | no | Optional numeric fixed-effect predictors; omit for a pure variance-components (random-intercept-only) model. |
random_slopes |
variable list | no | Predictors (a subset of predictors) whose slope also varies randomly by group. |
unstructured |
true / false | no | Estimate covariances between the random effects (unstructured G) rather than independent variance components. |
reml |
true / false | no | Use restricted maximum likelihood (less biased variance components) instead of ML. |
confidence |
number | no | Confidence level (percent) for the fixed effects; defaults to 95. |
glmm
A generalized linear mixed model: a random-intercept logistic (0/1) or Poisson (count) regression for clustered or repeated data (patients within clinics, repeated yes/no measures). Reports the fixed effects with Exp(B), the random-intercept variance and AIC/BIC, by adaptive Gauss-Hermite quadrature.
glmm dependent=VarName predictors=[Var1, Var2] group=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependent |
variable | yes | The outcome: 0/1 for the binomial family, a non-negative count for the poisson family. |
predictors |
variable list | yes | The numeric fixed-effect predictors. |
group |
variable | yes | The grouping variable that gets the random intercept. |
family |
one of binomial, poisson |
no | The outcome family: binomial (logit, default) or poisson (log). |
confidence |
number | no | Confidence level (percent) for the fixed effects; defaults to 95. |
repeated_measures_anova
A one-way repeated-measures ANOVA over several numeric measures of the same subjects (the within-subjects effect, with Mauchly's sphericity test and the Greenhouse-Geisser / Huynh-Feldt corrections).
repeated_measures_anova measures=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
measures |
variable list | yes | The repeated measures (one column per condition/time), in order; each row is a subject. |
manova
A one-way multivariate analysis of variance (MANOVA): several numeric dependent variables tested jointly across a grouping factor, with Pillai's trace, Wilks' lambda, the Hotelling-Lawley trace and Roy's largest root.
manova dependents=[Var1, Var2] factor=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependents |
variable list | yes | The numeric dependent variables (at least two). |
factor |
variable | yes | The grouping factor (each distinct value is a group). |
mediation
Mediation analysis: decomposes the effect of an independent variable X on an outcome Y into a direct effect and the indirect effect(s) that pass through one or more parallel mediators M. Fits the mediator model(s) M ~ X (+ covariates) for the a path, the outcome model Y ~ X + M (+ covariates) for the b paths and the direct effect c′, and the total model Y ~ X (+ covariates) for the total effect c, all by OLS. The indirect effect through each mediator is the product a·b; its confidence interval comes from a nonparametric case-resampling bootstrap (percentile or BCa), reproducible for a fixed seed. An indirect interval that excludes zero is evidence of mediation. With a moderator W the model becomes moderated mediation (PROCESS models 7 / 14 / 58): W and its product term enter the moderated path(s), and the result reports conditional indirect effects at probe values of W (each level of a categorical moderator, else mean ± 1 SD), the index of moderated mediation with a bootstrap CI (when exactly one path is moderated), conditional simple-slope effects, and an interaction plot of the simple slopes; johnson_neyman adds the regions of significance of each moderated path with a plot; a second moderator (moderator2) makes the interaction three-way; serial chains two mediators (X → M1 → M2 → Y) with the serial indirect effect. Continuous outcome. Unweighted like the bootstrap (Select Cases and Split File are honored).
mediation dependent=VarName independent=VarName mediators=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
dependent |
variable | yes | The continuous numeric outcome variable Y. |
independent |
variable | yes | The independent variable X whose effect on Y is decomposed into direct and indirect parts. |
mediators |
variable list | yes | One or more parallel mediators M: numeric variables on the path X → M → Y. Each gets its own indirect effect; with more than one a total indirect effect is also reported. |
covariates |
variable list | no | Optional numeric covariates entered into every model (the mediator, outcome and total models). |
serial |
true / false | no | Serial mediation: exactly two mediators in causal order, the first affecting the second (X → M1 → M2 → Y; PROCESS model 6). Adds the M1 → M2 path (d21) and the serial indirect effect a1·d21·b2 beside the two specific ones, all bootstrapped. Combinable with one moderator (W enters both a-paths, both b-paths or both; d21 is not moderated), not with moderator2. Default false. |
moderator |
variable | no | An optional numeric moderator W, turning the analysis into moderated mediation: does the indirect effect differ by W? Which path W moderates is chosen by "moderation". |
moderator2 |
variable | no | With "moderator": a second numeric moderator Z for a three-way interaction — it joins W in the moderated model(s) with every product up to X×W×Z (or M×W×Z). Conditional effects and indirect effects are probed on the W × Z grid, the index of moderated moderated mediation (a7·b or a·b7) and the conditional index of moderated mediation at each Z probe are bootstrapped, and the interaction plot (and Johnson–Neyman regions, if asked) are drawn per Z probe. |
moderation |
one of a, b, both |
no | Which path the moderator enters (only meaningful with "moderator"): a (default) moderates X → M (PROCESS model 7), b moderates M → Y (model 14), both moderates both (model 58 — no single index of moderated mediation exists there). |
plot |
true / false | no | Whether to draw the interaction plot of the moderated path's simple slopes (and the Johnson–Neyman plot when requested) (default true; only meaningful with "moderator"). |
johnson_neyman |
true / false | no | With "moderator": report the Johnson–Neyman regions of significance for each moderated path — the moderator values at which the conditional effect of the path turns significant at the interval's level, with the percent of cases on each side — and plot the conditional effect with its confidence band across the observed moderator range. Default false. |
ci_method |
one of percentile, bca |
no | The bootstrap interval method for the indirect effect(s): percentile (default) or bca (bias-corrected and accelerated). |
replicates |
integer | no | How many bootstrap resamples to draw for the indirect-effect interval (default 5000). |
confidence |
number | no | Confidence level (percent) for all intervals; defaults to 95. |
seed |
integer | no | The PRNG seed (default 1), making the bootstrap reproducible. |
Scale, reduction and classification
reliability
A reliability analysis (Cronbach's alpha) of a set of numeric items measured on the same scale: the alpha coefficient, item statistics and item-total statistics (corrected item-total correlation and the alpha if each item were deleted), so you can see how internally consistent the items are and which weaken the scale.
reliability items=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
items |
variable list | yes | The numeric items (two or more) that make up the scale; analyzed on the cases complete on every item. |
intraclass_correlation
An intraclass correlation analysis of a set of numeric rater columns (one column per rater, one row per subject): the six Shrout & Fleiss forms (single and average measures, for the one-way random, two-way random absolute-agreement and two-way mixed consistency models), each with its F test and confidence interval. Measures the reliability / agreement of ratings.
intraclass_correlation raters=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
raters |
variable list | yes | The numeric rater columns (two or more); analyzed on the subjects complete on every rater. |
confidence |
number | no | The confidence level for the interval, as a percent (default 95). |
bland_altman
A Bland-Altman method-comparison (agreement) analysis of two numeric measurement columns: the bias (mean difference), the standard deviation of the differences and the limits of agreement (bias ± 1.96 × SD), each with a t-based confidence interval; a proportional-bias regression of the differences on the pair means; and the mean-vs-difference plot with the bias and limit lines. Differences are method1 − method2, over the cases complete on both.
bland_altman method1=VarName method2=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
method1 |
variable | yes | The first method's numeric measurement column (differences are method1 − method2). |
method2 |
variable | yes | The second method's numeric measurement column. |
confidence |
number | no | The confidence level for the intervals, as a percent (default 95). Moves only the intervals; the limits of agreement stay at bias ± 1.96 × SD. |
plot |
true / false | no | Draw the mean-vs-difference plot with the bias line and dashed limits of agreement. Defaults to true. |
colors |
text list | no | Optional color override as a one-entry hex list (e.g. ["#1f77b4"]): the first entry recolors the points; an invalid entry keeps the theme accent. |
title |
text | no | A title for the chart, replacing the one the analysis generates. Under Split File the group qualifier (" [region = North]") is kept, so the groups stay told apart. |
x_title |
text | no | A label for the x axis, replacing the one derived from the variable. Blank keeps the derived label. |
y_title |
text | no | A label for the y axis, replacing the one derived from the variable. Blank keeps the derived label. |
x_min |
number | no | Lower limit of the x axis. Omitted, the axis fits the data; set alone, only that end is pinned. |
x_max |
number | no | Upper limit of the x axis. Must exceed x_min when both are given. |
y_min |
number | no | Lower limit of the y axis — y_min: 0 is the common case, anchoring the axis at zero and leaving the top to the data. |
y_max |
number | no | Upper limit of the y axis. Must exceed y_min when both are given. |
h_lines |
number list | no | Horizontal reference lines at these y values — a mean, a threshold, a target. Drawn dashed behind the data; a value outside the axis range is not drawn. |
v_lines |
number list | no | Vertical reference lines at these x values. Drawn dashed behind the data; a value outside the axis range is not drawn. |
gridlines |
true / false | no | Draw the plot gridlines (default true). False suits a figure that will be printed small, where the grid reads as ink noise rather than as a reading aid. |
figure_height |
number | no | Plot height in pixels (120-2000). Omitted, the built-in height is kept. The width is the output column's and is not set here. |
font_scale |
number | no | Multiplier on every text size in the chart (0.5-3): tick labels, axis titles, legend, annotations. Omitted, the built-in sizes are kept. |
irt
An item response theory (IRT) analysis of binary items: Rasch or two-parameter logistic (2PL) item parameters — discrimination and difficulty with standard errors — estimated by marginal maximum likelihood (Bock-Aitkin EM, latent trait N(0,1)), with the model fit block and item/test information curves showing where on the trait the test measures well.
irt items=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
items |
variable list | yes | The binary item variables (two or more; each with exactly two observed values — the higher one is the keyed/correct response). Cases incomplete on any item are dropped. |
model |
one of 2pl, rasch |
no | The measurement model: "2pl" (default; per-item discrimination) or "rasch" (one shared discrimination). |
plot |
true / false | no | Draw the item and test information curves (and include their tables). Defaults to true. |
legend |
one of auto, right, bottom, none |
no | Where the item-curve legend is drawn: "auto" (top-right, inside the plot, default), "right", "bottom", or "none" to hide it. |
colors |
text list | no | Optional per-item color overrides as hex strings (e.g. "#1f77b4"), in item order; an entry beyond the list, or an invalid one, keeps the validated default palette. |
line_width |
number | no | Stroke width for the curves (default 1.8). |
title |
text | no | A title for the charts, replacing the ones the analysis generates. Under Split File the group qualifier (" [region = North]") is kept, so the groups stay told apart. |
x_title |
text | no | A label for the x axis, replacing the one derived from the variable. Blank keeps the derived label. |
y_title |
text | no | A label for the y axis, replacing the one derived from the variable. Blank keeps the derived label. |
x_min |
number | no | Lower limit of the x axis. Omitted, the axis fits the data; set alone, only that end is pinned. |
x_max |
number | no | Upper limit of the x axis. Must exceed x_min when both are given. |
y_min |
number | no | Lower limit of the y axis — y_min: 0 is the common case, anchoring the axis at zero and leaving the top to the data. |
y_max |
number | no | Upper limit of the y axis. Must exceed y_min when both are given. |
h_lines |
number list | no | Horizontal reference lines at these y values — a mean, a threshold, a target. Drawn dashed behind the data; a value outside the axis range is not drawn. |
v_lines |
number list | no | Vertical reference lines at these x values. Drawn dashed behind the data; a value outside the axis range is not drawn. |
marker_shape |
one of circle, square, triangle, diamond, cross |
no | The shape drawn at each data point. The five stay apart at 3 px on a greyscale page, which is what a printed figure needs. |
marker_size |
number | no | Marker radius in pixels (0 < size <= 24). Omitted, the built-in 2.5 is kept. |
gridlines |
true / false | no | Draw the plot gridlines (default true). False suits a figure that will be printed small, where the grid reads as ink noise rather than as a reading aid. |
figure_height |
number | no | Plot height in pixels (120-2000). Omitted, the built-in height is kept. The width is the output column's and is not set here. |
font_scale |
number | no | Multiplier on every text size in the chart (0.5-3): tick labels, axis titles, legend, annotations. Omitted, the built-in sizes are kept. |
factor_analysis
A factor analysis / principal component analysis that reduces several correlated numeric variables to a few underlying components: communalities, the variance each component explains, and the loading of every variable on each component (optionally Varimax-rotated for a cleaner structure).
factor_analysis variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric variables to reduce (analyzed on the cases complete on every variable). |
factors |
integer | no | How many components to retain. Omit to keep every component with an eigenvalue greater than 1 (Kaiser's rule). |
method |
one of pca, paf, ml |
no | Extraction method: "pca" (principal components, the default), "paf" (principal-axis factoring) or "ml" (maximum likelihood). |
rotation |
one of none, varimax, promax |
no | Rotation of the retained factors: "none" (the default), "varimax" (orthogonal) or "promax" (oblique — gives pattern, structure and factor-correlation matrices). |
save_scores |
true / false | no | ⚠️ saves new variables — Save each retained component's scores (regression method) back into the dataset as new variables. |
cfa
Confirmatory factor analysis (v1): tests a hypothesized measurement structure — which observed indicators load on which named latent factors — by maximum likelihood, unlike exploratory factor_analysis which finds a structure. Reports the model chi-square with the conventional fit indices (CFI, TLI, RMSEA with its 90% CI, SRMR), unstandardized and completely standardized loadings with expected-information standard errors, factor correlations, and factor and residual variances. Each factor's first indicator sets its scale (loading fixed at 1). Identification problems, non-convergence and Heywood cases are reported clearly, never as silent numbers. Optionally reports modification indices (the expected chi-square drop from freeing each fixed cross-loading or residual covariance, with the expected parameter change). With a grouping variable it becomes a multi-group CFA with a mean structure and tests measurement invariance: the configural, metric (equal loadings), scalar (equal intercepts, latent means free after the first group) and strict (equal residual variances) models up to the requested level, with the model-to-model chi-square, CFI and RMSEA differences, then every parameter per group. For ordinal (Likert) indicators the WLSMV estimator fits polychoric correlations by diagonally weighted least squares with the mean-and-variance-adjusted test, robust standard errors and thresholds. The covariance is weighted under Weight Cases; Select Cases and Split File are honored.
cfa model="text"
| Argument | Accepts | Required | Notes |
|---|---|---|---|
model |
text | yes | The measurement model, one factor per clause: "Verbal: v1 v2 v3; Speed: v4 v5 v6" — a factor name, a colon, then its indicator variables separated by spaces, factors separated by semicolons. Every factor needs at least two indicators (three when there is only one factor), and an indicator may belong to only one factor. |
orthogonal |
true / false | no | Force uncorrelated factors (default false: factors covary freely). |
modification_indices |
true / false | no | Add a Modification Indices table: for every fixed parameter (each cross-loading, each residual covariance and, under orthogonal, each factor covariance) the expected chi-square drop from freeing it alone (a 1-df score test), with the expected parameter change (EPC) and its completely standardized form. Default false. Data-driven: free a parameter only with a substantive reason. |
mi_minimum |
number | no | With modification_indices: list only indices at or above this value. Defaults to 3.84 (chi-square with 1 df at the 5% level); 0 lists every candidate. |
estimator |
one of ml, wlsmv |
no | "ml" (the default): maximum likelihood for continuous indicators. "wlsmv": for ordinal indicators (integer-coded, each distinct value an ordered category, at most 12) — thresholds, polychoric correlations, diagonally weighted least squares with the scaled-shifted chi-square (lavaan/Mplus WLSMV), robust standard errors, a thresholds table and the polychoric matrix. Not combinable with group or modification_indices. |
group |
variable | no | A grouping variable (categorical; each distinct value is a group, in ascending order — the first group is the reference for latent means). Makes this a multi-group CFA with measurement-invariance tests. Every group needs more complete cases than indicators; not combinable with modification_indices or the wlsmv estimator. |
invariance |
one of configural, metric, scalar, strict |
no | With group: the highest invariance level to fit and report. The models are nested — configural (same pattern, all free), metric (+ equal loadings), scalar (+ equal intercepts; latent means free in groups after the first) and strict (+ equal residual variances) — and every level up to this one is fitted and compared in the Invariance Tests table; the parameter tables show this level. Default scalar. |
kmeans_cluster
A k-means cluster analysis that partitions the cases into a fixed number of groups by their numeric variables: the final cluster centers, the number of cases per cluster, and a descriptive ANOVA of how each variable differs across clusters.
kmeans_cluster variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric variables that define the clustering space (cases complete on every variable are clustered by squared Euclidean distance). |
clusters |
integer | no | How many clusters to form (at least 2); defaults to 2. |
seed |
integer | no | A random seed for the initial cluster centers, making a random restart reproducible. Omit for the deterministic (maximin) initialization, which is reproducible without a seed. |
save_clusters |
true / false | no | ⚠️ saves new variables — Save each case's cluster membership back into the dataset as a new variable. |
save_distances |
true / false | no | ⚠️ saves new variables — Save each case's Euclidean distance from its assigned cluster center back into the dataset as a new variable. |
hierarchical_cluster
An agglomerative hierarchical cluster analysis that repeatedly merges the closest cases/clusters: an agglomeration schedule and, when a cluster count is given, each case's cluster membership. Suited to small datasets (capped at 200 cases by default; raise "max_cases" to lift it).
hierarchical_cluster variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric variables that define the clustering space (cases complete on every variable). |
linkage |
one of single, complete, average, ward |
no | How cluster distance is measured: "single" (nearest neighbour), "complete" (furthest), "average" (between-groups, the default) or "ward" (minimum-variance, on squared Euclidean distance). |
clusters |
integer | no | If given, cuts the tree into this many clusters and reports each case's membership. |
max_cases |
integer | no | The largest number of cases the analysis will cluster (default 200). Cost grows steeply with case count (cubic time, quadratic memory), so large runs can be slow and memory-heavy; set to 0 to remove the limit. |
save_clusters |
true / false | no | ⚠️ saves new variables — Save each case's cluster membership (at the requested cut) back into the dataset as a new variable. Requires a cluster count. |
twostep_cluster
A two-step cluster analysis that automatically chooses the number of clusters by Schwarz's BIC (or uses a fixed count): the BIC for each candidate count, the final cluster centers and the number of cases per cluster. Suited to finding a natural grouping when the cluster count is unknown.
twostep_cluster variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric variables that define the clustering space (cases complete on every variable, clustered by Euclidean distance). |
clusters |
integer | no | Fix the number of clusters instead of choosing it automatically. Omit to let the BIC pick the count. |
max_clusters |
integer | no | The largest cluster count the automatic search considers (default 15). |
max_subclusters |
integer | no | The largest number of BIRCH CF-tree pre-clusters the cases are compressed into before clustering (default 1000). Lower it to pre-summarize a very large dataset more aggressively. |
save_clusters |
true / false | no | ⚠️ saves new variables — Save each case's cluster membership back into the dataset as a new variable. |
discriminant_analysis
A linear discriminant analysis that finds the combinations of numeric predictors best separating known groups: the canonical functions (eigenvalues and canonical correlations), the Wilks' lambda test of group separation, and Fisher's classification function coefficients.
discriminant_analysis group=VarName predictors=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
group |
variable | yes | The grouping variable (its distinct values are the groups to discriminate between). |
predictors |
variable list | yes | The numeric predictor variables that distinguish the groups. |
method |
one of enter, forward, backward |
no | Predictor entry: enter all (default), or forward/backward stepwise selection by Wilks' lambda. |
classify |
true / false | no | Add a Classification Results table (the original / resubstitution confusion matrix and the percent correctly classified). |
cross_validate |
true / false | no | Add a leave-one-out cross-validated confusion matrix to the Classification Results (capped at 500 cases by default; raise "cv_max_cases" to lift it). |
cv_max_cases |
integer | no | The case limit for leave-one-out cross-validation (default 500). It refits the model once per case, so cost grows with the square of the case count; set to 0 to remove the limit. |
plot |
true / false | no | Add a Discriminant Scores table of each case's canonical function scores (the geometry behind the combined-groups plot). |
plot_max_cases |
integer | no | The largest number of cases listed in the Discriminant Scores table (default 2000); set to 0 to list every case. |
legend |
one of auto, right, bottom, none |
no | Where the plot's group legend is drawn: "auto" (top-right, inside the plot, default), "right", "bottom", or "none" to hide it. Ignored unless plot is set. |
colors |
text list | no | Optional per-group color overrides as hex strings (e.g. "#1f77b4"), in group order; a group beyond the list, or an invalid entry, keeps the validated default palette. Ignored unless plot is set. |
save_predicted_group |
true / false | no | ⚠️ saves new variables — Save each case's predicted group (from Fisher's classification functions) back into the dataset as a new variable. |
title |
text | no | A title for the chart, replacing the one the analysis generates. Under Split File the group qualifier (" [region = North]") is kept, so the groups stay told apart. |
x_title |
text | no | A label for the x axis, replacing the one derived from the variable. Blank keeps the derived label. |
y_title |
text | no | A label for the y axis, replacing the one derived from the variable. Blank keeps the derived label. |
x_min |
number | no | Lower limit of the x axis. Omitted, the axis fits the data; set alone, only that end is pinned. |
x_max |
number | no | Upper limit of the x axis. Must exceed x_min when both are given. |
y_min |
number | no | Lower limit of the y axis — y_min: 0 is the common case, anchoring the axis at zero and leaving the top to the data. |
y_max |
number | no | Upper limit of the y axis. Must exceed y_min when both are given. |
h_lines |
number list | no | Horizontal reference lines at these y values — a mean, a threshold, a target. Drawn dashed behind the data; a value outside the axis range is not drawn. |
v_lines |
number list | no | Vertical reference lines at these x values. Drawn dashed behind the data; a value outside the axis range is not drawn. |
gridlines |
true / false | no | Draw the plot gridlines (default true). False suits a figure that will be printed small, where the grid reads as ink noise rather than as a reading aid. |
figure_height |
number | no | Plot height in pixels (120-2000). Omitted, the built-in height is kept. The width is the output column's and is not set here. |
font_scale |
number | no | Multiplier on every text size in the chart (0.5-3): tick labels, axis titles, legend, annotations. Omitted, the built-in sizes are kept. |
decision_tree
A decision / classification tree: a recursive partition of the predictor space into interpretable if-then rules for a categorical target (a classification tree) or a continuous target (a regression tree). CART splits maximize the impurity decrease (Gini / entropy / variance); CHAID splits by a χ²/F significance test. Reports the tree structure, variable importances and a classification (or fit) table.
decision_tree target=VarName predictors=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
target |
variable | yes | The target to predict: a categorical variable (string, or a numeric with few levels) gives a classification tree; a continuous numeric target gives a regression tree. |
predictors |
variable list | yes | The numeric predictor variables to split on. |
method |
one of cart, chaid |
no | The growing method: "cart" (impurity-decrease binary splits; the default) or "chaid" (χ²/F-significance splits). |
criterion |
one of gini, entropy |
no | The classification impurity measure (CART): "gini" (the default) or "entropy". Ignored for a regression tree (which uses variance). |
target_type |
one of auto, categorical, continuous |
no | Force the target handling: "auto" (the default — categorical unless the target is numeric with many distinct values), "categorical" or "continuous". |
max_depth |
integer | no | Maximum tree depth (stopping rule); defaults to 4. |
min_samples_split |
integer | no | Minimum node size (weighted) to consider splitting; defaults to 2. |
min_samples_leaf |
integer | no | Minimum size (weighted) of each child leaf; defaults to 1. |
latent_class
A latent class analysis of two or more categorical indicators: an EM-estimated mixture model finding unobserved subgroups (classes), with class sizes, class-conditional item-response probabilities, a fit block (log-likelihood, AIC/BIC/aBIC, entropy, G², chi-square), average-posterior classification diagnostics, and an optional class-enumeration comparison table. Multiple seeded random starts; classes are reported in descending-size order.
latent_class indicators=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
indicators |
variable list | yes | The categorical indicator variables (two or more; numeric or string, each with 2-15 distinct values). Cases incomplete on any indicator are dropped. |
classes |
integer | no | The number of latent classes to fit (default 2). |
compare_max |
integer | no | Also fit every class count from 1 up to this number (with the same settings) and prepend a class-enumeration table comparing their fit; must be at least classes. |
starts |
integer | no | The number of seeded random starts (default 20); the best-likelihood solution is kept. |
max_iterations |
integer | no | The EM iteration cap per start (default 1000). |
seed |
integer | no | A random seed for the starts. Omit for the fixed built-in seed, which makes repeated runs reproducible without one. |
save_class |
true / false | no | ⚠️ saves new variables — Save each case's modal (highest-posterior) class back into the dataset as a new variable. |
save_posteriors |
true / false | no | ⚠️ saves new variables — Save each case's posterior class probabilities back into the dataset (one new variable per class). |
roc_curve
A receiver-operating-characteristic (ROC) analysis of a continuous test score against a binary state variable: the area under the curve (AUC) with its standard error, confidence interval and test against chance (0.5), the curve coordinates (sensitivity vs 1 − specificity at each cut-point), and the cut-point maximizing Youden's J. Pairs with binary logistic regression — fit it, save the predicted probabilities, then run ROC on that column.
roc_curve score=VarName state=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
score |
variable | yes | The numeric test variable: a continuous score or fitted probability to evaluate as a classifier. |
state |
variable | yes | The numeric state variable that codes the true class (see positive); every value other than the positive value is negative. |
positive |
number | no | The state value marking a positive (condition-present) case (default 1). |
direction |
one of larger, smaller |
no | Whether a larger test value (default) or a smaller one indicates a positive case. |
propensity_score
Propensity-score matching / weighting (v1) for observational data where treatment was not randomized. Fits a logistic model of the binary treatment on the covariates (the fitted probability is the propensity score), then either matches each treated case to its nearest control(s) — greedy 1:k without replacement on the logit of the score, optional caliper, estimand ATT — or computes inverse-probability-of-treatment (IPTW) weights (estimand ATE or ATT). Reports the score model, a match/weight summary, and covariate balance as standardized mean differences before and after (|SMD| ≤ 0.1 is the common benchmark). The result is written back as columns: matching saves a 1/0 filter variable (propensity_matched) for Select Cases, weighting a weight variable (propensity_weight) for Weight Cases, so any downstream analysis can run on the matched or weighted sample. Computed unweighted by design (a pre-existing Weight Cases variable only selects cases); Select Cases is honored; Split File cannot be combined with the saved columns. No optimal/genetic/full matching and no doubly-robust estimators in v1.
propensity_score treatment=VarName covariates=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
treatment |
variable | yes | The binary treatment variable, coded 0/1 with 1 = treated. |
covariates |
variable list | yes | The numeric covariates of the score model: the pre-treatment characteristics that may drive both treatment and outcome. |
method |
one of match, weight |
no | What to do with the score: "match" (default) pairs treated cases with controls; "weight" computes IPTW weights. |
ratio |
integer | no | Controls matched per treated case (default 1). Match only. |
caliper |
number | no | The widest acceptable match distance, as a multiple of the standard deviation of the logit of the score (0.2 is the common recommendation). A treated case with no control inside the caliper is left unmatched and reported. Match only; no caliper when omitted. |
estimand |
one of ate, att |
no | The population the IPTW weights stand in for: "ate" (default; w = 1/e treated, 1/(1−e) control) or "att" (w = 1 treated, e/(1−e) control). Weight only. |
save_score |
true / false | no | ⚠️ saves new variables — Also save the fitted propensity score as a propensity_score variable (default false). |
save_filter |
true / false | no | ⚠️ saves new variables (on by default) — Save the 1/0 matched-sample flag as a propensity_matched variable for Select Cases (default true). Match only. |
save_weight |
true / false | no | ⚠️ saves new variables (on by default) — Save the IPTW weight as a propensity_weight variable for Weight Cases (default true). Weight only. |
plot |
true / false | no | Include the balance plot — each covariate's standardized mean difference before and after adjustment (default true; pass false to omit it). |
correspondence_analysis
A correspondence analysis of the two-way contingency table of two categorical variables: the principal inertias (singular values) of each dimension with their share of the total inertia (= χ²/N), and the row and column principal coordinates for plotting the categories in a low-dimensional map.
correspondence_analysis row=VarName column=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
row |
variable | yes | The categorical variable whose categories are the rows. |
column |
variable | yes | The categorical variable whose categories are the columns. |
dimensions |
integer | no | How many dimensions of coordinates to report (default 2). |
multidimensional_scaling
A classical (metric) multidimensional scaling of the cases from the Euclidean distances between them over a set of numeric variables: the eigenvalue and share of variance of each recovered dimension, and the case coordinates in that low-dimensional space.
multidimensional_scaling variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric variables that define each case as a point (cases complete on every variable are embedded). |
dimensions |
integer | no | How many dimensions to embed the cases in (default 2). |
max_cases |
integer | no | Cap on the number of cases embedded (default 200; the distance matrix is O(n²)). Set to 0 to remove the cap. |
Survival analysis
kaplan_meier
A Kaplan-Meier (product-limit) estimate of a survival curve from a time-to-event variable that may be right-censored: the survival table (survival probability and Greenwood standard error at each time), the case summary with restricted-mean and median survival, and — when a grouping factor is given — a log-rank (Mantel-Cox) test comparing the groups.
kaplan_meier time=VarName status=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
time |
variable | yes | The numeric time-to-event (duration) variable. |
status |
variable | yes | The numeric status variable that marks whether the event occurred (see event_value) or the case was right-censored. |
event_value |
number | no | The status value indicating the event was observed (default 1); every other value is treated as right-censored. |
factor |
variable | no | An optional grouping variable; its levels get separate survival curves and a log-rank comparison. |
save_survival |
true / false | no | ⚠️ saves new variables — Save each case's estimated survival probability at its event/censoring time back into the dataset as a new variable. |
plot |
true / false | no | Draw the survival curve (one descending step function per group). Defaults to false. |
hazard |
true / false | no | Draw the cumulative hazard H(t) = -ln S(t) — the same estimate read as an ascending curve. Can be combined with plot to get both. Defaults to false. |
markers |
true / false | no | Draw a point marker at each step of the curve (default false). Ignored unless plot or hazard is set. |
legend |
one of auto, right, bottom, none |
no | Where the plot's legend is drawn when there is more than one series: "auto" (top-right, inside the plot, default), "right", "bottom", or "none" to hide it. |
colors |
text list | no | Optional per-series color overrides as hex strings (e.g. "#1f77b4"), in series order; a series beyond the list, or an invalid entry, keeps the validated default palette. |
line_width |
number | no | Stroke width for the curves (default 1.8). |
x_title |
text | no | A label for the x axis, replacing the one derived from the variable. Blank keeps the derived label. |
y_title |
text | no | A label for the y axis, replacing the one derived from the variable. Blank keeps the derived label. |
x_min |
number | no | Lower limit of the x axis. Omitted, the axis fits the data; set alone, only that end is pinned. |
x_max |
number | no | Upper limit of the x axis. Must exceed x_min when both are given. |
y_min |
number | no | Lower limit of the y axis — y_min: 0 is the common case, anchoring the axis at zero and leaving the top to the data. |
y_max |
number | no | Upper limit of the y axis. Must exceed y_min when both are given. |
h_lines |
number list | no | Horizontal reference lines at these y values — a mean, a threshold, a target. Drawn dashed behind the data; a value outside the axis range is not drawn. |
v_lines |
number list | no | Vertical reference lines at these x values. Drawn dashed behind the data; a value outside the axis range is not drawn. |
gridlines |
true / false | no | Draw the plot gridlines (default true). False suits a figure that will be printed small, where the grid reads as ink noise rather than as a reading aid. |
figure_height |
number | no | Plot height in pixels (120-2000). Omitted, the built-in height is kept. The width is the output column's and is not set here. |
font_scale |
number | no | Multiplier on every text size in the chart (0.5-3): tick labels, axis titles, legend, annotations. Omitted, the built-in sizes are kept. |
x_log |
true / false | no | Draw the time axis on a logarithmic (base-10) scale. Refused, naming the value, when any plotted x value is zero or negative; an explicit x_min/x_max must then be positive too. |
cox_regression
A Cox proportional-hazards regression of the event hazard on numeric covariates (right-censored survival data): coefficients with standard errors and Wald tests, the hazard ratios Exp(B) with confidence intervals, and an omnibus likelihood-ratio test of the model. Ties are handled by Breslow's method.
cox_regression time=VarName status=VarName covariates=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
time |
variable | yes | The numeric time-to-event (duration) variable. |
status |
variable | yes | The numeric status variable that marks the event (see event_value) versus right-censoring. |
covariates |
variable list | yes | The numeric covariates (predictors) of the hazard. |
event_value |
number | no | The status value indicating the event was observed (default 1). |
confidence |
number | no | Confidence level (percent) for the Exp(B) intervals (default 95). |
ties |
one of breslow, efron |
no | How tied event times are handled: Breslow (default) or the more accurate Efron approximation. |
strata |
variable | no | An optional stratifying variable: each level gets its own baseline hazard while the covariate coefficients are shared. |
start |
variable | no | An optional numeric entry-time variable for (start, stop] interval data — for time-dependent covariates or delayed entry. Each row is a risk interval; a subject with time-varying covariates spans several. |
baseline |
true / false | no | Report the baseline cumulative hazard and the survival at the mean of the covariates at each event time. |
save_survival |
true / false | no | ⚠️ saves new variables — Save each case's predicted survival probability back into the dataset (simple right-censored data only). |
save_residuals |
true / false | no | ⚠️ saves new variables — Save each case's martingale residual back into the dataset (simple right-censored data only). |
test_ph |
true / false | no | Test the proportional-hazards assumption (Grambsch-Therneau): add a global and per-covariate test from the scaled Schoenfeld residuals, plus a residuals-vs-time table and plot. A small Sig. is evidence the hazard ratio changes over time. |
transform |
one of rank, identity, log |
no | The transform of event time the proportional-hazards test uses: rank (default), identity or log. |
save_schoenfeld |
true / false | no | ⚠️ saves new variables — Save the scaled Schoenfeld residual for each covariate back into the dataset (one column per covariate; event rows only). |
parametric_survival
A parametric accelerated-failure-time (AFT) survival model on right-censored time-to-event data: the exponential, Weibull or log-normal model fitted by maximum likelihood, with the coefficients on the log-time scale (their Exp() is the time ratio / acceleration factor), the scale parameter, and the model log-likelihood and AIC. Covariates are optional (an intercept-only model fits the chosen distribution to the times).
parametric_survival time=VarName status=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
time |
variable | yes | The numeric, strictly positive time-to-event variable. |
status |
variable | yes | The numeric status variable marking the event (see event_value) versus right-censoring. |
distribution |
one of weibull, exponential, lognormal |
no | The survival-time distribution: weibull (default), exponential (constant hazard) or lognormal. |
covariates |
variable list | no | Optional numeric covariates; omit for an intercept-only fit. |
event_value |
number | no | The status value indicating the event was observed (default 1). |
competing_risks
A competing-risks cumulative-incidence analysis: with a status variable that codes several mutually exclusive event types (plus censoring), the cause-specific cumulative incidence function for each cause over time (each increment is the all-cause survival times the cause hazard), and the final cumulative incidence per cause. The CIFs sum to 1 − overall survival.
competing_risks time=VarName status=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
time |
variable | yes | The numeric time-to-event variable. |
status |
variable | yes | The numeric status variable: the censoring code (see censored_value) plus one distinct value per competing cause. |
censored_value |
number | no | The status value marking a censored case (default 0); every other observed value is treated as a distinct competing cause. |
Time series
autocorrelation
The autocorrelation (ACF) and partial autocorrelation (PACF) functions of a numeric series taken in case order: the correlations at each lag with their standard errors and the cumulative Box-Ljung Q test, optionally after regular and/or seasonal differencing. Useful for identifying ARIMA orders and checking for serial dependence.
autocorrelation variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric series to analyze (each taken in case order, non-missing values only). |
lags |
integer | no | The maximum lag to report (default 16, capped at n−1). |
difference |
integer | no | Order of regular differencing to apply first (default 0): each pass replaces the series with its successive differences. |
seasonal_difference |
integer | no | Order of seasonal differencing to apply (default 0); requires period. |
period |
integer | no | The seasonal period for seasonal differencing (e.g. 12 for monthly data). |
seasonal_decompose
Classical seasonal decomposition of a numeric series taken in case order: splits it into trend, seasonal and remainder components at a given period, additively (y = trend + seasonal + remainder) or multiplicatively (y = trend × seasonal × remainder).
seasonal_decompose variable=VarName period=3
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variable |
variable | yes | The numeric series to decompose (in case order). |
period |
integer | yes | The seasonal period (e.g. 12 for monthly, 4 for quarterly); the series needs at least two full periods. |
model |
one of additive, multiplicative |
no | additive (default) or multiplicative; the latter needs strictly positive values. |
cross_correlation
The cross-correlation function (CCF) of two numeric series taken in case order: the correlation between the first series at time t and the second at time t+k across a range of lags k, with white-noise standard-error bands. A positive lag means the second series leads the first.
cross_correlation series1=VarName series2=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
series1 |
variable | yes | The first numeric series (x). |
series2 |
variable | yes | The second numeric series (y). |
max_lag |
integer | no | The maximum lead/lag to report (default 16, capped at n−1). |
var_model
A vector autoregression (VAR) of two or more numeric series taken in case order: each series regressed on p lags of all of them by per-equation OLS, with lag-order selection criteria (AIC, HQ, BIC, FPE), residual covariance and correlation matrices, and pairwise Granger causality F tests — does one series's history improve the prediction of another?
var_model variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric series (two or more), taken in case order and aligned listwise on the rows where all are non-missing. |
lags |
integer | no | The fixed lag order p (default 1); ignored when auto is set. |
auto |
true / false | no | Select the lag order by the information criterion over 1..max_lags, each candidate fitted on the same comparison sample. |
max_lags |
integer | no | The largest candidate order for automatic selection (default 10). |
ic |
one of aic, hq, bic, fpe |
no | The criterion that picks the order under auto (default aic; bic is Lütkepohl's SC). |
trend |
one of constant, trend, both, none |
no | The deterministic terms: a constant (default), a linear time trend, both, or none. |
arima
A Box-Jenkins ARIMA(p,d,q)(P,D,Q)ₛ model of one numeric series taken in case order — fitted by conditional least squares or exact maximum likelihood, optionally with the orders chosen automatically by an information criterion: the AR and MA parameter estimates (including any seasonal terms) with standard errors and t tests, the model-fit statistics (residual variance, log-likelihood, AIC and BIC), and a Box-Ljung white-noise test of the residuals.
arima variable=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variable |
variable | yes | The numeric series to model (taken in case order). |
p |
integer | no | The autoregressive (AR) order (default 0). |
d |
integer | no | The order of regular differencing (default 0). |
q |
integer | no | The moving-average (MA) order (default 0). |
period |
integer | no | The seasonal period s (e.g. 12 for monthly data). Required for any seasonal term; values below 2 disable the seasonal part. |
seasonal_p |
integer | no | The seasonal autoregressive order P (default 0). |
seasonal_d |
integer | no | The order of seasonal differencing D (default 0). |
seasonal_q |
integer | no | The seasonal moving-average order Q (default 0). |
method |
one of css, ml |
no | Estimation method: "css" (conditional least squares, the default) or "ml" (exact / unconditional Gaussian maximum likelihood via a Kalman filter). |
auto |
true / false | no | When true, choose the AR/MA orders automatically by minimizing an information criterion (the differencing d/D and period are held fixed); adds a Model Selection table. |
ic |
one of aic, bic |
no | The information criterion used by automatic order selection: "aic" (default) or "bic". |
max_p |
integer | no | Maximum AR order p searched by auto-selection (default 2). |
max_q |
integer | no | Maximum MA order q searched by auto-selection (default 2). |
max_sp |
integer | no | Maximum seasonal AR order P searched by auto-selection (default 1). |
max_sq |
integer | no | Maximum seasonal MA order Q searched by auto-selection (default 1). |
constant |
true / false | no | Whether to fit a constant (the series mean); defaults to true when there is no differencing (d = D = 0) and false otherwise. |
forecast |
integer | no | How many steps ahead to forecast past the end of the series; adds a Forecast table with prediction intervals. Omit for none. |
confidence |
number | no | The prediction-interval confidence level in percent (default 95). |
stationarity
Unit-root / stationarity tests of one numeric series taken in case order — the step before choosing ARIMA differencing. Runs the Augmented Dickey-Fuller test (null: a unit root, i.e. non-stationary) and the KPSS test (null: stationarity), reporting each statistic with a p-value and a 5% conclusion. The two are complementary.
stationarity variable=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variable |
variable | yes | The numeric series to test (taken in case order). |
trend |
one of constant, trend |
no | The deterministic terms: "constant" (a level, the default) or "trend" (a constant plus a linear time trend). |
adf_lags |
integer | no | The number of lagged differences augmenting the ADF regression; defaults to the Schwert rule floor(12·(n/100)^¼). |
kpss_lags |
integer | no | The number of Bartlett-kernel lags for the KPSS long-run variance; defaults to the same Schwert rule. |
exponential_smoothing
Exponential smoothing of one numeric series taken in case order: simple (level only), Holt's linear trend (level + trend) or additive Holt-Winters (level + trend + season). The smoothing parameters are fitted by minimizing the one-step error; reports the estimates, a fit summary, and an optional forecast with prediction intervals.
exponential_smoothing variable=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variable |
variable | yes | The numeric series to model (taken in case order). |
trend |
one of none, additive |
no | The trend component: "none" (simple smoothing, the default) or "additive" (Holt's linear trend). |
seasonal |
one of none, additive |
no | The seasonal component: "none" (default) or "additive" (Holt-Winters; requires a period of 2 or more). |
period |
integer | no | The seasonal period (e.g. 12 for monthly data); required for the additive-seasonal model. |
forecast |
integer | no | How many steps ahead to forecast; adds a Forecast table and plot with prediction intervals. Omit for none. |
confidence |
number | no | The prediction-interval confidence level in percent (default 95). |
Evidence synthesis and resampling
meta_analysis
Meta-analysis (v1): combines per-study effect sizes — one row per study, an effect column and its standard-error column, already on a common scale (log odds ratio, standardized mean difference, …) — into fixed-effect and random-effects pooled estimates (the τ² estimator is DerSimonian-Laird or REML) with Wald confidence intervals, heterogeneity statistics (Cochran's Q, I², τ²), a forest plot (per-study effects with CIs and the pooled diamond) and a funnel plot with Egger's regression test for small-study asymmetry. Every included row must have both an effect and a positive standard error; a missing cell is an error, not a silent drop. The dataset's Weight Cases setting does not apply (the inverse-variance weights are the statistic's own); Select Cases and Split File are honored.
meta_analysis effect=VarName se=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
effect |
variable | yes | The per-study effect sizes, one row per study, on a common scale. |
se |
variable | yes | The standard error of each study's effect; every value must be a positive number. |
study |
variable | no | An optional study-label variable (any type) naming each row in the tables and the forest plot; rows are labelled "Study 1..k" without it. |
model |
one of fixed, random, both |
no | Which pooled estimate(s) to report: fixed, random (DerSimonian-Laird) or both (default). |
tau_method |
one of dl, reml |
no | The between-study variance (τ²) estimator: dl (DerSimonian-Laird, the default) or reml (restricted maximum likelihood, iterative). It drives the random-effects pooling, the per-study random weights and the τ² in the heterogeneity table; Q, its p and I² are estimator-independent. |
confidence |
number | no | Confidence level (percent) for the pooled and per-study intervals; defaults to 95. |
forest |
true / false | no | Include the forest plot (default true; pass false to omit it). |
funnel |
true / false | no | Include the funnel plot and its Egger's-test table (default true; pass false to omit both). |
bootstrap_ci
A nonparametric case-resampling bootstrap confidence interval for a chosen statistic: it draws B resamples of the cases with replacement, recomputes the statistic on each, and reports the observed value, the bootstrap bias and standard error, and a percentile or BCa (bias-corrected and accelerated) interval. Reproducible for a fixed seed. The statistic is one of the mean, median, standard deviation, variance or coefficient of variation of one variable; the Pearson or Spearman correlation of two variables; or the difference in means of a variable across a two-level grouping factor.
bootstrap_ci variable=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variable |
variable | yes | The numeric variable to bootstrap (the first variable; for a correlation, the X variable). |
statistic |
one of mean, median, std, variance, cv, pearson, spearman, mean_difference |
no | The statistic to bootstrap (default mean). pearson/spearman need a second variable; mean_difference needs a grouping factor. |
variable2 |
variable | no | The second numeric variable, required for the pearson and spearman correlation statistics. |
factor |
variable | no | The two-level grouping factor, required for the mean_difference statistic (the difference is the second level minus the first). |
replicates |
integer | no | How many bootstrap resamples to draw (default 1000). |
ci_method |
one of percentile, bca |
no | The interval method: percentile (default) or bca (bias-corrected and accelerated). |
confidence |
number | no | The confidence level between 0 and 1 (default 0.95). |
seed |
integer | no | The PRNG seed (default 1), making the resampling reproducible. |
Power and sample size
power_means
Statistical power, required sample size, or minimum detectable effect for a t test (one-sample, paired or two independent samples), from Cohen's d. Takes no dataset — all inputs are numbers.
power_means
| Argument | Accepts | Required | Notes |
|---|---|---|---|
test |
one of one_sample, paired, two_sample |
no | Which t test (default: two_sample). |
solve |
one of power, n, effect |
no | What to solve for: power (default), the sample size n, or the detectable effect. |
effect |
number | no | Cohen's d (required unless solving for the effect). |
n |
number | no | Sample size — per group for two_sample, total observations (pairs) otherwise. Required unless solving for n. |
power |
number | no | Target power (0–1); required when solving for n or effect. |
alpha |
number | no | Significance level (default 0.05). |
tails |
integer | no | 1 or 2 (default 2). |
power_anova
Power, required total sample size, or minimum detectable effect for a one-way ANOVA, from Cohen's f. Takes no dataset.
power_anova groups=0.5
| Argument | Accepts | Required | Notes |
|---|---|---|---|
groups |
number | yes | Number of groups (k). |
solve |
one of power, n, effect |
no | What to solve for (default: power). |
effect |
number | no | Cohen's f (required unless solving for the effect). |
n |
number | no | Total sample size N (required unless solving for n). |
power |
number | no | Target power (0–1); required when solving for n or effect. |
alpha |
number | no | Significance level (default 0.05). |
power_correlation
Power, required sample size, or minimum detectable correlation for a test of Pearson's r against zero (Fisher z approximation). Takes no dataset.
power_correlation
| Argument | Accepts | Required | Notes |
|---|---|---|---|
solve |
one of power, n, effect |
no | What to solve for (default: power). |
effect |
number | no | The correlation r (required unless solving for the effect). |
n |
number | no | Sample size N (required unless solving for n). |
power |
number | no | Target power (0–1); required when solving for n or effect. |
alpha |
number | no | Significance level (default 0.05). |
tails |
integer | no | 1 or 2 (default 2). |
power_proportions
Power or required per-group sample size for a test of two independent proportions (Cohen's h). Takes no dataset.
power_proportions p1=0.5 p2=0.5
| Argument | Accepts | Required | Notes |
|---|---|---|---|
p1 |
number | yes | The first proportion (0–1). |
p2 |
number | yes | The second proportion (0–1). |
solve |
one of power, n |
no | What to solve for (default: power). |
n |
number | no | Per-group sample size (required unless solving for n). |
power |
number | no | Target power (0–1); required when solving for n. |
alpha |
number | no | Significance level (default 0.05). |
tails |
integer | no | 1 or 2 (default 2). |
power_regression
Power, required total sample size, or minimum detectable effect for an R² test in multiple linear regression, from Cohen's f². Takes no dataset.
power_regression predictors=0.5
| Argument | Accepts | Required | Notes |
|---|---|---|---|
predictors |
number | yes | Number of predictors tested (u). |
solve |
one of power, n, effect |
no | What to solve for (default: power). |
effect |
number | no | Cohen's f² (required unless solving for the effect). |
n |
number | no | Total sample size N (required unless solving for n). |
power |
number | no | Target power (0–1); required when solving for n or effect. |
alpha |
number | no | Significance level (default 0.05). |
Complex samples
survey_design
Declare (or clear) the dataset-level complex survey design: the sampling-weight variable, and optionally the PSU (cluster) and stratum variables. While a design is declared, the covered procedures (explore, frequencies, two-way crosstabs, means, linear and logistic regression) report design-based estimates with Taylor-linearized standard errors, confidence intervals on the design df, and design effects; every other analysis states that it ran ignoring the design. Mutually exclusive with Weight Cases. Returns the design summary (strata, PSUs, design df). Declaring a design changes every subsequent analysis, so a read-only profile blocks it.
Changes your data. This is a transform, not an analysis; a read-only session cannot run it.
survey_design
| Argument | Accepts | Required | Notes |
|---|---|---|---|
weight |
variable | no | The sampling-weight variable (numeric, positive for every case). Required unless clear=true. |
psu |
variable | no | The primary-sampling-unit (cluster) variable; identifiers are read nested within strata. Omitted means element sampling (each case its own PSU). |
strata |
variable | no | The stratum variable. Omitted means a single stratum. Every stratum needs at least two PSUs. |
clear |
true / false | no | Clear the declared design instead of declaring one; analyses return to their ordinary estimators. |
Tables
custom_tables
A general / custom (pivot) table: one or more nested categorical row variables against zero or more nested categorical column variables, each cell holding one or more statistics — case counts (optionally as row, column or total percentages, so a cell can show a count and a percentage together) or summaries of a numeric measure variable (mean, sum, median, minimum, maximum, standard deviation or valid N). Generalizes crosstabs (counts) and means-by-group (a mean over a measure), and can run pairwise column-proportion z tests. The optional "stack_rows" / "stack_columns" lists add further independent variables on that axis, each its own block computed over its own cases — stacked down the row axis or laid side by side across the column axis (stack one axis at a time, not both).
custom_tables row=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
row |
variable | yes | The outermost categorical row variable. |
nest_rows |
variable list | no | Additional categorical row variables nested under "row" (outer→inner), for a hierarchical row dimension. |
column |
variable | no | An optional outermost categorical column variable; omit for a single-dimension summary. |
nest_columns |
variable list | no | Additional categorical column variables nested under "column" (outer→inner), for a hierarchical column dimension. |
stack_rows |
variable list | no | Additional, independent categorical row variables stacked below the primary row block — each becomes its own section (its own categories computed over its own non-missing cases) down the same row axis, under the shared column dimension and statistics. Use for unrelated variables in one table (e.g. a region block then an age-group block); unlike "nest_rows", the variables are not crossed. |
stack_columns |
variable list | no | Additional, independent categorical column variables stacked beside the primary column block — each becomes its own group of columns (its own levels computed over its own non-missing cases) laid side by side across the column axis, sharing the row dimension and statistics. The column-axis mirror of "stack_rows"; stack only one axis at a time (not both rows and columns at once). |
statistic |
one of count, mean, sum, median, min, max, stddev, valid_n |
no | A single cell statistic (default "count"). Every statistic other than "count" summarizes the measure variable. Use "statistics" for several at once. |
statistics |
text | no | A comma-separated list of cell statistics shown side by side, e.g. "count,row_pct" or "mean,stddev". Allowed: count, valid_n, mean, sum, median, min, max, stddev, row_pct, col_pct, total_pct. Overrides "statistic"/"percent" when given. |
measure |
variable | no | The numeric measure variable summarized in each cell; required for every measure statistic (everything but counts/percentages). |
percent |
one of none, row, column, total |
no | For the single count statistic, show cells as a percentage of the row, column or grand total instead of raw counts (default "none"). |
compare_columns |
true / false | no | When true (and there is a column dimension), add a table of pairwise column-proportion z tests (Bonferroni adjusted). |
multiple_response
A multiple-response frequency table over a set of related variables. In the default "dichotomy" mode the variables are yes/no items sharing a counted value (e.g. several "select all that apply" items), one row each. In "category" mode they share a common code frame (e.g. first / second / third mention), with one row per distinct category pooled across the set. Reports each row's response count, its percent of all responses, and its percent of the valid cases.
multiple_response variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The variables in the set (at least two): numeric dichotomy items for the dichotomy mode, or variables sharing a code frame for the category mode. |
set_type |
one of dichotomy, category |
no | The set type: "dichotomy" (default, count a shared response value) or "category" (pool a shared category code frame). |
counted_value |
number | no | For the dichotomy mode, the value that counts as a response (default 1). |
Charts
histogram
A histogram of one numeric variable.
histogram variable=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variable |
variable | yes | The numeric variable to chart. |
bins |
integer | no | Number of bins (the engine chooses a default if omitted). |
bin_labels |
one of edges, range, start, custom |
no | How the bars are labelled on the x axis: "edges" (a plain tick at each bin boundary, default), "range" (each bar's interval, e.g. "11 - 20"), "start" (the value each bar starts at), or "custom" (a chosen numbering laid over the bars — see bin_label_start/bin_label_width). |
bin_label_start |
number | no | For bin_labels="custom": the leftmost bar's label range minimum. |
bin_label_width |
number | no | For bin_labels="custom": the fixed width of every labelled range; the rest are computed from bin_label_start. |
bin_label_step |
integer | no | How many bars to skip between shown labels, for any bin_labels mode. Defaults to showing every bar for "custom" (a hand-chosen numbering should be complete) and automatic decluttering (about 8 labels) for the other modes. |
colors |
text list | no | Optional color override as a one-entry hex list (e.g. ["#1f77b4"]): the first entry recolors the bars; an invalid entry keeps the theme accent. |
title |
text | no | A title for the chart, replacing the one the analysis generates. Under Split File the group qualifier (" [region = North]") is kept, so the groups stay told apart. |
x_title |
text | no | A label for the x axis, replacing the one derived from the variable. Blank keeps the derived label. |
y_title |
text | no | A label for the y axis, replacing the one derived from the variable. Blank keeps the derived label. |
y_min |
number | no | Lower limit of the y axis — y_min: 0 is the common case, anchoring the axis at zero and leaving the top to the data. |
y_max |
number | no | Upper limit of the y axis. Must exceed y_min when both are given. |
h_lines |
number list | no | Horizontal reference lines at these y values — a mean, a threshold, a target. Drawn dashed behind the data; a value outside the axis range is not drawn. |
gridlines |
true / false | no | Draw the plot gridlines (default true). False suits a figure that will be printed small, where the grid reads as ink noise rather than as a reading aid. |
figure_height |
number | no | Plot height in pixels (120-2000). Omitted, the built-in height is kept. The width is the output column's and is not set here. |
font_scale |
number | no | Multiplier on every text size in the chart (0.5-3): tick labels, axis titles, legend, annotations. Omitted, the built-in sizes are kept. |
x_log |
true / false | no | Draw the x axis on a logarithmic (base-10) scale. Refused, naming the value, when any plotted x value is zero or negative; an explicit x_min/x_max must then be positive too. |
scatter
A scatterplot of two numeric variables, optionally with a LOESS smoother curve over the points.
scatter x=VarName y=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
x |
variable | yes | The variable on the x axis. |
y |
variable | yes | The variable on the y axis. |
smoother |
true / false | no | Draw a LOESS smoother — a local-linear tricube trend curve — over the points (needs at least 6 complete pairs). Defaults to false. |
span |
number | no | The smoother's span: the fraction of the points each local fit weighs, greater than 0 and at most 1 (default 0.75; larger is smoother). Only applies with smoother=true. |
colors |
text list | no | Optional color override as a one-entry hex list (e.g. ["#1f77b4"]): the first entry recolors the points; an invalid entry keeps the theme accent. |
title |
text | no | A title for the chart, replacing the one the analysis generates. Under Split File the group qualifier (" [region = North]") is kept, so the groups stay told apart. |
x_title |
text | no | A label for the x axis, replacing the one derived from the variable. Blank keeps the derived label. |
y_title |
text | no | A label for the y axis, replacing the one derived from the variable. Blank keeps the derived label. |
x_min |
number | no | Lower limit of the x axis. Omitted, the axis fits the data; set alone, only that end is pinned. |
x_max |
number | no | Upper limit of the x axis. Must exceed x_min when both are given. |
y_min |
number | no | Lower limit of the y axis — y_min: 0 is the common case, anchoring the axis at zero and leaving the top to the data. |
y_max |
number | no | Upper limit of the y axis. Must exceed y_min when both are given. |
h_lines |
number list | no | Horizontal reference lines at these y values — a mean, a threshold, a target. Drawn dashed behind the data; a value outside the axis range is not drawn. |
v_lines |
number list | no | Vertical reference lines at these x values. Drawn dashed behind the data; a value outside the axis range is not drawn. |
marker_shape |
one of circle, square, triangle, diamond, cross |
no | The shape drawn at each data point. The five stay apart at 3 px on a greyscale page, which is what a printed figure needs. |
marker_size |
number | no | Marker radius in pixels (0 < size <= 24). Omitted, the built-in 2.5 is kept. |
gridlines |
true / false | no | Draw the plot gridlines (default true). False suits a figure that will be printed small, where the grid reads as ink noise rather than as a reading aid. |
figure_height |
number | no | Plot height in pixels (120-2000). Omitted, the built-in height is kept. The width is the output column's and is not set here. |
font_scale |
number | no | Multiplier on every text size in the chart (0.5-3): tick labels, axis titles, legend, annotations. Omitted, the built-in sizes are kept. |
x_log |
true / false | no | Draw the x axis on a logarithmic (base-10) scale. Refused, naming the value, when any plotted x value is zero or negative; an explicit x_min/x_max must then be positive too. |
y_log |
true / false | no | Draw the y axis on a logarithmic (base-10) scale. Refused, naming the value, when any plotted y value is zero or negative; an explicit y_min/y_max must then be positive too. |
boxplot
A boxplot of one numeric variable, optionally one box per level of a category.
boxplot variable=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variable |
variable | yes | The numeric variable to chart. |
category |
variable | no | Optional variable giving one box per level. |
colors |
text list | no | Optional color override as a one-entry hex list (e.g. ["#1f77b4"]): the first entry recolors the boxes, whiskers and outliers; an invalid entry keeps the theme accent. |
title |
text | no | A title for the chart, replacing the one the analysis generates. Under Split File the group qualifier (" [region = North]") is kept, so the groups stay told apart. |
y_title |
text | no | A label for the value (y) axis, replacing the derived one. Blank keeps it. |
y_min |
number | no | Lower limit of the y axis — y_min: 0 is the common case, anchoring the axis at zero and leaving the top to the data. |
y_max |
number | no | Upper limit of the y axis. Must exceed y_min when both are given. |
h_lines |
number list | no | Horizontal reference lines at these y values — a mean, a threshold, a target. Drawn dashed behind the data; a value outside the axis range is not drawn. |
gridlines |
true / false | no | Draw the plot gridlines (default true). False suits a figure that will be printed small, where the grid reads as ink noise rather than as a reading aid. |
figure_height |
number | no | Plot height in pixels (120-2000). Omitted, the built-in height is kept. The width is the output column's and is not set here. |
font_scale |
number | no | Multiplier on every text size in the chart (0.5-3): tick labels, axis titles, legend, annotations. Omitted, the built-in sizes are kept. |
violin
A violin plot of one numeric variable, optionally one violin per level of a category: the kernel-density silhouette of the distribution with a quartile bar inside — shows the shape (skew, multiple modes) that a boxplot's five-number summary hides. Gaussian kernel, Silverman bandwidth; widths share one density scale across the violins.
violin variable=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variable |
variable | yes | The numeric variable to chart. |
category |
variable | no | Optional variable giving one violin per level. |
colors |
text list | no | Optional per-violin color overrides as hex strings (e.g. "#1f77b4"), in group order; a group beyond the list, or an invalid entry, keeps the default palette. |
title |
text | no | A title for the chart, replacing the one the analysis generates. Under Split File the group qualifier (" [region = North]") is kept, so the groups stay told apart. |
y_title |
text | no | A label for the value (y) axis, replacing the derived one. Blank keeps it. |
y_min |
number | no | Lower limit of the y axis — y_min: 0 is the common case, anchoring the axis at zero and leaving the top to the data. |
y_max |
number | no | Upper limit of the y axis. Must exceed y_min when both are given. |
h_lines |
number list | no | Horizontal reference lines at these y values — a mean, a threshold, a target. Drawn dashed behind the data; a value outside the axis range is not drawn. |
gridlines |
true / false | no | Draw the plot gridlines (default true). False suits a figure that will be printed small, where the grid reads as ink noise rather than as a reading aid. |
figure_height |
number | no | Plot height in pixels (120-2000). Omitted, the built-in height is kept. The width is the output column's and is not set here. |
font_scale |
number | no | Multiplier on every text size in the chart (0.5-3): tick labels, axis titles, legend, annotations. Omitted, the built-in sizes are kept. |
line_chart
A line chart of one or more numeric Y variables against an X variable (case order if omitted), optionally split into one line per level of a category.
line_chart y=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
y |
variable list | yes | The numeric variable(s) to plot as Y series. |
x |
variable | no | Optional numeric variable for the X axis (case order if omitted). |
split |
variable | no | Optional variable giving one line per level. |
markers |
true / false | no | Draw a point marker at each data point (default false). |
legend |
one of auto, right, bottom, none |
no | Where the legend is drawn when there is more than one series: "auto" (top-right, inside the plot, default), "right", "bottom", or "none" to hide it. |
colors |
text list | no | Optional per-series color overrides as hex strings (e.g. "#1f77b4"), in series order; a series beyond the list, or an invalid entry, keeps the default palette. |
line_width |
number | no | Stroke width for the series lines (default 1.8). |
title |
text | no | A title for the chart, replacing the one the analysis generates. Under Split File the group qualifier (" [region = North]") is kept, so the groups stay told apart. |
x_title |
text | no | A label for the x axis, replacing the one derived from the variable. Blank keeps the derived label. |
y_title |
text | no | A label for the y axis, replacing the one derived from the variable. Blank keeps the derived label. |
x_min |
number | no | Lower limit of the x axis. Omitted, the axis fits the data; set alone, only that end is pinned. |
x_max |
number | no | Upper limit of the x axis. Must exceed x_min when both are given. |
y_min |
number | no | Lower limit of the y axis — y_min: 0 is the common case, anchoring the axis at zero and leaving the top to the data. |
y_max |
number | no | Upper limit of the y axis. Must exceed y_min when both are given. |
h_lines |
number list | no | Horizontal reference lines at these y values — a mean, a threshold, a target. Drawn dashed behind the data; a value outside the axis range is not drawn. |
v_lines |
number list | no | Vertical reference lines at these x values. Drawn dashed behind the data; a value outside the axis range is not drawn. |
marker_shape |
one of circle, square, triangle, diamond, cross |
no | The shape drawn at each data point. The five stay apart at 3 px on a greyscale page, which is what a printed figure needs. |
marker_size |
number | no | Marker radius in pixels (0 < size <= 24). Omitted, the built-in 2.5 is kept. |
gridlines |
true / false | no | Draw the plot gridlines (default true). False suits a figure that will be printed small, where the grid reads as ink noise rather than as a reading aid. |
figure_height |
number | no | Plot height in pixels (120-2000). Omitted, the built-in height is kept. The width is the output column's and is not set here. |
font_scale |
number | no | Multiplier on every text size in the chart (0.5-3): tick labels, axis titles, legend, annotations. Omitted, the built-in sizes are kept. |
x_log |
true / false | no | Draw the x axis on a logarithmic (base-10) scale. Refused, naming the value, when any plotted x value is zero or negative; an explicit x_min/x_max must then be positive too. |
y_log |
true / false | no | Draw the y axis on a logarithmic (base-10) scale. Refused, naming the value, when any plotted y value is zero or negative; an explicit y_min/y_max must then be positive too. |
bar_chart
A bar chart of a category variable: the count of cases per level (default), or a summary statistic (mean, sum or median) of a scale variable per level, optionally clustered by a second category. Value labels drive the category axis.
bar_chart category=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
category |
variable | yes | The category variable: one bar (or bar group) per level. |
cluster |
variable | no | Optional second category: bars are grouped side by side, one per level, with a legend. |
stacked |
true / false | no | Stack a clustered chart's second-category segments into one bar per level (part-to-whole) instead of drawing them side by side. Ignored without a "cluster". |
stack_mode |
one of absolute, percent |
no | How a stacked chart divides the bar: "absolute" (default) stacks the values, so bar height still compares totals; "percent" normalizes each bar to 100% so only the composition is compared. Ignored without "stacked". Percent needs every value to be zero or more; with negatives present the chart stacks absolute values and says so. |
bar_gap |
number | no | How much of each category's width is left empty, from 0 (bars touching) to 0.9 (very thin bars). Omit to keep the standard spacing. |
statistic |
one of count, mean, sum, median |
no | What each bar shows: "count" of cases (default, weighted like Frequencies), or the "mean", "sum" or "median" of the scale "variable" per level. |
variable |
variable | no | The numeric variable summarized per level; required for any statistic other than "count". |
legend |
one of auto, right, bottom, none |
no | Where the legend is drawn for a clustered chart: "auto" (top-right, inside the plot, default), "right", "bottom", or "none" to hide it. |
colors |
text list | no | Optional per-series color overrides as hex strings (e.g. "#1f77b4"), in cluster-series order; a series beyond the list, or an invalid entry, keeps the default palette. |
title |
text | no | A title for the chart, replacing the one the analysis generates. Under Split File the group qualifier (" [region = North]") is kept, so the groups stay told apart. |
x_title |
text | no | A label for the category (x) axis, replacing the one derived from the grouping variable. Blank keeps the derived label. |
y_title |
text | no | A label for the value (y) axis, replacing the derived one. Blank keeps it. |
y_min |
number | no | Lower limit of the y axis — y_min: 0 is the common case, anchoring the axis at zero and leaving the top to the data. |
y_max |
number | no | Upper limit of the y axis. Must exceed y_min when both are given. |
h_lines |
number list | no | Horizontal reference lines at these y values — a mean, a threshold, a target. Drawn dashed behind the data; a value outside the axis range is not drawn. |
gridlines |
true / false | no | Draw the plot gridlines (default true). False suits a figure that will be printed small, where the grid reads as ink noise rather than as a reading aid. |
figure_height |
number | no | Plot height in pixels (120-2000). Omitted, the built-in height is kept. The width is the output column's and is not set here. |
font_scale |
number | no | Multiplier on every text size in the chart (0.5-3): tick labels, axis titles, legend, annotations. Omitted, the built-in sizes are kept. |
error_bar
An error-bar (means) plot: the mean of a scale variable per level of a category, each with an error bar — a confidence interval of the mean (default), or ±SE / ±SD. With a second category it becomes an interaction/profile plot, one connected point-run per level. Value labels drive the category axis.
error_bar variable=VarName category=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variable |
variable | yes | The numeric variable whose means are plotted. |
category |
variable | yes | The category variable: one mean per level. |
cluster |
variable | no | Optional second category: one connected point-run per level (an interaction plot), with a legend. |
bars |
one of ci, se, sd |
no | What the error bar spans: "ci" (a confidence interval of the mean at ci_level, default), "se" (± multiplier × standard error) or "sd" (± multiplier × standard deviation). |
ci_level |
number | no | The confidence level as a percent for bars="ci" (default 95). |
multiplier |
number | no | The half-width multiplier for bars="se" or "sd" (default 1). |
legend |
one of auto, right, bottom, none |
no | Where the legend is drawn for a two-category plot: "auto" (top-right, inside the plot, default), "right", "bottom", or "none" to hide it. |
colors |
text list | no | Optional per-series color overrides as hex strings (e.g. "#1f77b4"), in series order; a series beyond the list, or an invalid entry, keeps the default palette. |
title |
text | no | A title for the chart, replacing the one the analysis generates. Under Split File the group qualifier (" [region = North]") is kept, so the groups stay told apart. |
x_title |
text | no | A label for the category (x) axis, replacing the one derived from the grouping variable. Blank keeps the derived label. |
y_title |
text | no | A label for the value (y) axis, replacing the derived one. Blank keeps it. |
y_min |
number | no | Lower limit of the y axis — y_min: 0 is the common case, anchoring the axis at zero and leaving the top to the data. |
y_max |
number | no | Upper limit of the y axis. Must exceed y_min when both are given. |
h_lines |
number list | no | Horizontal reference lines at these y values — a mean, a threshold, a target. Drawn dashed behind the data; a value outside the axis range is not drawn. |
gridlines |
true / false | no | Draw the plot gridlines (default true). False suits a figure that will be printed small, where the grid reads as ink noise rather than as a reading aid. |
figure_height |
number | no | Plot height in pixels (120-2000). Omitted, the built-in height is kept. The width is the output column's and is not set here. |
font_scale |
number | no | Multiplier on every text size in the chart (0.5-3): tick labels, axis titles, legend, annotations. Omitted, the built-in sizes are kept. |
qq_plot
A Q-Q plot of one numeric variable against a theoretical distribution (normal by default), with a reference line fit through the quartiles — the standard visual normality check.
qq_plot variable=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variable |
variable | yes | The numeric variable to plot. |
distribution |
one of normal, t, chi_square |
no | The theoretical distribution: "normal" (default), Student "t" or "chi_square" (the latter two need "df"). |
df |
number | no | Degrees of freedom for distribution="t" or "chi_square". |
standardized |
true / false | no | Scale the sample values to z scores before plotting (default false). |
colors |
text list | no | Optional color override as a one-entry hex list (e.g. ["#1f77b4"]): the first entry recolors the points; an invalid entry keeps the theme accent. |
title |
text | no | A title for the chart, replacing the one the analysis generates. Under Split File the group qualifier (" [region = North]") is kept, so the groups stay told apart. |
x_title |
text | no | A label for the x axis, replacing the one derived from the variable. Blank keeps the derived label. |
y_title |
text | no | A label for the y axis, replacing the one derived from the variable. Blank keeps the derived label. |
x_min |
number | no | Lower limit of the x axis. Omitted, the axis fits the data; set alone, only that end is pinned. |
x_max |
number | no | Upper limit of the x axis. Must exceed x_min when both are given. |
y_min |
number | no | Lower limit of the y axis — y_min: 0 is the common case, anchoring the axis at zero and leaving the top to the data. |
y_max |
number | no | Upper limit of the y axis. Must exceed y_min when both are given. |
h_lines |
number list | no | Horizontal reference lines at these y values — a mean, a threshold, a target. Drawn dashed behind the data; a value outside the axis range is not drawn. |
v_lines |
number list | no | Vertical reference lines at these x values. Drawn dashed behind the data; a value outside the axis range is not drawn. |
marker_shape |
one of circle, square, triangle, diamond, cross |
no | The shape drawn at each data point. The five stay apart at 3 px on a greyscale page, which is what a printed figure needs. |
marker_size |
number | no | Marker radius in pixels (0 < size <= 24). Omitted, the built-in 2.5 is kept. |
gridlines |
true / false | no | Draw the plot gridlines (default true). False suits a figure that will be printed small, where the grid reads as ink noise rather than as a reading aid. |
figure_height |
number | no | Plot height in pixels (120-2000). Omitted, the built-in height is kept. The width is the output column's and is not set here. |
font_scale |
number | no | Multiplier on every text size in the chart (0.5-3): tick labels, axis titles, legend, annotations. Omitted, the built-in sizes are kept. |
scatter_matrix
A scatterplot matrix (pairs plot): every pair of the chosen numeric variables drawn in one grid — the standard first look at a multivariate dataset, showing at a glance which pairs are related and which are not. The diagonal names the variable; each pair appears in both orientations.
scatter_matrix variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric variables to cross. Order sets the panel order. |
max_variables |
integer | no | Cap on the number of variables drawn (default 8; set to 0 to remove the limit). The panel count grows with the square, so past the cap the panels stop being readable; when it bites, the chart says which variables were kept. |
colors |
text list | no | Optional color override as a one-entry hex list (e.g. ["#1f77b4"]): the first entry recolors the points in every panel; an invalid entry keeps the theme accent. |
title |
text | no | A title for the chart, replacing the one the analysis generates. Under Split File the group qualifier (" [region = North]") is kept, so the groups stay told apart. |
gridlines |
true / false | no | Draw the plot gridlines (default true). False suits a figure that will be printed small, where the grid reads as ink noise rather than as a reading aid. |
figure_height |
number | no | Plot height in pixels (120-2000). Omitted, the built-in height is kept. The width is the output column's and is not set here. |
font_scale |
number | no | Multiplier on every text size in the chart (0.5-3): tick labels, axis titles, legend, annotations. Omitted, the built-in sizes are kept. |
ecdf
An empirical cumulative distribution (ECDF): the proportion of cases at or below each value, as a step curve. Answers distributional questions a histogram can obscure, since it needs no bin choice — and comparing groups is a matter of reading two curves apart.
ecdf variable=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variable |
variable | yes | The numeric variable whose distribution to plot. |
groups |
variable | no | Optional grouping variable: one curve per level, so the distributions can be compared directly. |
legend |
one of auto, right, bottom, none |
no | Legend placement when there is more than one curve: "auto" (top-right overlay, the default), "right", "bottom" or "none". |
colors |
text list | no | Optional per-curve color overrides as hex strings (e.g. "#1f77b4"), in group order; a curve beyond the list, or an invalid entry, keeps the default palette. |
line_width |
number | no | Stroke width for the step curves (default 1.6). |
title |
text | no | A title for the chart, replacing the one the analysis generates. Under Split File the group qualifier (" [region = North]") is kept, so the groups stay told apart. |
x_title |
text | no | A label for the x axis, replacing the one derived from the variable. Blank keeps the derived label. |
y_title |
text | no | A label for the y axis, replacing the one derived from the variable. Blank keeps the derived label. |
x_min |
number | no | Lower limit of the x axis. Omitted, the axis fits the data; set alone, only that end is pinned. |
x_max |
number | no | Upper limit of the x axis. Must exceed x_min when both are given. |
v_lines |
number list | no | Vertical reference lines at these x values. Drawn dashed behind the data; a value outside the axis range is not drawn. |
gridlines |
true / false | no | Draw the plot gridlines (default true). False suits a figure that will be printed small, where the grid reads as ink noise rather than as a reading aid. |
figure_height |
number | no | Plot height in pixels (120-2000). Omitted, the built-in height is kept. The width is the output column's and is not set here. |
font_scale |
number | no | Multiplier on every text size in the chart (0.5-3): tick labels, axis titles, legend, annotations. Omitted, the built-in sizes are kept. |
dot_plot
A Cleveland dot plot: one dot per category, placed at its value. Use it instead of a bar chart whenever the values do not start from zero — a bar's length only means something from a zero baseline, while a dot marks the value itself. Sorted by value by default.
dot_plot category=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
category |
variable | yes | The categorical variable: one dot per level. |
variable |
variable | no | The numeric variable to summarize per category. Omit for a case count. |
statistic |
one of count, mean, sum, median |
no | What each dot shows: "count" (default) or the "mean", "sum" or "median" of the numeric variable. |
sort |
one of value, category |
no | Category order: "value" (default, descending — sorting is half of what makes a dot plot readable) or "category" (the levels' own order). |
colors |
text list | no | Optional color override as a one-entry hex list (e.g. ["#1f77b4"]): the first entry recolors the dots; an invalid entry keeps the theme accent. |
title |
text | no | A title for the chart, replacing the one the analysis generates. Under Split File the group qualifier (" [region = North]") is kept, so the groups stay told apart. |
x_title |
text | no | A label for the x axis, replacing the one derived from the variable. Blank keeps the derived label. |
x_min |
number | no | Lower limit of the x axis. Omitted, the axis fits the data; set alone, only that end is pinned. |
x_max |
number | no | Upper limit of the x axis. Must exceed x_min when both are given. |
v_lines |
number list | no | Vertical reference lines at these x values. Drawn dashed behind the data; a value outside the axis range is not drawn. |
gridlines |
true / false | no | Draw the plot gridlines (default true). False suits a figure that will be printed small, where the grid reads as ink noise rather than as a reading aid. |
figure_height |
number | no | Plot height in pixels (120-2000). Omitted, the built-in height is kept. The width is the output column's and is not set here. |
font_scale |
number | no | Multiplier on every text size in the chart (0.5-3): tick labels, axis titles, legend, annotations. Omitted, the built-in sizes are kept. |
bubble_chart
A bubble chart: a scatterplot whose marks carry a third numeric variable as their area. Bubble area is proportional to the value, never the radius — mapping the value to the radius would exaggerate large values by the square.
bubble_chart x=VarName y=VarName size=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
x |
variable | yes | The numeric variable on the horizontal axis. |
y |
variable | yes | The numeric variable on the vertical axis. |
size |
variable | yes | The numeric variable carried by bubble area. Cases with a non-positive size have no area to draw and are dropped, with the count reported on the chart. |
colors |
text list | no | Optional color override as a one-entry hex list (e.g. ["#1f77b4"]): the first entry recolors the bubbles; an invalid entry keeps the theme accent. |
title |
text | no | A title for the chart, replacing the one the analysis generates. Under Split File the group qualifier (" [region = North]") is kept, so the groups stay told apart. |
x_title |
text | no | A label for the x axis, replacing the one derived from the variable. Blank keeps the derived label. |
y_title |
text | no | A label for the y axis, replacing the one derived from the variable. Blank keeps the derived label. |
x_min |
number | no | Lower limit of the x axis. Omitted, the axis fits the data; set alone, only that end is pinned. |
x_max |
number | no | Upper limit of the x axis. Must exceed x_min when both are given. |
y_min |
number | no | Lower limit of the y axis — y_min: 0 is the common case, anchoring the axis at zero and leaving the top to the data. |
y_max |
number | no | Upper limit of the y axis. Must exceed y_min when both are given. |
h_lines |
number list | no | Horizontal reference lines at these y values — a mean, a threshold, a target. Drawn dashed behind the data; a value outside the axis range is not drawn. |
v_lines |
number list | no | Vertical reference lines at these x values. Drawn dashed behind the data; a value outside the axis range is not drawn. |
gridlines |
true / false | no | Draw the plot gridlines (default true). False suits a figure that will be printed small, where the grid reads as ink noise rather than as a reading aid. |
figure_height |
number | no | Plot height in pixels (120-2000). Omitted, the built-in height is kept. The width is the output column's and is not set here. |
font_scale |
number | no | Multiplier on every text size in the chart (0.5-3): tick labels, axis titles, legend, annotations. Omitted, the built-in sizes are kept. |
Transforms
sort_cases
Sort the dataset's cases by a variable (stable, missing values last). Mutates the dataset.
Changes your data. This is a transform, not an analysis; a read-only session cannot run it.
sort_cases variable=VarName
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variable |
variable | yes | The variable to sort by. |
descending |
true / false | no | Sort high-to-low instead of low-to-high. |
compute
Compute a numeric variable from an arithmetic/logical expression over the other variables (e.g. "weight / (height * height)"). Creates the target variable, or overwrites it if it already exists. Mutates the dataset.
Changes your data. This is a transform, not an analysis; a read-only session cannot run it.
compute target="text" expression="text"
| Argument | Accepts | Required | Notes |
|---|---|---|---|
target |
text | yes | The name of the variable to write — new, or an existing numeric variable to overwrite. |
expression |
text | yes | The expression, referencing variables by name. Supports + - * / , parentheses, comparisons and and/or. |
rank_cases
Rank cases by one or more numeric variables into new ordinal variables (one "R"+name variable per source). Mutates the dataset.
Changes your data. This is a transform, not an analysis; a read-only session cannot run it.
rank_cases variables=[Var1, Var2]
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variables |
variable list | yes | The numeric variables to rank. |
descending |
true / false | no | Rank largest-first instead of smallest-first. |
ties |
one of mean, low, high, sequential |
no | How tied values share ranks (default: mean). |
bin_variable
Group a numeric variable into a new ordinal variable by equal-width groups, equal-count (quantile) groups, or your own cutpoints. Mutates the dataset.
Changes your data. This is a transform, not an analysis; a read-only session cannot run it.
bin_variable variable=VarName into="text"
| Argument | Accepts | Required | Notes |
|---|---|---|---|
variable |
variable | yes | The numeric variable to group. |
into |
text | yes | The name of the new grouped variable. |
method |
one of width, quantile, custom |
no | How to choose the group boundaries (default: width). "width": "groups" equal-width groups. "quantile": "groups" equal-count groups. "custom": your own boundaries in "cutpoints". |
groups |
integer | no | Number of groups, at least 2 (for the width/quantile methods). |
cutpoints |
number list | no | The interior group boundaries in ascending order, for the custom method (N-1 values for N groups). |
labels |
text list | no | One label per group, in order (default: generated from the boundaries, e.g. "< 25", "25 – 30", "≥ 30"). |