Bayesian Linear Regression
Compare every combination of predictors with Bayes factors (Zellner–Siow g-prior, Liang et al., 2008), see how likely each predictor is to belong in the model, and get posterior estimates with 95% credible intervals.
Updated · By Bibin XavierData 90 × 12
| IDtext · 90 levels | Grouptext · 3 levels | Gendertext · 2 levels | Agenumeric | Hours_Studynumeric | Anxietynumeric | Motivationnumeric | Pre_Scorenumeric | Post_Scorenumeric | Exam_Scorenumeric | Passednumeric · coded | Satisfactionnumeric · coded |
|---|---|---|---|---|---|---|---|---|---|---|---|
| S001 | Control | Male | 23 | 11.2 | 29 | 4.6 | 60 | 62 | 67 | 1 | 2 |
| S002 | Workshop | Female | 23 | 3.9 | 28 | 3.5 | 54 | 70 | 54 | 0 | 2 |
| S003 | Online | Female | 18 | 10.1 | 32 | 4 | 55 | 57 | 66 | 0 | 3 |
| S004 | Control | Male | 26 | 13.6 | 41 | 3.5 | 52 | 55 | 59 | 0 | 3 |
| S005 | Workshop | Female | 22 | 9.7 | 27 | 3.6 | 56 | 63 | 65 | 0 | 4 |
| S006 | Online | Female | 20 | 7.9 | 32 | 3.8 | 65 | 82 | 65 | 0 | 2 |
| S007 | Control | Female | 20 | 6.3 | 28 | 3 | 72 | 83 | 61 | 0 | 3 |
| S008 | Workshop | Male | 22 | 8 | 29 | 3.1 | 64 | 72 | 62 | 1 | 3 |
Variables and options
Results
90 rows · example dataModel comparison
| Model | R² | P(M | data) | BF10 vs null | BF vs best model |
|---|---|---|---|---|
| Hours_Study + Anxiety + Motivation | .342 | 0.362 | 2.24 × 10^5 | 1.000 |
| Hours_Study + Anxiety | .315 | 0.325 | 2.01 × 10^5 | 0.897 |
| Hours_Study + Anxiety + Motivation + Age | .345 | 0.106 | 65744.1 | 0.294 |
| Hours_Study + Anxiety + Age | .320 | 0.099 | 61541.4 | 0.275 |
| Anxiety + Motivation | .292 | 0.081 | 50219.1 | 0.224 |
| Anxiety + Motivation + Age | .297 | 0.026 | 15895.7 | 0.071 |
| Motivation | .159 | 0.000 | 220.3 | 0.001 |
| Hours_Study + Motivation | .177 | 0.000 | 124.8 | 0.001 |
| Hours_Study | .131 | 0.000 | 58.882 | 0.000 |
| Motivation + Age | .159 | 0.000 | 52.649 | 0.000 |
Note. All 16 models with equal prior probabilities. Zellner–Siow mixture of g-priors with r = 0.354 (the BayesFactor and JASP default “medium”). Top 10 shown.
Posterior inclusion probabilities
| Predictor | P(incl) | P(incl | data) | BFinclusion | Evidence |
|---|---|---|---|---|
| Hours_Study | 0.500 | 0.893 | 8.308 | moderate evidence for H₁ |
| Anxiety | 0.500 | 0.999 | 1210.8 | extreme evidence for H₁ |
| Motivation | 0.500 | 0.576 | 1.357 | anecdotal evidence for H₁ |
| Age | 0.500 | 0.232 | 0.302 | moderate evidence for H₀ |
Note. BFinclusion = posterior inclusion odds ÷ prior inclusion odds (1 with equal model priors): the evidence that the predictor belongs in the model, averaged over all models.
Posterior inclusion probability
Posterior coefficients (full model)
| Predictor | Posterior mean | Posterior SD | 95% credible interval | P(β > 0 | data) | OLS b |
|---|---|---|---|---|---|
| Hours_Study | 0.938 | 0.404 | [0.141, 1.721] | 0.991 | 1.033 |
| Anxiety | -0.485 | 0.115 | [-0.713, -0.262] | 0.000 | -0.533 |
| Motivation | 2.683 | 1.597 | [-0.449, 5.787] | 0.955 | 2.937 |
| Age | 0.178 | 0.326 | [-0.453, 0.822] | 0.710 | 0.190 |
Note. Unstandardized coefficients under the Zellner–Siow prior (6,000 posterior draws). Average shrinkage factor E[g/(1+g) | data] = 0.910; the posterior mean equals the OLS estimate times this factor. Intercept omitted (flat prior).
Interpretation
The most probable model is Hours_Study + Anxiety + Motivation (posterior probability 0.362, R² = .342). Compared with the intercept-only model, the full model has BF10 = 65744.1, extreme evidence for H₁.
How to cite this tool
Using these results in a thesis, journal article, report or class assignment? Please cite this free tool so others can find it. It keeps the site free.
APA 7
Xavier, B. (2026). Bayesian Linear Regression [Web application]. FreeStatisticalTools.com. https://freestatisticaltools.com/bayesian-linear-regression/
BibTeX
@software{xavier_bayesianregression_2026,
author = {Xavier, Bibin},
title = {Bayesian Linear Regression},
publisher = {FreeStatisticalTools.com},
year = {2026},
url = {https://freestatisticaltools.com/bayesian-linear-regression/},
note = {Web application}
}Suggested sentence for your methods section: “The analysis was carried out with the free Bayesian Linear Regression tool on FreeStatisticalTools.com (Xavier, 2026).”
What is Bayesian linear regression?
Bayesian linear regression evaluates every combination of predictors. Each model gets a Bayes factor against the intercept-only model under the Zellner–Siow mixture of g-priors (Liang et al., 2008), the default in JASP and BayesFactor. Posterior model probabilities show which models the data support, inclusion probabilities show which predictors matter across models, and posterior draws give credible intervals for the coefficients.
When to use Bayesian linear regression
Use it to decide which predictors matter, compare competing regression models, or average conclusions over models instead of relying on a single stepwise selection.
Assumptions
- Linear relationships, independent cases and roughly normal residuals with constant variance.
- Text predictors are dummy-coded automatically; each dummy counts as one predictor.
How to set up your data
One numeric outcome column and one or more predictor columns.
How to use this tool
- Enter your data. Paste columns from Excel, Google Sheets or SPSS with variable names in the first row, or upload a CSV or Excel file. The example data shows the expected layout.
- Choose the variables. Select the outcome and predictors.
- Set the options. Fill in prior scale on coefficients.
- Read the results. Results update automatically. Read the plain-English interpretation, then use Copy table to paste APA-style tables into Word and Copy for the results sentence.
How to report Bayesian linear regression in APA style
“Bayesian model comparison favoured the model with study hours and prior score (P(M|data) = .62, BF₁₀ = 3.1 × 10⁶); study hours had an inclusion Bayes factor of 2.4 × 10⁴.”
Frequently asked questions
What is an inclusion Bayes factor?
The change from prior to posterior odds that a predictor belongs in the model, averaged over all models. Values above 3 support including the predictor; below 1/3 support leaving it out.
Why use Bayesian model comparison instead of stepwise regression?
Stepwise selection picks one model and ignores uncertainty. Bayesian model comparison weighs all models by their evidence and lets you average conclusions over them.
What prior is used?
A Zellner–Siow Cauchy prior on standardized coefficients with scale r = 0.354 (√2/4, “medium”), and a uniform prior over models.
Can I use categorical predictors?
Yes. Text variables are dummy-coded automatically, with the first category as the reference.
Related tools
Browse all categories
Data cleaning and preparation · Describe and explore · Compare means · Nonparametric tests · Correlation and regression · Bayesian statistics · Categorical data · Reliability and agreement · Multivariate analysis · Structural equation modeling · Econometrics and time series · Panel data and causal inference · Marketing and decision research · Survival, clinical and meta-analysis · Study planning and calculators · PLS-SEM