FreeStatisticalTools.com
Bayesian statistics

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.

Free · No sign-upReplaces JASP · SPSSWorks with your data
Updated · By Bibin Xavier

Data 90 × 12

Paste from Excel, or drop a CSV, TSV or Excel file here.
Example data 90 rows, 12 variables. Data stays in this browser tab.
IDtext · 90 levelsGrouptext · 3 levelsGendertext · 2 levelsAgenumericHours_StudynumericAnxietynumericMotivationnumericPre_ScorenumericPost_ScorenumericExam_ScorenumericPassednumeric · codedSatisfactionnumeric · coded
S001ControlMale2311.2294.660626712
S002WorkshopFemale233.9283.554705402
S003OnlineFemale1810.132455576603
S004ControlMale2613.6413.552555903
S005WorkshopFemale229.7273.656636504
S006OnlineFemale207.9323.865826502
S007ControlFemale206.328372836103
S008WorkshopMale228293.164726213

Variables and options

Predictors 4 selected · min 1
Results update automatically when you change an option.

Results

90 rows · example data
Table 1

Model comparison

ModelR²P(M | data)BF10 vs nullBF vs best model
Hours_Study + Anxiety + Motivation.3420.3622.24 × 10^51.000
Hours_Study + Anxiety.3150.3252.01 × 10^50.897
Hours_Study + Anxiety + Motivation + Age.3450.10665744.10.294
Hours_Study + Anxiety + Age.3200.09961541.40.275
Anxiety + Motivation.2920.08150219.10.224
Anxiety + Motivation + Age.2970.02615895.70.071
Motivation.1590.000220.30.001
Hours_Study + Motivation.1770.000124.80.001
Hours_Study.1310.00058.8820.000
Motivation + Age.1590.00052.6490.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.

Table 2

Posterior inclusion probabilities

PredictorP(incl)P(incl | data)BFinclusionEvidence
Hours_Study0.5000.8938.308moderate evidence for H₁
Anxiety0.5000.9991210.8extreme evidence for H₁
Motivation0.5000.5761.357anecdotal evidence for H₁
Age0.5000.2320.302moderate 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

Table 3

Posterior coefficients (full model)

PredictorPosterior meanPosterior SD95% credible intervalP(β > 0 | data)OLS b
Hours_Study0.9380.404[0.141, 1.721]0.9911.033
Anxiety-0.4850.115[-0.713, -0.262]0.000-0.533
Motivation2.6831.597[-0.449, 5.787]0.9552.937
Age0.1780.326[-0.453, 0.822]0.7100.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).

Best model3 predictorsHours_Study + Anxiety + Motivation
P(best model | data)0.362
BF₁₀ full model65744.1

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₁.

Bayesian linear regression (Zellner–Siow prior, r = 0.354) identified Hours_Study + Anxiety + Motivation as the best model, P(M|data) = 0.362, BF10 = 2.24 × 10^5.

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

  1. 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.
  2. Choose the variables. Select the outcome and predictors.
  3. Set the options. Fill in prior scale on coefficients.
  4. 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