SPSS command: SPSS BAYES INDEPENDENT
Bayesian independent-samples t test in your browser
The Bayesian independent-samples t test compares the means of two groups by asking how much more likely the data are with a group difference than without one.
Free · No account · Files stay on your device · Updated 18 October 2026
What it tells you
Crosstabs runs the SPSS BAYES INDEPENDENT procedure on your device with three Bayes factor methods and five priors for the posterior of the difference, including the unequal-variance Behrens–Fisher case.
- How strongly the data support a difference between the two groups (BF10) or the absence of one (BF01).
- The posterior of the mean difference (group 2 − group 1) with a credible interval for its size.
- Group N, means, SDs and standard errors, plus the pooled-variance t test for comparison.
- How sensitive the conclusion is to the prior, by switching between Rouder, Gönen and hyper-prior factors.
When to use it
Use it when
- Two independent groups (treatment vs control, two regions, two product versions) compared on a scale outcome.
- An A/B test where you want to report evidence for "no difference" when the variants perform alike.
- A grouping variable with more than two codes from which you pick the two groups to compare.
Use something else when
- Three or more groups at once: use Bayesian one-way ANOVA.
- The same people in both conditions: use Bayesian paired samples.
- A binary outcome such as converted/not converted: compare proportions with the Bayesian test of independence instead.
How to run it in Crosstabs
- 01
Open your data
Open the file and switch to Statistics mode; choose Bayesian independent samples in the Bayesian statistics group.
- 02
Choose variables and groups
Tick one or more Test variables, pick the Grouping variable, then choose Group 1 and Group 2 from its categories. The difference is reported as group 2 − group 1.
- 03
Pick the Bayes factor method
Under Bayes factor choose Rouder (JZS), Gönen (set the Effect-size mean and Effect-size variance) or Hyper-prior (set Hyper-prior a, default −0.75).
- 04
Pick the prior for the difference
Under Prior for the posterior choose Equal variances, diffuse–Jeffreys; Equal variances, inverse-χ² prior; Unequal variances, diffuse (Behrens–Fisher); or a known-variance option with flat or normal priors per group.
- 05
Run
Set Credible interval (%), declare any workspace weight, and press Run Bayesian independent-samples inference. Cases outside the two chosen groups are ignored.
Worked example
Computed by the Crosstabs engine from the synthetic data below when this page was built — not typed in.
Data
32 synthetic support tickets, 16 handled in a standard queue and 16 in a priority queue; the outcome is hours to resolution, drawn from normal distributions with a fixed seed.
| Group | N | Mean | Std. Deviation | Std. Error Mean |
|---|---|---|---|---|
| standard | 16 | 20.13 | 5.32 | 1.329 |
| priority | 16 | 14.83 | 4.35 | 1.088 |
| Variable | Mean difference | Pooled std. error difference | BF01 | BF10 | t | df | Sig. (2-tailed) |
|---|---|---|---|---|---|---|---|
| hours | −5.30 | 1.717 | 0.103 | 9.751 | −3.086 | 30 | .004 |
Difference = priority − standard (group 2 − group 1); Rouder's JZS method.
| Variable | Posterior mode | Posterior mean | Posterior variance | 95% CrI lower | 95% CrI upper |
|---|---|---|---|---|---|
| hours | −5.300 | −5.300 | 3.1598 | −8.807 | −1.793 |
Prior: equal variances, diffuse–Jeffreys; equal-tailed credible interval.
How to read it
Priority tickets closed 5.30 hours faster on average (t(30) = −3.09, p = .004). Rouder's Bayes factor gives moderate evidence for the alternative (BF10 = 9.751). The 95% credible interval for the difference, −8.81 to −1.79 hours, shows how large the gap plausibly is, not only whether it exists.
Output tables explained
- Group Statistics
- N, mean, standard deviation and standard error of the mean for each of the two groups.
- Bayes Factor Independent Sample Test
- Mean difference, pooled standard error, BF01, BF10 and the pooled-variance t, df and two-tailed significance; a footnote names the Bayes factor method.
- Posterior Distribution Characterization for Independent Sample Mean
- Mode, mean, variance and equal-tailed credible interval of the posterior of the difference under the chosen prior, with a prior/posterior plot.
Assumptions and notes
- Cases are independent and each belongs to only one of the two groups.
- The outcome is roughly normal within each group.
- The Bayes factors use the pooled-variance t statistic, which assumes equal variances; if variances clearly differ, read the posterior under the Behrens–Fisher prior.
How the results are validated
The Rouder factor matches R BayesFactor 0.9.12.4.8 ttestBF(rscale = 1) to a relative 1e-8 and pingouin to 1e-7; the Gönen factor matches the mpmath reference to 1e-12 (1e-8 with a shifted effect-size mean), and the hyper-prior factor matches 30-digit quadrature to 1e-10 and its closed form to 1e-12. The posterior of the difference under all five priors matches to 1e-11 with credible limits to 1e-9. Validation evidence
Questions
Which Bayes factor method should I report?
Rouder's JZS factor is the most widely cited default. Gönen's method lets you centre the effect-size prior on an expected effect, and the hyper-prior method of Wang & Liu (2016) puts a prior on the prior's scale; showing that all three agree strengthens a conclusion.
Why is my difference negative?
The difference is group 2 − group 1, following SPSS. Swap Group 1 and Group 2 to reverse the sign; the Bayes factor does not change.
What if the two groups have very different variances?
Choose Unequal variances, diffuse (Behrens–Fisher) for the posterior of the difference. The Bayes factor itself is still based on the pooled t statistic, so interpret it with care.
Can I use a survey weight?
No. A frequency weight that counts identical cases is accepted, but a sampling weight is refused because Bayes factors here assume independent, identically distributed cases. Use Complex Samples for design-based comparisons.
Is my data uploaded?
No. Everything runs in a Web Worker inside your browser tab; the file never leaves your device.
Related procedures
- Independent-Samples T TestT-TEST GROUPS
- Bayesian One-Way ANOVABAYES ANOVA
- Bayesian Paired SamplesBAYES RELATED
- Mann-Whitney U TestNPAR TESTS /M-W
- Bayesian One-Sample InferenceBAYES ONESAMPLE
- Free SPSS alternative: full coverage list
Run Bayesian Independent Samples on your own data
Open a .sav, CSV or Excel file. Everything runs in your browser; the file never leaves your device.
SPSS is a trademark of IBM Corp. Crosstabs is not affiliated with or endorsed by IBM.