Step 1: Tell us about your data

What kind of outcome are you analyzing?

In other words: what are you trying to predict or explain?
Linear regression works when your outcome can be any number on a continuous scale. Examples: someone's weight, test scores, temperature readings.
Logistic regression models yes/no outcomes. Examples: did someone click the ad (yes/no), did the patient survive (yes/no).
Poisson regression is for counting things - whole numbers only. Examples: number of doctor visits, number of accidents, number of emails received.

How many predictor variables do you have?

Predictors are the variables you'll use to explain or predict your outcome. For example: age, gender, treatment group, etc.

What's a typical range for your outcome?

This helps us suggest reasonable starting values. For example, if you're predicting weight in pounds, you might say 50-200. Just give us a rough idea.
Great! You've completed Step 1.

What are priors?

Priors are your starting assumptions before looking at the data. They help guide the model, especially when you don't have a lot of data.

Think of it like this: if someone says 'guess a person's height,' you'd probably guess somewhere between 5 and 6 feet, not 1 foot or 20 feet. That's a prior - your reasonable expectations before seeing the actual person.

Don't worry! If your data strongly disagrees with your priors, the data will win. Priors just help keep the model sensible, especially with small datasets.

The Baseline (Intercept)

Plain English: The intercept is your starting point - what you'd predict when all your predictor variables equal zero. Think of it as the 'baseline' value.

Normal distribution: The classic bell curve. Most values cluster around the center. Good when you have a clear expectation.
Student-t distribution: Like a normal curve but with 'fatter tails' - allows for more extreme values. More conservative and robust.
Exponential distribution: Only allows positive values. Use when your baseline must be greater than zero (like counts or rates).
This is your best guess for the baseline value.
Larger values = more uncertainty about where the baseline should be.
Higher rate means you expect smaller baseline values.
Lower values = heavier tails = more robust to outliers. Most people use 3-7.

Your Baseline Distribution

The Effects (Coefficients)

Plain English: Coefficients tell you how much each predictor affects your outcome. For example: 'For each additional year of age, weight increases by 2 pounds.' The '2 pounds' is the coefficient.

Normal: Standard choice. Works well when you expect effects to be moderate and well-behaved.
Student-t: The gold standard recommended by Bayesian experts. Balances being informative with being robust to surprises in your data.
Cauchy: Very heavy tails - allows for extremely large effects. Can be unstable. Use only if you know what you're doing!
Exponential: Only allows positive effects. Use when you know all effects should be positive (increasing).
0 means 'no strong expectation about direction.' Positive = expect increases, negative = expect decreases.
This controls how large of an effect you think is plausible. Larger values allow for bigger effects.
Higher rate means you expect smaller positive effects.
Lower = more flexible. Most people use 3.

Your Effects Distribution

The Noise Level (Residual Standard Deviation)

Plain English: This represents the 'noise' or unexplained variation in your data. Even with perfect predictors, there's always some randomness. This parameter captures that.

Half-Normal: Half of a bell curve (only positive values, since noise can't be negative). Simple and works well.
Half-Student-t: The recommended default. Weakly informative and robust. Good for most situations.
Exponential: Puts more weight on smaller noise values. Use when you expect your model to fit the data closely.
Think about how far off your predictions might typically be.
Higher values mean you expect lower noise levels.
Lower = more flexible. Most people use 3.

Your Noise Distribution

Excellent! Your priors are set.

Your Custom Stan Model Code

Copy this code into a .stan file and use it with RStan or CmdStanR:


                    
                    
                      
                      Download .stan File
                    
                  

What Do These Priors Mean in Plain English?

Next Steps

How to use this code:

  1. Save the code - Download the .stan file or copy the code above
  2. Prepare your data - Make sure you have your outcome (y) and predictors (X) ready in R
  3. Run the model - Use RStan or CmdStanR to fit the model:
  4. # Example with RStan
    library(rstan)
    fit <- stan(file = 'your_model.stan', 
                data = list(N = nrow(data), 
                           K = 2,
                           X = X_matrix,
                           y = y_vector))
                  
  5. Check the results - Examine posterior distributions, convergence diagnostics (Rhat), and effective sample size

Need to adjust your priors? Just go back to Step 2 and tweak the sliders. The code will update automatically!