BayesianRegressionModels — Example Catalog

359 formulas · 19 sources · 1 verified

↗ GitHub

:bambi — Bambi model gallery 100 1✓

Multiple Linear Regression11✓

:escs✓ verifiedMultiple Linear Regression
drugs ~ o + c + e + a + n

Linear regression of illegal drug use on Big Five personality scores. Family: gaussian.

Alternative Links3

Using Other Samplers1

:alternative_samplersunverifiedJAX-Based Samplers
y ~ x

Linear regression on synthetic data; demonstrates blackjax, numpyro and nutpie backends. Family: gaussian.

Beta Regression4

:beta_probs_interceptunverifiedIntercept Only (Probabilities)
probabilities ~ 1

Intercept-only beta regression on synthetic probability data. Family: beta.

:beta_coinunverifiedCoin Dirt
p ~ delta_d

Beta regression of probability on coin dirt differential. Family: beta.

:beta_batting_interceptunverifiedBatting Average Intercept Only
batting_avg ~ 1

Intercept-only beta regression on baseball batting averages. Family: beta.

:beta_batting_shiftunverifiedBatting Average with Shift Predictor
batting_avg ~ batting_avg_shift

Beta regression of batting average on prior-year batting average. Family: beta.

Categorical Regression3

:categorical_toyunverifiedToy Dataset
y ~ x

Categorical regression on three Gaussian classes. Family: categorical.

:categorical_irisunverifiedIris Species
species ~ sepal_length + sepal_width + petal_length + petal_width

Categorical regression predicting iris species from morphological measurements. Family: categorical.

:categorical_alligatorunverifiedAlligator Food Choice
choice ~ length + sex

Categorical regression of alligator food choice on body length and sex. Family: categorical.

Regression Splines2

:cherry_blossoms_explicitunverifiedExplicit Intercept
doy ~ bs(year, knots=iknots, intercept=True)

Spline basis regression of bloom day-of-year on year, with explicit intercept term in the basis expansion. Family: gaussian.

:cherry_blossoms_absorbedunverifiedAbsorbed Intercept
doy ~ bs(year, knots=iknots)

Spline basis regression of bloom day-of-year on year, with model intercept absorbed (not explicit in the basis). Family: gaussian.

Circular Regression2

:circular_vonmisesunverifiedVon Mises Family
direction ~ distance

Circular regression of periwinkle direction on distance using von Mises distribution. Family: vonmises.

:circular_gaussianunverifiedGaussian Comparison
direction ~ distance

Gaussian regression of circular direction data; used as a misspecified comparison model against the von Mises. Family: gaussian.

Count Regression with Offset2

:count_roaches_poissonunverifiedPoisson
y ~ roach1 + treatment + senior + offset(log(exposure2))

Poisson regression of roach counts with log-exposure offset. Family: poisson.

:count_roaches_nbunverifiedNegative Binomial
y ~ roach1 + treatment + senior + offset(log(exposure2))

Negative binomial regression of roach counts with log-exposure offset; accounts for overdispersion relative to Poisson. Family: negativebinomial.

Hierarchical Linear Regression1

:dietoxunverifiedPig Growth
Weight ~ Time + (Time|Pig)

Mixed-effects model of pig weight over time with random slope and intercept per pig. Family: gaussian.

Distributional Models3

:distributional_const_alphaunverifiedConstant Alpha
y ~ x

Gamma regression with a single (constant) shape parameter alpha. Family: gamma.

:distributional_var_alphaunverifiedVarying Alpha
y ~ x + alpha ~ x

Distributional gamma regression: compound formula models both mu and alpha as functions of x. Family: gamma.

:distributional_bikesunverifiedBikes Spline
count ~ 0 + bs(hour, 8, intercept=True) + alpha ~ 0 + bs(hour, 8, intercept=True)

Distributional gamma regression on hourly bike count data; both mu and alpha modeled with spline basis functions. Family: gamma.

Fixed/Random Effects4

:fixed_random_naiveunverifiedNaive Model
y ~ x + z

Naive logistic regression ignoring group structure entirely. Family: bernoulli.

:fixed_random_feunverifiedFixed Effects Model
y ~ 0 + C(group) + x + z

Fixed effects logistic regression with a dummy indicator per group. Family: bernoulli.

:fixed_random_reunverifiedRandom Effects Model
y ~ x + z + (1|group)

Multilevel logistic regression with random group intercepts. Family: bernoulli.

:fixed_random_mundlakunverifiedMundlak Machine
y ~ x + z + xbar + (1|group)

Mundlak machine: random intercepts plus group-mean of x to separate within/between effects. Family: bernoulli.

Hierarchical Binomial2

:hierarchical_binomial_nopoolingunverifiedNo Pooling
p(H, AB) ~ 0 + playerID

Non-hierarchical binomial model: separate intercept per player. Family: binomial.

:hierarchical_binomial_partialunverifiedPartial Pooling
p(H, AB) ~ 1 + (1|playerID)

Hierarchical binomial model with random player intercepts. Family: binomial.

HSGP 1D4

:hsgp_1d_basicunverifiedBasic
y ~ 0 + hsgp(x, m=10, c=2)

Hilbert-space Gaussian process approximation on 1D synthetic data. Family: gaussian.

:hsgp_1d_centeredunverifiedCentered Parameterization
y ~ 0 + hsgp(x, m=10, c=2, centered=True)

HSGP with centered parameterization on 1D synthetic data. Family: gaussian.

:hsgp_1d_by_groupunverifiedBy Group (Shared Covariance)
y ~ 0 + hsgp(x2, by=fac, m=12, c=1.5)

HSGP on GAM data with group-specific processes sharing covariance parameters. Family: gaussian.

:hsgp_1d_nocovunverifiedBy Group (No Shared Covariance)
y ~ 0 + hsgp(x2, by=fac, m=12, c=1.5, share_cov=False)

HSGP on GAM data with group-specific processes and independent covariance parameters. Family: gaussian.

HSGP 2D5

:hsgp_2d_isounverifiedIsotropic
outcome ~ 0 + hsgp(x, y, c=1.5, m=10)

Isotropic 2D Hilbert-space Gaussian process on synthetic data. Family: gaussian.

:hsgp_2d_by_groupunverifiedBy Group (Shared Covariance)
outcome ~ 0 + hsgp(x, y, by=group, c=1.5, m=10)

2D HSGP with group-specific processes sharing covariance parameters. Family: gaussian.

:hsgp_2d_nocovunverifiedBy Group (No Shared Covariance)
outcome ~ 0 + hsgp(x, y, by=group, c=1.5, m=10, share_cov=False)

2D HSGP with group-specific processes and independent covariance parameters. Family: gaussian.

:hsgp_2d_anisounverifiedAnisotropic
outcome ~ 0 + hsgp(x, y, c=1.5, m=10, iso=False)

Anisotropic 2D HSGP allowing different length scales per dimension. Family: gaussian.

:hsgp_2d_poissonunverifiedSpatial Poisson Count Data
Count ~ 0 + Year + X1:Year + (1|Site) + hsgp(Lon, Lat, by=Year, m=5, c=1.5)

Poisson regression combining fixed effects, random site intercepts, and a 2D spatial HSGP term varying by year. Family: poisson.

Logistic Regression1

:logistic_anesunverifiedVote Intention
vote['clinton'] ~ party_id + party_id:age

Logistic regression of Clinton vote on party ID and party-age interaction. Family: bernoulli.

MrP1

:mister_punverifiedMultilevel Regression and Post-Stratification
p(abortion, n) ~ male + repvote + (1|state) + (1|eth) + (1|edu) + (1|male:eth) + (1|edu:age) + (1|edu:eth)

Multilevel binomial regression with crossed random effects for state, ethnicity, education and interactions; used for post-stratification. Family: binomial.

Model Comparison3

:model_comparison_linearunverifiedLinear
income['>50K'] ~ sex + race + scale(age) + scale(hs_week)

Linear logistic regression of income on sex, race, age, and weekly hours worked. Family: bernoulli.

:model_comparison_quadunverifiedQuadratic
income['>50K'] ~ sex + race + scale(age) + I(scale(age)**2) + scale(hs_week) + I(scale(hs_week)**2)

Quadratic logistic regression adding squared age and hours terms. Family: bernoulli.

:model_comparison_cubicunverifiedCubic
income['>50K'] ~ sex + race + scale(age) + I(scale(age)**2) + I(scale(age)**3) + scale(hs_week) + I(scale(hs_week)**2) + I(scale(hs_week)**3)

Cubic logistic regression adding cubic age and hours terms. Family: bernoulli.

Negative Binomial2

:negative_binomial_mainunverifiedMain Effects
daysabs ~ 0 + prog + scale(math)

Negative binomial regression of student absences on program type and math score. Family: negativebinomial.

:negative_binomial_interactionunverifiedInteraction
daysabs ~ 0 + prog + scale(math) + prog:scale(math)

Negative binomial regression adding program-by-math interaction term. Family: negativebinomial.

Ordinal Regression3

:ordinal_trolley_interceptunverifiedTrolley Intercept Only
response ~ 0

Cumulative ordinal model with only threshold parameters, no predictors. Family: cumulative.

:ordinal_trolley_effectsunverifiedTrolley Action/Intention/Contact
response ~ 0 + action + intention + contact + action:intention + contact:intention

Cumulative ordinal model with action, intention, contact and their interactions. Family: cumulative.

:ordinal_hr_yearsunverifiedHR Years at Company
YearsAtCompany ~ 0 + TotalWorkingYears

Sequential ratio (sratio) ordinal model predicting years at company from total working years. Family: sratio.

Orthogonal Polynomial5

:orthopoly_explicitunverifiedExplicit Quadratic
x ~ I(t**2) + t + 1

Explicit (raw) quadratic polynomial on projectile data. Family: gaussian.

:orthopoly_polyunverifiedpoly() Degree 2
x ~ poly(t, 2) + 1

Orthogonal polynomial degree 2 on projectile data. Family: gaussian.

:orthopoly_linearunverifiedMPG Linear
mpg ~ horsepower

Linear regression of fuel efficiency on horsepower; baseline model. Family: gaussian.

:orthopoly_quadunverifiedMPG Quadratic
mpg ~ poly(horsepower, 2)

Orthogonal polynomial degree 2 regression of mpg on horsepower. Family: gaussian.

:orthopoly_compareunverifiedMPG Degree Comparison
mpg ~ poly(horsepower, degree)

Orthogonal polynomial regression template for degree ∈ 1:9; used for model comparison. Family: gaussian.

Plot Comparisons2

:plot_comp_zipunverifiedZIP Fish Count
count ~ livebait + camper + persons + child

Zero-inflated Poisson model of fish catch count. Family: zeroinflatedpoisson.

:plot_comp_logisticunverifiedLogistic Titanic Survival
Survived ~ PClass * SexCode * Age

Logistic regression of Titanic survival on passenger class, sex and age with interactions. Family: bernoulli.

Plot Predictions4

:plot_pred_linearunverifiedLinear Regression (mtcars)
mpg ~ 0 + hp * wt + cyl + gear

Linear regression of fuel efficiency on horsepower, weight, cylinders and gear. Family: gaussian.

:plot_pred_nbunverifiedNegative Binomial (Student Absences)
daysabs ~ 0 + prog + scale(math) + prog:scale(math)

Negative binomial regression of student absences; dataset requires Stata loading (see :negative_binomial). Placeholder DataFrame() used here. Family: negativebinomial.

:plot_pred_logisticunverifiedLogistic Regression (Movies)
certified_fresh ~ 0 + scale(length) * style

Logistic regression of "certified fresh" rating on film length and genre style. Family: bernoulli.

:plot_pred_distrunverifiedDistributional Gamma
y ~ x + alpha ~ x

Distributional gamma regression on synthetic data; same model as :distributionalvaralpha. Family: gamma.

Plot Slopes2

:plot_slopes_mainunverifiedMain Effects
switch ~ dist100 + arsenic + educ4

Logistic regression of well-switching on distance, arsenic level and education. Family: bernoulli.

:plot_slopes_interactionunverifiedWith Interactions
switch ~ dist100 + arsenic + educ4 + dist100:educ4 + arsenic:educ4

Logistic regression adding education interaction terms with distance and arsenic. Family: bernoulli.

Polynomial Regression6

:poly_falling_explicitunverifiedFalling Ball (Explicit)
x ~ I(t**2) + 1

Polynomial regression using inline transformation I(t**2) to recover gravitational constant from falling ball data. Family: gaussian.

:poly_falling_altunverifiedFalling Ball (Curly-Brace Syntax)
x ~ {t**2} + 1

Same as :polyfallingexplicit but using Bambi's alternative curly-brace inline transformation syntax. Family: gaussian.

:poly_falling_precompunverifiedFalling Ball (Pre-Computed Column)
x ~ tsquared + 1

Polynomial regression using a pre-computed tsquared column rather than inline transformation. Family: gaussian.

:poly_projectile_powerunverifiedProjectile (Power Basis)
x ~ I(t**2) + t + 1

Explicit quadratic polynomial regression on projectile data with both linear and quadratic terms. Family: gaussian.

:poly_projectile_polyunverifiedProjectile (poly() Syntax)
x ~ poly(t, 2, raw=True)

Quadratic polynomial regression using Bambi's poly() function with raw (non-orthogonal) polynomials. Family: gaussian.

:poly_planetsunverifiedMulti-Planet
Height ~ I(Time**2):Planet + Time + 0

Planet-specific quadratic coefficient interacted with Planet to recover different gravitational constants per planet. Family: gaussian.

Predict New Groups1

:predict_new_groupsunverifiedPredict New Groups
fvc ~ 0 + weeks + smoking_status + (0 + weeks | patient)

Mixed-effects model predicting FVC with random slopes per patient; demonstrates out-of-sample prediction for new groups. Family: gaussian.

Quantile Regression4

:quantile_p10unverifiedp10 (Asymmetric Laplace)
bmi ~ bs(age, knots=knots)

Spline regression targeting the 10th percentile of BMI. Family: asymmetriclaplace, kappa=0.1.

:quantile_p50unverifiedp50 (Asymmetric Laplace)
bmi ~ bs(age, knots=knots)

Spline regression targeting the 50th percentile (median) of BMI. Family: asymmetriclaplace, kappa=0.5.

:quantile_p90unverifiedp90 (Asymmetric Laplace)
bmi ~ bs(age, knots=knots)

Spline regression targeting the 90th percentile of BMI. Family: asymmetriclaplace, kappa=0.9.

:quantile_gaussianunverifiedGaussian Comparison
bmi ~ bs(age, knots=knots)

Spline regression using Gaussian family; used as comparison model to quantile approach. Family: gaussian.

Radon6

:radon_pooledunverifiedComplete Pooling
log_radon ~ 0 + floor

Complete pooling model: single intercept per floor type, ignoring county structure. Family: gaussian.

:radon_nopoolingunverifiedNo Pooling
log_radon ~ 0 + county:floor

No-pooling model: separate intercept for each county-floor combination. Family: gaussian.

:radon_partialunverifiedPartial Pooling (Intercept Only)
log_radon ~ 1 + (1|county)

Partial pooling with random county intercepts, no floor predictor. Family: gaussian.

:radon_floorunverifiedPartial Pooling with Floor
log_radon ~ 1 + floor + (1|county)

Partial pooling with floor as fixed effect and random county intercepts. Family: gaussian.

:radon_slopesunverifiedVarying Slopes
log_radon ~ floor + (floor|county)

Partial pooling with random slope and intercept for floor by county. Family: gaussian.

:radon_county_predunverifiedCounty-Level Uranium Predictor
log_radon ~ floor + log_u + (1|county)

Partial pooling with floor and county-level uranium predictor (log_u). Family: gaussian.

Shooter Task3

:shooter_rate_simpleunverifiedRate (No Target Effect)
rate ~ S(race) * S(object) + (S(race) * S(object) | subject)

Reaction rate modeled by race × object interaction with crossed random effects per subject, without target random effects. Family: gaussian.

:shooter_rate_targetunverifiedRate (With Target Effect)
rate ~ S(race) * S(object) + (S(race) * S(object) | subject) + (S(object) | target)

Reaction rate modeled by race × object interaction with crossed random effects for both subject and target. Family: gaussian.

:shooter_binaryunverifiedBinary Shoot Decision
shoot_or_not[shoot] ~ S(race)*S(object) + (S(race)*S(object) | subject) + (S(object) | target)

Binary shoot/don't-shoot decision modeled by race × object interaction with crossed random effects for subject and target. Family: bernoulli.

Hierarchical Linear Regression1

:sleepstudyunverifiedSleep Deprivation
Reaction ~ 1 + Days + (Days | Subject)

Mixed-effects model of reaction time on days of sleep deprivation with random slope and intercept per subject. Family: gaussian.

Strack RRR2

:strack_rrr_simpleunverifiedSimple Random Effects
value ~ condition + (1|uid)

Simple model with condition as fixed effect and random participant intercepts. Family: gaussian.

:strack_rrr_fullunverifiedFull Crossed Random Effects
value ~ condition + age + gender + (1|uid) + (condition|study) + (condition|stimulus)

Full model with condition, age, gender, random participant intercepts, and crossed random effects for study and stimulus. Family: gaussian.

Continuous Time Survival3

:survival_cont_weibullunverifiedWeibull
censored(time, censoring) ~ treatment + age

Weibull survival model on synthetic data with treatment and age effects. Family: weibull.

:survival_cont_retention_feunverifiedRetention Fixed Effects
censored(month, censoring) ~ C(gender) + C(level) + C(field) + sentiment + intention

Weibull survival model of employee tenure with fixed effects only. Family: weibull.

:survival_cont_retention_reunverifiedRetention Random Effects
censored(month, censoring) ~ C(gender) + C(level) + sentiment + intention + (1|field)

Weibull survival model of employee tenure with random intercepts for field. Family: weibull.

Discrete Time Survival4

:survival_disc_simunverifiedSimulated Data
event ~ treatment + age + time

Bernoulli survival model with complementary log-log link on synthetic discrete-time data. Family: bernoulli, link="cloglog".

:survival_disc_binomialunverifiedBinomial Child Mortality
p(events, at_risk) ~ sex + socBranch + period + scale(birth_decade)

Binomial discrete-time survival model on Swedish child mortality data. Family: binomial, link="cloglog".

:survival_disc_splineunverifiedSpline Baseline Hazard
p(events, at_risk) ~ sex + socBranch + bs(period, df=4) + scale(birth_decade)

Binomial discrete-time survival with spline baseline hazard. Family: binomial, link="cloglog".

:survival_disc_poissonunverifiedPoisson Alternative
events ~ sex + socBranch + period + scale(birth_decade) + offset(log(at_risk))

Poisson formulation of discrete-time survival with log-offset for person-time. Family: poisson.

Survival Model2

:survival_interceptunverifiedIntercept Only
censored(days_to_event / 31, adopt) ~ 1

Exponential survival model with only an intercept (constant hazard). Family: exponential, link="log".

:survival_colorunverifiedColor Effect
censored(days_to_event / 31, adopt) ~ 0 + color_id

Exponential survival model with cat color as a predictor. Family: exponential, link="log".

Robust Regression2

:t_regression_gaussianunverifiedGaussian Family
y ~ x

Standard linear regression on data with outliers; used as baseline. Family: gaussian.

:t_regression_tunverifiedStudent's t Family
y ~ x

Robust linear regression using Student's t family, which down-weights outliers. Family: t.

Wald Gamma2

:wald_gamma_waldunverifiedInsurance Claims (Wald Family)
claimcst0 ~ C(agecat) + gender + area

Wald (inverse Gaussian) regression of claim costs on age category (as categorical), gender and area. Family: wald, link="log".

:wald_gamma_gammaunverifiedInsurance Claims (Gamma Family)
claimcst0 ~ agecat + gender + area

Gamma regression of claim costs on age category (numeric), gender and area. Family: gamma, link="log".

Zero Inflated4

:zip_muunverifiedMu Component
count ~ livebait + camper + persons + child

ZIP mu component: models the expected count given non-zero. Family: zeroinflatedpoisson.

:zip_psiunverifiedPsi Component
psi ~ livebait + camper + persons + child

ZIP psi component: models the probability of excess zeros. Family: zeroinflatedpoisson.

:hurdle_muunverifiedMu Component
count ~ livebait + camper + persons + child

Hurdle Poisson mu component: models the expected count given positive. Family: hurdle_poisson.

:hurdle_psiunverifiedPsi Component
psi ~ livebait + camper + persons + child

Hurdle Poisson psi component: models the probability of a non-zero outcome. Family: hurdle_poisson.

:brms — brms vignettes (Bürkner) 25

Multivariate Models3

:btdata_compactunverifiedCompact mvbind Syntax
bf(mvbind(tarsus, back) ~ sex + hatchdate + (1|p|fosternest) + (1|q|dam)) + set_rescor(TRUE)

Compact syntax: one formula for both responses; correlated random effects via shared labels p and q; set_rescor(TRUE) adds residual correlations.

:btdata_explicitunverifiedExplicit Separate Formulas
bf(tarsus ~ sex + hatchdate + (1|p|fosternest) + (1|q|dam)) + bf(back ~ sex + hatchdate + (1|p|fosternest) + (1|q|dam)) + set_rescor(TRUE)

Equivalent explicit syntax with separate bf() per response; same model as :btdata_compact but with individually specified sub-formulas.

:btdata_splineunverifiedSkew-Normal with Splines
bf(tarsus ~ sex + s(hatchdate, k=5) + (1|p|fosternest) + (1|q|dam), family = skew_normal()) + bf(back ~ sex + s(hatchdate, k=5) + (1|p|fosternest) + (1|q|dam)) + set_rescor(TRUE)

Extended model: skew-normal family for tarsus, smooth spline for hatchdate in both sub-models.

Custom Families2

:cbpp_binomialunverifiedStandard Binomial GLMM
incidence | trials(size) ~ period + (1|herd)

Standard binomial GLMM for contagious bovine pleuropneumonia incidence across 4 periods.

:cbpp_beta_binomialunverifiedBeta-Binomial GLMM
incidence | vint(size) ~ period + (1|herd)

Custom beta_binomial2 family; vint passes integer auxiliary data (herd size) to the custom family. Accounts for extra-binomial overdispersion.

Distributional Regression4

:distreg_normalunverifiedLocation-Scale Normal
bf(symptom_post ~ group, sigma ~ group)

Distributional model for both mean and log(sigma) as functions of group; demonstrates that the two groups differ in both location and scale.

:distreg_nbunverifiedNegative Binomial Counts
count ~ persons + child + camper

Negative binomial model for fishing trip catch counts; no zero-inflation component.

:distreg_zipunverifiedZero-Inflated Poisson
bf(count ~ persons + child + camper, zi ~ child)

Zero-inflated Poisson; zi sub-model predicts structural-zero probability from child.

:distreg_gamunverifiedSmooth GAM
bf(y ~ s(x1) + s(x2) + (1|fac), sigma ~ s(x0) + (1|fac))

Both mean and log(sigma) modeled as smooth splines; shared random group effects.

Monotonic Effects5

:income_mounverifiedMain Effect
ls ~ mo(income)

Monotonic main effect of ordered income; mo() constrains the response to be monotonically increasing or decreasing across ordered categories.

:income_numunverifiedNumeric Comparison
ls ~ income_num

Comparison: standard numeric predictor, ignoring the ordinal structure of income.

:income_nominalunverifiedNominal Factor Comparison
ls ~ income

Comparison: unordered factor coding, ignores both ordinal structure and monotonicity.

:income_mo_ageunverifiedInteraction with Age
ls ~ mo(income) * age

Interaction of monotonic income effect with age group.

:income_mo_cityunverifiedCity-Level Random Slopes
ls ~ mo(income) * age + (mo(income) | city)

Adds city-level random slopes for the monotonic income effect.

Handle Missing Values3

:nhanes_imputedunverifiedMultiple Imputation
bmi ~ age * chl

Fit to multiply-imputed datasets via brm_multiple; standard regression template on complete cases from each imputed dataset.

:nhanes_jointunverifiedJoint Imputation Model
bf(bmi | mi() ~ age * mi(chl)) + bf(chl | mi() ~ age) + set_rescor(FALSE)

Joint model: simultaneously imputes chl while modelling bmi; mi() marks imputed variables; set_rescor(FALSE) removes residual correlations between equations.

:nhanes_errorunverifiedMeasurement Error Variant
bf(bmi | mi() ~ age * mi(chl)) + bf(chl | mi(se = se_chl) ~ age) + set_rescor(FALSE)

Variant: chl measured with known standard error se_chl; propagates measurement uncertainty into the joint imputation model.

Nonlinear Models3

:nonlinear_expunverifiedExponential Decay
bf(y ~ b1 * exp(b2 * x), b1 + b2 ~ 1, nl = TRUE)

Nonlinear exponential model; nl=TRUE enables custom nonlinear predictors; b1 + b2 ~ 1 declares both as intercept-only submodels.

:nonlinear_linearunverifiedLinear Comparison
y ~ x

Standard linear model on the same exponential-decay data; baseline comparison.

:nonlinear_lossunverifiedWeibull Loss Development
bf(cum ~ ult * (1 - exp(-(dev/theta)^omega)), ult ~ 1 + (1|AY), omega ~ 1, theta ~ 1, nl = TRUE)

Nonlinear Weibull loss development curve; ult (ultimate loss) varies by accident year; omega = shape, theta = scale.

Phylogenetic Models5

:phylo_simple_reunverifiedSimple Random Effect
phen ~ cofactor + (1|gr(phylo, cov = A))

Phylogenetic random effect only; A is the phylogenetic covariance matrix.

:phylo_simple_residunverifiedAdditional Residual Effect
phen ~ cofactor + (1|gr(phylo, cov = A)) + (1|phylo)

Adds a species-level residual random effect on top of the phylogenetic effect; (1|phylo) captures species-specific deviations not explained by phylogeny.

:phylo_repeat_reunverifiedRepeated Observations
phen ~ cofactor + (1|gr(phylo, cov = A)) + (1|species)

Phylogenetic effect plus within-species random effect for 5 repeated observations per species.

:phylo_effectunverifiedMeta-Analysis
Zr | se(sqrt(1/(N-3))) ~ 1 + (1|gr(phylo, cov = A))

Meta-analytic model; known SE derived from N; se() passes known measurement error; random study intercept captures between-species heterogeneity.

:phylo_poisunverifiedPoisson Family
phen_pois ~ cofactor + (1|gr(phylo, cov = A))

Poisson GLMM with phylogenetic random effect; models count phenotype data.

:mcelreath — Statistical Rethinking 2e (Kurz / McElreath) 58

Blue Tit Morphology3

:mcelreath_btdata_interceptunverifiedIntercept OnlySR2 Ch 17
mvbind(tarsus, back) ~ 1

Intercept-only multivariate model; establishes baseline residual correlation between tarsus length and back coloration.

:mcelreath_btdata_fullunverifiedFull ModelSR2 Ch 17
mvbind(tarsus, back) ~ sex + hatchdate + (1 | p | fosternest) + (1 | q | dam)

Full model; p/q labels allow correlated random effects across responses. Sex and hatch date as fixed effects; foster nest and dam as random effects.

:mcelreath_btdata_interactionunverifiedSex × Hatchdate InteractionSR2 Ch 17
mvbind(tarsus, back) ~ sex * hatchdate + (1 | p | fosternest) + (1 | q | dam)

Adds sex × hatchdate interaction to the full model.

Café Visit Times1

:cafeunverifiedVarying SlopesSR2 Ch 14synthetic
wait ~ 1 + afternoon + (1 + afternoon | cafe)

Varying intercepts AND slopes; café-level covariance between them. The afternoon effect on wait time differs across cafés.

Cherry Blossoms1

:cherry_blossomsunverifiedB-Spline RegressionSR2 Ch 4
doy ~ 1 + B

B is a B-spline basis matrix (each column is a basis function); constructed via bs(year, knots=iknots) in R with ~17 basis columns.

Chimpanzees4

:chimpanzees_interceptunverifiedIntercept OnlySR2 Ch 11
pulled_left | trials(1) ~ 1

Intercept-only binomial; baseline probability of pulling left across all actors and treatments.

:chimpanzees_actorsunverifiedActor-Indexed Intercepts and Treatment EffectsSR2 Ch 11
bf(pulled_left | trials(1) ~ a + b, a ~ 0 + actor, b ~ 0 + treatment, nl = TRUE)

Actor-indexed intercepts plus treatment effects; no pooling across actors.

:chimpanzees_multilevelunverifiedMultilevel Partial PoolingSR2 Ch 13
bf(pulled_left | trials(1) ~ a + b, a ~ 1 + (1 | actor) + (1 | block), b ~ 0 + treatment, nl = TRUE)

Multilevel model with partial pooling across actors and blocks. Adaptive regularization via hierarchical priors on actor and block intercepts.

:chimpanzees_slopesunverifiedVarying Slopes by TreatmentSR2 Ch 14
pulled_left | trials(1) ~ 0 + treatment + (0 + treatment | actor) + (0 + treatment | block)

Varying slopes; each actor and block has its own treatment-effect vector.

Globe Tossing1

:globeunverifiedGlobe TossingSR2 Ch 2–3synthetic
w | trials(n) ~ 0 + Intercept

Binomial likelihood for estimating p(water) from a globe-tossing experiment. family = binomial(link = "identity"); 0 + Intercept fixes the link to identity, estimating p directly.

Happiness2

:happiness_colliderunverifiedCollider Bias (Spurious Age Effect)SR2 Ch 6synthetic
happiness ~ 0 + mid + a

mid = marriage as index; conditioning on marriage (a collider) induces a spurious negative association between age and happiness.

:happiness_causalunverifiedCausal Model (No Age Effect)SR2 Ch 6synthetic
happiness ~ 0 + Intercept + a

No conditioning on marriage; age has no direct effect on happiness in this causal model.

Distributional Model1

:heterounverifiedHeteroscedastic GaussianSR2 Ch 10synthetic
bf(y ~ 1, sigma ~ 1 + x)

Distributional model: both mean and log(sigma) have their own sub-models. sigma grows with x, producing heteroscedastic residuals.

Heights and Weights6

:howell1_interceptunverifiedIntercept OnlySR2 Ch 4
height ~ 1

Intercept-only Gaussian regression on adult heights (age >= 18, n=352). Used as a prior predictive / baseline model.

:howell1_linearunverifiedLinear RegressionSR2 Ch 4
height ~ 1 + weight_c

Simple linear regression of height on mean-centered weight in adults (age >= 18). weight_c = weight - mean(weight).

:howell1_quadunverifiedQuadratic PolynomialSR2 Ch 4
height ~ 1 + weight_s + weight_s2

Quadratic polynomial regression of height on standardized weight using the full dataset (all ages). weight_s = standardized weight, weight_s2 = weight_s^2.

:howell1_cubicunverifiedCubic PolynomialSR2 Ch 4
height ~ 1 + weight_s + weight_s2 + weight_s3

Cubic polynomial regression of height on standardized weight using the full dataset (all ages). weight_s3 = weight_s^3.

:howell1_nlunverifiedNonlinear Exponential GrowthSR2 Ch 4
bf(height ~ a + exp(lb) * weight_c, a ~ 1, lb ~ 1, nl = TRUE)

Nonlinear exponential growth model for height on mean-centered weight in adults (age >= 18). weight_c = weight - mean(weight).

:howell1_volumeunverifiedNonlinear Volume ModelSR2 Ch 16
bf(w ~ log(3.141593 * k * p^2 * h^3), k + p ~ 1, nl = TRUE)

Lognormal nonlinear model treating body weight as a scaled cylinder. w = weight, h = height. Models body weight as a scaled cylinder volume.

Kline Island3

:kline_interceptunverifiedIntercept-Only PoissonSR2 Ch 11–12
total_tools ~ 1

Intercept-only Poisson (log link); baseline tool count model.

:kline_contactunverifiedContact-Indexed Intercepts and Log-Population SlopesSR2 Ch 11–12
bf(total_tools ~ a + b * log_pop_std, a + b ~ 0 + cid, nl = TRUE)

Contact-index intercepts and slopes on log-population. cid = contact level (high/low).

:kline_powerunverifiedScientific Power-Law ModelSR2 Ch 11–12
bf(total_tools ~ exp(a) * population^b / g, a + b ~ 0 + cid, g ~ 1, nl = TRUE)

Scientific power-law model with identity link; a, b vary by contact level cid.

Kline Island1

:kline2unverifiedGaussian Process over GeographySR2 Ch 14
bf(total_tools ~ exp(a) * population^b / g, a ~ 1 + gp(lat_adj, lon2_adj, scale=FALSE), b + g ~ 1, nl = TRUE)

Power-law model where a has a Gaussian process prior over geographic coordinates (latitude and longitude). Requires Kline2 dataset.

Lynx and Hare4

:lynx_hare_arunverifiedAR(1) Autoregressive ModelSR2 Ch 16
Hare ~ 1 + ar(time = Year, p = 1)

AR(1) autoregressive model for hare population using the full dataset (missings present in lag variables).

:lynx_hare_lagunverifiedLag-1 RegressionSR2 Ch 16
Hare ~ 1 + Hare_1

Equivalent lag-1 regression; Hare_1 = lag of Hare. Uses dropmissing dataset (d2, n=20).

:lynx_hare_miunverifiedMissing-Data Model for Lagged HareSR2 Ch 16
bf(Hare ~ 1 + mi(Hare_1)) + bf(Hare_1 | mi() ~ 1) + set_rescor(FALSE)

Treating lagged Hare as partially observed/missing. Uses the full dataset with first-row Hare_1 as missing.

:lynx_hare_varunverifiedBivariate VAR(1)SR2 Ch 16
bf(Hare ~ 0 + Intercept + Hare_1 + Lynx_1) + bf(Lynx ~ 0 + Intercept + Lynx_1 + Hare_1) + set_rescor(FALSE)

Bivariate VAR(1); lognormal family. Lynx feeds back on Hare. Uses dropmissing dataset (d2, n=20).

Milk Energy5

:milk_neounverifiedNeocortex PredictorSR2 Ch 5–6
kcal_s ~ 1 + neo_s

Positive association between neocortex percentage and kcal per gram before controlling for body mass. Uses complete cases (n=12) with non-missing neocortex.perc.

:milk_massunverifiedLog Body Mass PredictorSR2 Ch 5–6
kcal_s ~ 1 + logmass_s

Negative association; larger species produce less calorie-dense milk. Uses complete cases (n=12) with non-missing neocortex.perc.

:milk_bothunverifiedNeocortex and Mass (Masked Association)SR2 Ch 5–6
kcal_s ~ 1 + neo_s + logmass_s

Both effects revealed simultaneously — the masked association. Uses complete cases (n=12) with non-missing neocortex.perc.

:milk_cladeunverifiedClade Index ModelSR2 Ch 5–6
kcal_s ~ 0 + clade

Clade index model with one intercept per primate clade, no overall intercept. Uses complete cases (n=12) with non-missing neocortex.perc.

:milk_miunverifiedJoint Missing-Data ModelSR2 Ch 15
bf(k ~ 1 + mi(b) + m) + bf(b | mi() ~ 1) + set_rescor(FALSE)

Joint missing-data model from Ch 15; b = neocortex.perc with missing values treated as partially observed. Uses the full dataset (all 29 species, including those with missing neocortex data).

Moralizing Gods1

:moralizing_godsunverifiedMissing-Data HandlingSR2 Ch 15
moralizing_gods | trials(1) ~ 1 + writing

Do moralizing gods predict / follow the emergence of writing? Rows with missing moralizing_gods or writing are dropped.

Panda Nuts1

:panda_nutsunverifiedNonlinear Learning-Curve ModelSR2 Ch 16
bf(n_panda ~ seconds * phi * (1 - exp(-k * age_s))^theta, phi + k + theta ~ 1, nl = TRUE)

poisson(link = identity); n_panda = success; phi = asymptotic rate, k = growth rate, theta = shape; age_s = standardized age.

Plant Growth3

:plant_growth_baselineunverifiedBaseline (No Treatment Effect)SR2 Ch 6synthetic
h1 ~ 0 + h0

Baseline model with no treatment effect. Growth proportional to initial height.

:plant_growth_biasedunverifiedPost-Treatment BiasSR2 Ch 6synthetic
bf(h1 ~ h0 * (a + t * treatment + f * fungus), a + t + f ~ 1, nl = TRUE)

Post-treatment bias: treatment effect absorbed by conditioning on fungus (a mediator). Including fungus blocks the path from treatment to h1.

:plant_growth_causalunverifiedCausal Model (Excluding Mediator)SR2 Ch 6synthetic
bf(h1 ~ h0 * (a + t * treatment), a + t ~ 1, nl = TRUE)

Causal model: treatment effect recovered by excluding fungus (the mediator). This gives an unbiased estimate of the total effect of treatment on growth.

Primates2

:primates301_olsunverifiedOLS Without PhylogenySR2 Ch 14–15
b ~ 1 + m + g

Brain size ~ body mass + group size; phylogeny ignored. All variables log-standardized.

:primates301_phylounverifiedPhylogenetic RegressionSR2 Ch 14–15
b ~ 1 + m + g + fcor(R)

Same as OLS model plus phylogenetic correlation matrix R passed via data2. R is built from a phylogenetic tree, e.g. via ape::vcv.phylo().

Reed Frogs2

:reedfrogs_nopoolingunverifiedNo-Pooling ModelSR2 Ch 12–13
surv | trials(density) ~ 0 + factor(tank)

No-pooling model; one parameter per tank. Each tank gets its own intercept with no sharing of information.

:reedfrogs_partialunverifiedPartial Pooling via Multilevel ModelSR2 Ch 12–13
surv | trials(density) ~ 1 + (1 | tank)

Partial pooling; adaptive regularization via multilevel model. Tank-level intercepts share a common hyperprior.

Terrain Ruggedness3

:rugged_pooledunverifiedPooled ModelSR2 Ch 8–9
log_gdp_std ~ 1 + rugged_std_c

Pooled model ignoring continent. log_gdp_std = log GDP standardized to mean, rugged_std_c = ruggedness standardized and centered.

:rugged_continentunverifiedContinent InterceptsSR2 Ch 8–9
log_gdp_std ~ 0 + cid + rugged_std_c

Continent intercepts via index cid; same ruggedness slope for Africa and Other. cid = "Africa" or "Other".

:rugged_nlunverifiedNonlinear Continent SlopesSR2 Ch 8–9
bf(log_gdp_std ~ 0 + a + b * rugged_std_c, a ~ 0 + cid, b ~ 0 + cid, nl = TRUE)

Continent-specific intercepts AND slopes; ruggedness hurts GDP outside Africa but helps within Africa.

Trolley3

:trolley_interceptunverifiedIntercept Only (6 Thresholds)SR2 Ch 12
response ~ 1

Intercept-only cumulative ordinal model; 6 thresholds estimated for the 7-point response scale.

:trolley_effectsunverifiedAction, Contact, and Intention EffectsSR2 Ch 12
response ~ 1 + action + contact + intention + intention:action + intention:contact

Action, contact, and intention effects (with interactions) on moral acceptability ratings.

:trolley_eduunverifiedMonotonic Education EffectSR2 Ch 12
response ~ 1 + action + contact + intention + mo(edu_new)

Monotonic effect of ordered education; edu_new = integer-coded edu (1–8). mo() constrains the effect to be monotonically increasing.

Tulips2

:tulips_additiveunverifiedAdditive Water and Shade EffectsSR2 Ch 8
blooms_std ~ 1 + water_cent + shade_cent

Additive model; water_cent and shade_cent are mean-centered. No interaction term.

:tulips_interactionunverifiedWater × Shade InteractionSR2 Ch 8
blooms_std ~ 1 + water_cent + shade_cent + water_cent:shade_cent

Interaction model: the effect of water on blooms depends on shade level.

UC Berkeley Admissions3

:ucbadmit_genderunverifiedGender GapSR2 Ch 11
admit | trials(applications) ~ 0 + gid

gid = gender index; apparent gender gap in admission rates before conditioning on department.

:ucbadmit_deptunverifiedGender + DepartmentSR2 Ch 11
bf(admit | trials(applications) ~ a + d, a ~ 0 + gid, d ~ 0 + dept, nl = TRUE)

Gender and department effects; gender gap disappears after conditioning on department (Simpson's paradox).

:ucbadmit_beta_binomialunverifiedBeta-BinomialSR2 Ch 12
admit | vint(applications) ~ 0 + gid

Custom beta-binomial family from Ch 12; vint passes integer auxiliary data (applications count).

Waffle Divorce6

:waffle_divorce_aunverifiedAge Predicts DivorceSR2 Ch 5
D ~ 1 + A

Simple regression of standardized divorce rate on standardized median age at marriage. D = standardized Divorce, A = standardized MedianAgeMarriage.

:waffle_divorce_munverifiedMarriage Rate Predicts DivorceSR2 Ch 5
D ~ 1 + M

Simple regression of standardized divorce rate on standardized marriage rate. D = standardized Divorce, M = standardized Marriage.

:waffle_divorce_amunverifiedMultiple Regression (M's effect vanishes)SR2 Ch 5
D ~ 1 + M + A

Multiple regression; M's effect vanishes after conditioning on A, revealing a spurious association between marriage rate and divorce.

:waffle_divorce_mediatorunverifiedMediator Regression (A predicts M)SR2 Ch 5
M ~ 1 + A

Mediator regression: age at marriage predicts marriage rate. Part of the causal model where A -> M -> D and A -> D.

:waffle_divorce_multivariateunverifiedMultivariate Simultaneous Causal ModelSR2 Ch 5
bf(D ~ 1 + M + A) + bf(M ~ 1 + A) + set_rescor(FALSE)

Multivariate brms model; simultaneous causal model for D and M with residual correlation disabled via set_rescor(FALSE).

:waffle_divorce_meas_errunverifiedMeasurement Error ModelSR2 Ch 15
D_obs | mi(D_sd) ~ 1 + A + M

Measurement error model from Ch 15; D_sd is the known standard error of the divorce estimate (approximated as 0.1 * |D| + 0.01). D_obs is the noisy observation.

:kruschke — DBDA2 (Kurz / Kruschke) 41

Hierarchical Binomial1

:batting_averageunverifiedMLB Batting AverageDBDA2 Ch 9
Hits | trials(AtBats) ~ 1 + (1 | PriPos) + (1 | PriPos:Player)

Hierarchical binomial model; players nested within positions; estimates batting average with partial pooling.

Calcium RCT1

:calciumunverifiedSeparate Group MeansDBDA2 Ch 16
decrease ~ 0 + treatment

Separate group means for calcium vs. placebo; Gaussian (or student-t for robustness). Outcome is blood-pressure decrease in mm Hg.

Censored Data3

:censored_missingunverifiedMissing Values ModelDBDA2 Ch 25synthetic
y_na ~ 1

Gaussian model with missing values; brms uses listwise deletion by default. 50 MCAR missing observations out of 500.

:censored_lrunverifiedLeft/Right CensoringDBDA2 Ch 25synthetic
y1 | cens(cen1) ~ 1

Left/right censored Gaussian model; cen1 ∈ {"left", "none", "right"}; censored at 85 and 115.

:censored_intervalunverifiedInterval CensoringDBDA2 Ch 25synthetic
y2 | cens(cen2, y3) ~ 1

Interval censored Gaussian model; y3 = upper bound of each interval; values rounded to nearest 5.

Fruitfly5

:fruitfly_hierarchicalunverifiedHierarchical One-Way ANOVADBDA2 Ch 19
Longevity ~ 1 + (1 | CompanionNumber)

ANOVA as hierarchical model; partial pooling across companion types for longevity.

:fruitfly_pooledunverifiedPooled BaselineDBDA2 Ch 19
Longevity ~ 1

Pooled / no-group baseline model for longevity; comparison model with no companion-type structure.

:fruitfly_robustunverifiedRobust ANOVA with Heterogeneous SigmaDBDA2 Ch 19
bf(Longevity ~ 0 + CompanionNumber, sigma ~ 0 + CompanionNumber)

Robust ANOVA with group-specific means AND sigmas; student-t family for outlier robustness.

:fruitfly_ancovaunverifiedANCOVA with Thorax CovariateDBDA2 Ch 19
Longevity ~ 1 + thorax_c + (1 | CompanionNumber)

ANCOVA controlling for thorax length; thorax_c = centered Thorax; common slope across companion groups.

:fruitfly_anhecovaunverifiedANHECOVA with Random Thorax SlopeDBDA2 Ch 19
Longevity ~ 1 + thorax_c + (1 + thorax_c | CompanionNumber)

ANHECOVA with random slope for thorax length per companion group; allows group-specific relationship between body size and longevity.

Guber 19993

:guber1999_baseunverifiedBase Multiple RegressionDBDA2 Ch 18
satt_z ~ 1 + spend_z + prcnt_take_z

Multiple regression of SAT score on spending and percent taking SAT; percent taking is a suppressor variable.

:guber1999_complementunverifiedComplement Proportion PredictorDBDA2 Ch 18
satt_z ~ 0 + Intercept + spend_z + prcnt_take_z + prop_not_take_z

Adds complementary proportion (propnottakez = 1 - prcnttake); explicit centering via 0 + Intercept.

:guber1999_interactionunverifiedInteraction TermDBDA2 Ch 18
satt_z ~ 1 + spend_z + prcnt_take_z + interaction_z

Adds interactionz = spendz * prcnttakez (standardized product); student-t for robustness.

Hair-Eye Color2

:haireye_poissonunverifiedPoisson Log-LinearDBDA2 Ch 24
Count ~ 1 + (1 | Hair) + (1 | Eye) + (1 | Hair:Eye)

Poisson log-linear model with main effects and interaction as random effects; models 4×4 contingency table.

:haireye_binomialunverifiedBinomial VersionDBDA2 Ch 24
Count | trials(264) ~ 1 + (1 | Hair) + (1 | Eye) + (1 | Hair:Eye)

Binomial version of the 4×4 hair-eye contingency table; trials(264) = total N; same random-effects structure as Poisson variant.

Happiness and Assets1

:happiness_assetsunverifiedCumulative Ordinal ProbitDBDA2 Ch 23
Happiness ~ 1 + Assets_s

Cumulative ordinal probit with standardized assets as predictor; Assets_s = (Assets - mean) / sd.

Hierarchical Linear Regression1

:hier_linregunverifiedVarying Intercepts and SlopesDBDA2 Ch 17
y_z ~ 1 + x_z + (1 + x_z || Subj)

Hierarchical model with varying intercepts and slopes per subject; || = uncorrelated random effects; z-standardized predictors.

Simple Linear Regression1

:htwtunverifiedHeight Predicts WeightDBDA2 Ch 17
weight_z ~ 1 + height_z

Simple linear regression with z-standardized predictors; student-t family for robustness. Uses n=300 adults.

Htwt1103

:htwt110_singleunverifiedSingle Predictor (Weight)DBDA2 Ch 21
male ~ 1 + weight_z

Logistic regression predicting sex from standardized weight; single metric predictor.

:htwt110_two_predunverifiedTwo Predictors (Weight and Height)DBDA2 Ch 21
male ~ 1 + weight_z + height_z

Logistic regression with two metric predictors; collinear but jointly informative for predicting sex.

:htwt110_robustunverifiedMixture with GuessingDBDA2 Ch 21
bf(male ~ a * 0.5 + (1 - a) * 1 / (1 + exp(-(b0 + b1 * weight_z))), a + b0 + b1 ~ 1, nl = TRUE)

Robust nonlinear logistic model; a = probability of guessing (mixture weight); identity link; estimated via nl = TRUE.

Income by Family Size1

:income_famsizeunverifiedMeasurement-Error ModelDBDA2 Ch 17
median_income_z | se(se_z, sigma = TRUE) ~ 1 + family_size_z + I(family_size_z^2) + (1 + family_size_z + I(family_size_z^2) || State)

Measurement-error model via | se(); quadratic trend in family size; state-level random slopes. Accounts for known standard error in the outcome.

Movie Ratings1

:moviesunverifiedCumulative Ordinal RegressionDBDA2 Ch 23
Rating ~ 1 + Year_s + Length_s

Cumulative ordinal regression; Year and Length standardized to Year_s and Length_s.

Ordinal Probit3

:ordinal_probit_interceptunverifiedIntercept OnlyDBDA2 Ch 23
Y ~ 1

Intercept-only ordinal probit model; thresholds estimated with cumulative family and no predictors.

:ordinal_probit_discunverifiedDiscrimination ParameterDBDA2 Ch 23
bf(Y ~ 1 + X) + lf(disc ~ 0 + X, cmc = FALSE)

Ordinal model with discrimination parameter; disc controls category spacing and varies with X; lf() submodel.

:ordinal_probit_heterounverifiedHeteroscedastic Gaussian ComparisonDBDA2 Ch 23
bf(Y ~ 0 + X, sigma ~ 0 + X)

Heteroscedastic Gaussian comparison model; sigma varies with X; alternative to ordinal family.

Binomial Recall2

:recall_conditionsunverifiedSeparate Probability per ConditionDBDA2 Ch 12synthetic
n_recalled | trials(20) ~ 0 + condition

Separate binomial recall probability per condition; no intercept centering. Six conditions with distinct true probabilities.

:recall_pooledunverifiedPooled Single InterceptDBDA2 Ch 12synthetic
n_recalled | trials(20) ~ 1

Pooled single intercept model for memory recall; baseline / comparison model ignoring condition differences.

Salary2

:salary_anovaunverifiedTwo-Way Random Effects ANOVADBDA2 Ch 20
Salary ~ 1 + (1 | Pos) + (1 | Org) + (1 | Pos:Org)

Two-way random effects ANOVA with interaction; Gaussian family; partial pooling across positions and organizations.

:salary_robustunverifiedRobust ANOVA with Heterogeneous Residual VarianceDBDA2 Ch 20
bf(Salary ~ 1 + (1 | Pos) + (1 | Org) + (1 | Pos:Org), sigma ~ 1 + (1 | Pos:Org))

Robust variant of salary ANOVA with heterogeneous residual variance per cell (Pos:Org); student-t family.

Softmax4

:softmax_categoricalunverifiedCategorical Regression with Two PredictorsDBDA2 Ch 22
Y ~ 0 + Intercept + X1 + X2

Categorical/softmax regression with separate intercept per category; categorical family.

:softmax_baselineunverifiedIntercepts-Only BaselineDBDA2 Ch 22
Y ~ 1

Intercepts-only softmax model; estimates baseline probability per category with no predictors.

:condlog1_ordinalunverifiedOrdinal Regression (Data Set 1)DBDA2 Ch 22
Y_ord ~ 1 + cs(X1) + cs(X2)

Sequential ordinal regression with category-specific slopes via cs(); sratio family. First conditional logistic dataset.

:condlog2_ordinalunverifiedOrdinal Regression (Data Set 2)DBDA2 Ch 22
Y_ord ~ 1 + cs(X1) + cs(X2)

Sequential ordinal regression with category-specific slopes via cs(); sratio family. Second conditional logistic dataset.

Split-Plot ANOVA2

:splitplot_fieldunverifiedWith Field BlockingDBDA2 Ch 20
Yield ~ 1 + (1 | Till) + (1 | Fert) + (1 | Field) + (1 | Till:Fert)

Split-plot ANOVA with tillage × fertilizer interaction plus blocking on Field.

:splitplot_nofieldunverifiedWithout Field BlockingDBDA2 Ch 20
Yield ~ 1 + (1 | Till) + (1 | Fert) + (1 | Till:Fert)

Split-plot ANOVA without explicit field blocking; comparison model to assess the contribution of the field random effect.

Hierarchical Bernoulli1

:therapeutic_touchunverifiedTherapeutic TouchDBDA2 Ch 9
y ~ 1 + (1 | s)

Hierarchical Bernoulli model with partial pooling across 28 healers; logit link.

Two-Group IQ2

:two_group_iq_baselineunverifiedSingle-Group BaselineDBDA2 Ch 16
Score ~ 1

Single-group Gaussian model on IQ scores; prior-predictive / baseline before conditioning on group.

:two_group_iq_heterounverifiedHeteroscedastic GroupsDBDA2 Ch 16
bf(Score ~ 0 + Group, sigma ~ 0 + Group)

Two groups with group-specific mean AND sigma; student-t family for robustness against outliers.

Coin-Flip1

:z15n50unverifiedBernoulli InterceptDBDA2 Ch 8synthetic
y ~ 1

Intercept-only Bernoulli model; identity link estimates p directly from 50 trials with 15 successes.

Coin-Flip1

:z6n8z2n7unverifiedTwo-Mint Separate InterceptsDBDA2 Ch 8synthetic
y ~ 0 + s

Separate Bernoulli intercept per mint; no intercept centering. Mint 1: 6/8 heads, mint 2: 2/7.

:burkner_papers — Bürkner JSS 2017 + R Journal 2018 14

Epileptic Seizure Counts3

:epilepsy_baseunverifiedPoisson GLMMJSS 2017
count ~ zBase * Trt + (1 | patient)

Poisson GLMM; interaction of standardised baseline × treatment; random patient intercept.

:epilepsy_truncunverifiedTruncated PoissonJSS 2017
count | trunc(ub = 104) ~ zBase * Trt + (1 | patient)

Same Poisson GLMM with upper truncation at 104 (the maximum possible count per visit).

:epilepsy_simpleunverifiedSimplified Main EffectsJSS 2017
count ~ Trt + (1 | patient)

Simplified main-effects Poisson; omits baseline covariate; comparison model.

Fish Counts2

:fish_rj_poissonunverifiedPoisson BaselineRJ 2018
count ~ persons + child + camper

Poisson model for fishing trip catch counts; no zero-inflation component.

:fish_rj_zipunverifiedZero-Inflated PoissonRJ 2018
bf(count ~ persons + child + camper, zi ~ child)

Zero-inflated Poisson; zi sub-model predicts structural-zero probability from child.

Hetero Jss2

:hetero_jss_sigmaunverifiedGroup-Specific SigmaJSS 2017
bf(y ~ x, sigma ~ 0 + x)

Gaussian with group-specific sigma; the sub-formula sigma ~ 0 + x models log(sigma) as a function of x.

:hetero_jss_quantileunverifiedAsymmetric LaplaceJSS 2017
bf(y ~ x, quantile = 0.25)

Bayesian quantile regression at the 25th percentile using an asymmetric Laplace distribution.

Inhaler Ordinal Ratings1

:inhalerunverifiedSequential Ratio ModelJSS 2017
rating ~ period + carry + cs(treat)

Sequential ratio ordinal model; cs() = category-specific coefficient for treat; sratio("logit") family estimates P(Y > k | Y ≥ k) at each threshold.

Kidney Recurrence Times1

:kidneyunverifiedLognormal SurvivalJSS 2017
time | cens(censored) ~ age * sex + disease + (1 | patient)

Lognormal survival model; cens() handles right-censored observations; random intercept per patient accounts for within-patient correlation between two kidneys.

Nonlinear Loss Development1

:loss_rjunverifiedWeibull CurveRJ 2018
bf(cum ~ ult * (1 - exp(-(dev/theta)^omega)), ult ~ 1 + (1 | AY), omega ~ 1, theta ~ 1, nl = TRUE)

Weibull loss development curve; ult (ultimate loss) varies by accident year; omega = shape, theta = scale; nl = TRUE enables the nonlinear formula.

Multiple Membership Model2

:multi_member_equalunverifiedEqual WeightsRJ 2018
y ~ 1 + (1 | mm(s1, s2))

Equal-weight multiple membership; student outcome depends equally on two schools.

:multi_member_weightedunverifiedWeightedRJ 2018
y ~ 1 + (1 | mm(s1, s2, weights = cbind(w1, w2)))

Weighted multiple membership; w1 + w2 = 1 for each student; weights the school random effects by the time spent at each school.

Munich Rent Data2

:rent99_splineunverifiedTensor-Product SplineRJ 2018
rentsqm ~ t2(area, yearc) + (1 | district)

Tensor-product spline of area × construction year; random intercept per district.

:rent99_distrunverifiedDistributional Smooth RegressionRJ 2018
bf(rentsqm ~ t2(area, yearc) + (1 | ID1 | district), sigma ~ t2(area, yearc) + (1 | ID1 | district))

Distributional model: both mean and log(sigma) are smooth functions; ID1 label allows correlation between the two sets of district random effects.

:action_models — ActionModels.jl (ComputationalPsychiatry) 6

PVL-Delta × IGT4

:pvl_igt_lrunverifiedLearning Rate vs. Clinical Group
learning_rate ~ clinical_group + (1 | subjID)

Population-level hierarchical regression of the PVL-Delta learning rate (α ∈ [0,1]) on clinical group (healthy controls, heroin, amphetamine) in the Iowa Gambling Task. (1|subjID) models within-subject random intercepts across trials. Transformed via logistic link; LogitNormal prior on regression coefficients.

:pvl_igt_rewardunverifiedReward Sensitivity vs. Clinical Group
reward_sensitivity ~ clinical_group + (1 | subjID)

Population-level hierarchical regression of prospect-theoretic reward sensitivity (A ∈ [0,1], power parameter in utility transformation u = |r|^A) on clinical group in the Iowa Gambling Task. LogitNormal prior; logistic link.

:pvl_igt_lossunverifiedLoss Aversion vs. Clinical Group
loss_aversion ~ clinical_group + (1 | subjID)

Population-level hierarchical regression of loss aversion weight (w ∈ [0,∞], scales negative prospect values as -w·|loss|^A) on clinical group in the Iowa Gambling Task. Exponential link; LogNormal prior on regression coefficients.

:pvl_igt_noiseunverifiedAction Noise vs. Clinical Group
action_noise ~ clinical_group + (1 | subjID)

Population-level hierarchical regression of the softmax inverse temperature (β ∈ [0,∞]; higher → more deterministic deck choice) on clinical group in the Iowa Gambling Task. Exponential link; LogNormal prior on regression coefficients.

Rescorla-Wagner × JGET2

:rw_jget_lrunverifiedLearning Rate vs. Delusional Ideation
learning_rate ~ 1 + pdi_total + session + (1 | ID)

Population-level hierarchical regression of the Rescorla-Wagner learning rate (α) on Peters Delusions Inventory (PDI) total score and session number. (1|ID) captures between-subject variability. α is constrained to [0,1] via logistic transformation; regression prior: Normal(0, 0.5) on PDI coefficient.

Note: learning_rate is a latent parameter estimated by running ActionModels on the trial-level JGET data before this regression is applied.

:rw_jget_noiseunverifiedAction Noise vs. Delusional Ideation
action_noise ~ 1 + pdi_total + session + (1 | ID)

Population-level hierarchical regression of the Rescorla-Wagner action noise (β, response standard deviation) on PDI score and session. (1|ID) captures subject-level variability. β is unconstrained (exponential link); prior: Normal(0, 0.3) on intercept.

:epidist — epidist (Epinowcast Community) 2

Delay Distribution2

:delay_naiveunverifiedNaive Lognormal (No Bias Correction)
delay | weights(n) ~ 1

Naive lognormal regression for delay distribution estimation (e.g. symptom onset to case notification). Does not account for interval censoring or right truncation of secondary events, producing estimates biased toward shorter delays. The sigma sub-model (sigma ~ 1) estimates the lognormal standard deviation on the log scale. Baseline model; compare with :delay_marginal.

:delay_marginalunverifiedMarginal Lognormal (Censoring + Truncation Corrected)
delay_lwr | weights(n) + vreal(relative_obs_time, pwindow, swindow, delay_upr) ~ 1

Marginal lognormal model correcting for double interval censoring (primary and secondary event times observed only within daily windows) and right truncation (only cases with secondary event before obs_time are observable). Uses a custom marginal_lognormal brms family implemented via the primarycensored Stan library.

vreal() passes auxiliary real-valued data to the custom likelihood: observation cutoff, primary censoring window, secondary censoring window, and upper delay bound. The likelihood integrates over primary event time within the censoring window.

:epinowcast — epinowcast + baselinenowcast 6

Epinowcast2

:enw_age_referenceunverifiedAge-Stratified Hierarchical Delays
enw_expectation(~0 + (1|day_of_week) + (1|day:.group)) + enw_reference(~1 + (1|age_group)) + enw_report(~(1|day_of_week))

Hierarchical nowcast jointly modeling three age strata. enw_expectation(...) includes day-of-week and daily random effects per group (.group notation). enw_reference(~1 + (1|age_group)) allows lognormal delay parameters to vary by age group via partial pooling. enw_report(...) accounts for weekend reporting dips shared across groups.

:enw_age_week_referenceunverifiedTime-Varying Delay with Weekly Random Walk by Age Group
enw_expectation(~0 + (1|day_of_week) + (1|day:.group)) + enw_reference(~1 + (1|age_group) + rw(week, by=age_group)) + enw_report(~(1|day_of_week))

Extends :enw_age_reference with time-varying delay: rw(week, by=age_group) adds a weekly random walk on delay parameters independently per age group, capturing temporal changes in testing and reporting practices (e.g., shifts in test positivity or lab capacity) that affect different age groups differently.

Epinowcast3

:enw_basicunverifiedBasic: Geometric Random Walk + Lognormal Delay
enw_expectation(~0 + (1|day)) + enw_reference(~1, dist='lognormal')

Default epinowcast model for nowcasting right-truncated hospitalization counts. enw_expectation(~0 + (1|day)) models expected final counts via a geometric random walk (daily random intercepts on the log scale). enw_reference(~1, dist='lognormal') fits a static lognormal delay distribution shared across all reference dates. Negative-binomial observation model with overdispersion parameter φ.

:enw_report_dowunverifiedReport Day-of-Week Effects
enw_expectation(~0 + (1|day)) + enw_reference(~1, dist='lognormal') + enw_report(~(1|day_of_week))

Extends the basic model with a non-parametric report date effect: enw_report(~(1|day_of_week)) adds random intercepts for day of the week of the report date, capturing systematic under-reporting on weekends. All other components identical to :enw_basic.

:enw_np_referenceunverifiedNon-parametric Hazard Delay Model
enw_expectation(~0 + (1|day)) + enw_reference(parametric=~0, non_parametric=~0+delay)

Replaces the parametric lognormal delay with a fully non-parametric discrete-time hazard model. enw_reference(parametric=~0, non_parametric=~0+delay) estimates a separate baseline hazard for each delay value using a Cox proportional hazards formulation. More flexible than lognormal; useful when the delay distribution is multi-modal or irregular.

Epinowcast1

:enw_rt_renewalunverifiedRenewal Process with Rt Estimation
enw_expectation(r=~1+rw(week), generation_time=gt_pmf, observation=~1+(1|day_of_week)) + enw_reference(~1, dist='lognormal')

Mechanistic renewal-process expectation model that jointly nowcasts and estimates the instantaneous reproduction number Rₜ. r=~1+rw(week) specifies a weekly random walk on log(Rₜ). generation_time=gt_pmf provides a fixed discretised generation time PMF (Gamma-derived). observation=~1+(1|day_of_week) models day-of-week ascertainment variation. enw_reference(~1, dist='lognormal') fits a static lognormal reporting delay.

:rstanarm — rstanarm vignettes 22

MLB Batting 19703

:bball_pooledunverifiedComplete Pooling
cbind(Hits, AB - Hits) ~ 1

Complete-pooling estimate: single shared batting-average parameter for all 18 players. Binomial / logit. Compare with :bball_nopooling and :bball_partial.

:bball_nopoolingunverifiedNo Pooling
cbind(Hits, AB - Hits) ~ 0 + Player

No-pooling model: independent intercept per player, no shrinkage. Binomial / logit.

:bball_partialunverifiedPartial Pooling (Hierarchical)
cbind(Hits, AB - Hits) ~ (1|Player)

Hierarchical shrinkage model: player-level random intercepts partially pool estimates toward the population mean. stan_glmer / Binomial / logit. The rstanarm pooling vignette shows this recovers end-of-season averages better than either complete or no pooling.

Bovine Pleuropneumonia1

:cbpp_glmmunverifiedBinomial GLMM
cbind(incidence, size - incidence) ~ size + period + (1|herd)

Canonical stan_glmer example from the rstanarm mixed effects vignette. Herd-level random intercept for disease incidence across 4 time periods. Binomial / logit.

Blood Clotting Time1

:clotting_gammaunverifiedGamma GLM
clot_time ~ log_plasma * lot_id

stan_glm with Gamma family and inverse link, modelling blood clotting time as a function of log plasma concentration, thromboplastin lot, and their interaction. Classic Dobson (2002) §9.2 example.

Cloud Seeding1

:clouds_lmunverifiedRegularized Linear Model (R² Prior)
rainfall ~ seeding * (sne + cloudcover + prewetness + echomotion) + time

stan_lm with an R² prior on explained variance. Full interaction model of cloud-seeding conditions. Gaussian family, identity link.

Esophageal Cancer1

:esoph_polrunverifiedOrdinal Logistic Regression
tobgp ~ agegp + alcgp

stan_polr proportional-odds model of tobacco consumption group as a function of age and alcohol group. Ordered logistic.

Gasoline Yield2

:gasoline_betaunverifiedBeta Regression (Mean Only)
yield ~ gravity + pressure + temp10 + batch

stan_betareg for proportion outcome (0–1): fraction of crude oil converted to gasoline as a function of API gravity, vapor pressure, vaporization temperature, and batch factor. Beta / logit (mean), constant precision.

:gasoline_beta_distrunverifiedDistributional Beta Regression
yield ~ gravity + pressure + temp10 + batch | gravity + pressure

Extends :gasoline_beta by modelling precision (phi) as a function of gravity and pressure. The | separator follows the betareg/rstanarm distributional formula interface. Beta / logit (mean) + log (precision).

Child IQ4

:kidiq_hsunverifiedMaternal High-School Status
kid_score ~ mom_hs

Baseline Gaussian model regressing child cognitive score on whether the mother completed high school. Demonstrates default weakly-informative priors.

:kidiq_iqunverifiedMaternal IQ
kid_score ~ mom_iq

Regresses child test score on continuous maternal IQ; single continuous predictor. Gaussian / identity.

:kidiq_bothunverifiedMaternal High-School Status and IQ
kid_score ~ mom_hs + mom_iq

Additive model combining both maternal predictors. Gaussian / identity.

:kidiq_interactionunverifiedMaternal High-School × IQ Interaction
kid_score ~ mom_hs * mom_iq

Full interaction; the slope of maternal IQ on child score is allowed to differ by high-school completion status. Gaussian / identity.

Motor Trend Cars1

:mtcars_lmunverifiedGaussian Linear Model
mpg ~ wt + am

stan_glm with default weakly-informative priors (autoscaled Normal). Demonstrates how rstanarm's prior autoscaling adapts to predictor scale. Gaussian family, identity link.

Urban Roaches2

:roaches_poissonunverifiedPoisson Count Model
y ~ roach1 + treatment + senior + offset(log(exposure2))

stan_glm Poisson regression for post-treatment roach trap counts, controlling for pre-treatment baseline and senior-housing status. Trap-exposure days enter as a log offset. Poisson / log.

:roaches_nbunverifiedNegative Binomial Count Model
y ~ roach1 + treatment + senior + offset(log(exposure2))

Same predictors as :roaches_poisson but with the negative binomial family to accommodate overdispersion and excess zeros. stan_glm.nb / log.

Rat Weight Gain2

:weightgain_anovaunverifiedBayesian ANOVA (R² Prior)
weightgain ~ source * type

stan_aov two-way factorial model with R² prior on variance explained by the protein source × protein level interaction. Gaussian / identity.

:weightgain_reunverifiedFactors as Random Effects
weightgain ~ 1 + (1|source) + (1|type) + (1|source:type)

stan_lmer refit treating the factorial structure as nested random intercepts, illustrating partial pooling across factor levels. Gaussian / identity.

Bangladesh Wells2

:wells_distunverifiedLogistic (Distance Only)
switch ~ dist100

stan_glm logistic regression of household well-switching on distance to the nearest safe well (in units of 100 metres). Binomial / logit.

:wells_bothunverifiedLogistic (Distance + Arsenic)
switch ~ dist100 + arsenic

Adds arsenic level of the current well as a second predictor for switching. Binomial / logit.

Women's Role Survey2

:womensrole_logitunverifiedLogistic Regression
cbind(agree, disagree) ~ education + sex

stan_glm binomial model of survey agreement with gender-role statements as a function of education and respondent sex. Grouped binomial with logit link.

:womensrole_quadunverifiedLogistic with Quadratic Education
cbind(agree, disagree) ~ education + I(education^2) + sex

Extends the linear education model with a quadratic term to capture diminishing effects at higher education levels. Binomial / logit.

:vasishth — Bayesian Data Analysis for Cognitive Science 20

Contrast Coding3

:contrasts1_treatmentunverifiedTreatment ContrastCh 6
DV ~ F

Factor as predictor; treatment contrast by default (reference level = "A").

:contrasts1_cellmeansunverifiedCell-Means ParameterizationCh 6
DV ~ -1 + F

Cell-means parameterization; no global intercept; each level gets its own mean.

:contrasts1_monotonicunverifiedMonotonic EffectCh 6
DV ~ 1 + mo(F)

Monotonic effect; F treated as ordered categorical; mo() constrains the effect to be monotonically increasing or decreasing across levels.

2×2 Factorial3

:contrasts2x2_factorialunverifiedFull Factorial ModelCh 7
DV ~ A * B

Full factorial Gaussian model: main effects of A and B plus A×B interaction.

:contrasts2x2_nestedunverifiedNested ModelCh 7
DV ~ B / A

A nested in B; A effects estimated separately within each level of B.

:contrasts2x2_logisticunverifiedLogistic RegressionCh 7
pDV ~ A * B

Bernoulli(logit) regression; 2×2 factorial design with binary outcome pDV.

Individual Differences2

:indiv_diff_naiveunverifiedNaive OLSCh 11
mean_rspeed ~ c_mean_pcu

Naive OLS ignoring measurement error in both predictor and response; biased estimates.

:indiv_diff_meunverifiedMeasurement Error ModelCh 11
mean_rspeed | resp_se(se_rspeed, sigma = TRUE) ~ me(c_mean_pcu, se_pcu)

Measurement error in both response and predictor; me() propagates predictor uncertainty; resp_se() propagates response uncertainty and adds residual sigma.

Meta-Analysis1

:meta_sbiunverifiedRandom Effects ModelCh 11
effect | resp_se(SE, sigma = FALSE) ~ 1 + (1 | study_id)

resp_se() passes known measurement error; sigma = FALSE fixes residual SD to 0; random study intercept captures between-study heterogeneity τ.

N400 EEG4

:n400_uncorrunverifiedUncorrelated Varying SlopesCh 5
n400 ~ c_cloze + (c_cloze || subj)

Varying intercepts and slopes for subjects, uncorrelated; || suppresses the correlation parameter between intercept and slope.

:n400_corrunverifiedCorrelated Varying SlopesCh 5
n400 ~ c_cloze + (c_cloze | subj)

Varying intercepts and correlated slopes for subjects; | estimates the intercept–slope correlation.

:n400_crossedunverifiedCrossed Random EffectsCh 5
n400 ~ c_cloze + (c_cloze | subj) + (c_cloze | item)

Crossed random effects for subjects and items; both have varying intercepts and slopes.

:n400_distrunverifiedDistributional Model for SigmaCh 5
bf(n400 ~ c_cloze + (c_cloze | subj) + (c_cloze | item), sigma ~ 1 + (1 | subj))

Distributional model: residual sigma modeled with a subject-level random intercept, allowing between-subject variability in residual spread.

Hierarchical Pooling3

:pooling_partialunverifiedPartial PoolingCh 5
y ~ 1 + (1 | subj)

Hierarchical / partial pooling; adaptive shrinkage across subjects.

:pooling_completeunverifiedComplete PoolingCh 5
y ~ 1

Complete pooling; single intercept ignoring subject identity.

:pooling_noneunverifiedNo PoolingCh 5
y ~ 0 + factor(subj)

No pooling; one intercept per subject; cell-means parameterization.

Pupil Dilation Experiment1

:pupilunverifiedGaussian RegressionCh 4
p_size ~ 1 + c_load

Gaussian regression; higher cognitive load → larger pupil dilation.

Working Memory Recall Accuracy1

:recall_wmunverifiedLogistic RegressionCh 4
correct ~ 1 + c_set_size

Bernoulli(logit) regression; set-size effect on recall accuracy.

Spacebar-Pressing Response Times1

:spacebarunverifiedLognormal RegressionCh 4
t ~ 1 + c_trial

Lognormal regression; practice effect: RT decreases linearly on log scale.

Stroop Task1

:stroopunverifiedLognormal Varying-Slopes ModelCh 5
RT ~ c_cond + (c_cond | subj)

Lognormal regression; varying intercepts and correlated slopes per subject; Stroop congruence effect estimated per subject.

:bmm — bmm — Bayesian Measurement Models 4

Color Wheel Mixture2

:mixture2p_setsizeunverifiedTwo-Parameter Mixture Model (Set Size Effects)
thetat ~ 0 + set_size + (0 + set_size | id); kappa ~ 0 + set_size + (0 + set_size | id)

Two-parameter mixture model for continuous report working memory data (Bays et al. 2009). The response error is decomposed into:

  • A von Mises (on-target memory) component with concentration kappa

  • A uniform (guessing) component with probability 1 − inv_logit(thetat)

Both thetat (log-odds of remembering) and kappa (von Mises concentration, log scale) are regressed on set size with by-participant random slopes. The 0 + set_size intercept-free parameterisation gives one coefficient per set-size level (treatment of set_size as factor).

bmm model spec: mixture2p(resp_error = "error")

:mixture3p_setsizeunverifiedThree-Parameter Mixture Model (Non-Target Swaps)
thetat ~ 0 + set_size + (0 + set_size | id); thetant ~ 0 + set_size + (0 + set_size | id); kappa ~ 0 + set_size + (0 + set_size | id)

Three-parameter mixture model extending mixture2p with a non-target swap component (Bays et al. 2009). The response error is a mixture of:

  • Von Mises centred on the target (memory; thetat, kappa)

  • Von Mises centred on a randomly selected non-target (swap; thetant, same kappa)

  • Uniform (guessing)

thetant captures log-odds of swapping to a non-target. Requires non-target feature angles (non_target_1non_target_5) and set_size.

bmm model spec: mixture3p(resp_error="error", nt_features=paste0("non_target_",1:5), set_size="set_size")

IMM Full1

:imm_full_conditionunverifiedInterference Measurement Model (All Four Parameters)
c ~ 0 + cond; a ~ 0 + cond; s ~ 0 + cond; kappa ~ 0 + cond

Full Interference Measurement Model (Oberauer & Lin 2017) with all four parameters varying across two conditions:

  • c — baseline memory strength (item activation)

  • a — associative activation (binding strength)

  • s — spatial similarity gradient (spread of interference)

  • kappa — von Mises precision (log scale)

Each parameter gets one coefficient per condition via 0 + cond. Non-target feature angles (color_item2color_item5) and spatial distances (dist_item2dist_item5) enter the likelihood directly (not as predictors in the formula).

bmm model spec: imm(resp_error="resp_error", nt_features=paste0("color_item",2:5), set_size="set_size", nt_distances=paste0("dist_item",2:5), version="full")

SDM1

:sdm_conditionunverifiedSignal Discrimination Model (Condition Effects)
c ~ 0 + cond; kappa ~ 0 + cond

Signal Discrimination Model (Oberauer 2023) fit to a three-condition continuous report experiment. The SDM represents memory as a signal on a circular space; the response reflects discrimination between a memory trace and noise.

c (memory strength, real-valued) and kappa (precision, log scale) each receive one coefficient per condition via 0 + cond. The model uses a custom circular-normal likelihood implemented via brms stanvar().

bmm model spec: sdm(resp_error = "y")

:flocker — flocker — Bayesian Occupancy Models 6

Data-Augmented Occupancy1

:augmented_multispeciesunverifiedSpecies Richness Estimation
occ: ~ (1 | ff_species); det: ~ uc1 + ec1 + (1 + uc1 + ec1 | ff_species)

Data augmentation approach for estimating total species richness from incomplete sampling. The dataset includes 50 observed species plus 50 pseudospecies (all-zero detection histories); the occupancy probability of pseudospecies reflects the probability that an unobserved species is actually present.

ff_species is flocker's reserved grouping keyword for species in augmented models. Occupancy random intercept by species captures species-level variation in commonness; detection random slopes by species capture variation in detectability.

flocker call: flock(f_occ=~(1|ff_species), f_det=~uc1+ec1+(1+uc1+ec1|ff_species), flocker_data=fd, augmented=TRUE)

Autologistic Occupancy1

:autologistic_equilibriumunverifiedEquilibrium Initial Occupancy
det: ~ uc1 + ec1; col: ~ uc1; auto: ~ 1

Autologistic dynamic occupancy model: colonisation and persistence share predictor structure; a constant logit-scale offset (auto: ~ 1) is added to persistence probability relative to colonisation. Initial occupancy at equilibrium.

multiseason = "autologistic", multi_init = "equilibrium" in flocker. The autologistic formulation is more parsimonious than explicit colex when persistence and colonisation share the same predictors.

flocker call: flock(f_det=~uc1+ec1, f_col=~uc1, f_auto=~1, flocker_data=fd, multiseason="autologistic", multi_init="equilibrium")

Colonisation-Extinction2

:colex_explicitunverifiedExplicit Initial Occupancy
occ: ~ uc1; det: ~ uc1 + ec1; col: ~ uc1; ex: ~ uc1

Dynamic (multi-season) colonisation-extinction occupancy model with explicit estimation of initial occupancy. Four sub-models:

  • occ — initial occupancy at season 1 (log-odds)

  • det — detection given presence (log-odds; with event covariate)

  • col — colonisation probability (log-odds): unoccupied sites becoming occupied

  • ex — extinction probability (log-odds): occupied sites becoming unoccupied

multi_init = "explicit" in flocker: initial occupancy estimated freely.

flocker call: flock(f_occ=~uc1, f_det=~uc1+ec1, f_col=~uc1, f_ex=~uc1, flocker_data=fd, multiseason="colex", multi_init="explicit")

:colex_equilibriumunverifiedEquilibrium Initial Occupancy
det: ~ uc1 + ec1; col: ~ uc1; ex: ~ uc1

Dynamic colonisation-extinction occupancy model where initial occupancy is derived from the colonisation/extinction equilibrium rather than estimated as a free parameter. No occ sub-model; initial occupancy = col / (col + ex).

multi_init = "equilibrium" in flocker. Reduces parameters and enforces stationarity of the occupancy process.

flocker call: flock(f_det=~uc1+ec1, f_col=~uc1, f_ex=~uc1, flocker_data=fd, multiseason="colex", multi_init="equilibrium")

Single-Season Occupancy2

:single_season_repvaryingunverifiedMulti-Species with Event Covariates
occ: ~ uc1 + (1 + uc1 | species); det: ~ uc1 + ec1 + (1 + uc1 + ec1 | species)

Single-season multi-species occupancy model with site-level (uc1) and visit-level (ec1) covariates.

  • occ sub-model: log-odds of occupancy at a site; uc1 as fixed slope and random slope by species.

  • det sub-model: log-odds of detection given presence; both uc1 and the event-varying ec1 with random slopes by species.

Species-level random effects pool information across the 10 species. The model returns a brmsfit object; all brms post-processing tools apply.

flocker call: flock(f_occ = ~ uc1 + (1 + uc1 | species), f_det = ~ uc1 + ec1 + (1 + uc1 + ec1 | species), flocker_data = fd)

:single_season_repconstantunverifiedMulti-Species, No Event Covariates
occ: ~ uc1 + (1 + uc1 | species); det: ~ uc1 + (1 + uc1 | species)

Single-season multi-species occupancy model with only site-level (uc1) covariates in both occupancy and detection sub-models (no event-varying covariate). Detection probability is constant across visits within a site, enabling an efficient "rep-constant" parameterisation in flocker.

flocker call: flock(f_occ = ~ uc1 + (1 + uc1 | species), f_det = ~ uc1 + (1 + uc1 | species), flocker_data = fd, rep_constant = TRUE)

:mvgam — mvgam — Multivariate Dynamic GAMs 6

N-Mixture1

:nmix_detectionunverifiedSmooth Detection and Abundance Sub-Models
obs: y ~ s(det_cov, k = 4) + s(det_cov2, k = 4) | trend: ~ s(abund_cov, k = 4) + s(abund_fac, bs = "re") [nmix()]

N-mixture model for imperfect detection with non-parametric smooth effects. The N-mixture likelihood jointly models the imperfect-detection observation process and the true abundance process.

  • obs formula: detection probability sub-model; smooth effects of two detection covariates

  • trend formula: latent abundance sub-model; smooth abundance covariate + hierarchical random effect for the categorical habitat factor

  • family = nmix(): N-mixture likelihood (Royle 2004)

Fit with: mvgam(y~s(det_cov,k=4)+s(det_cov2,k=4), trend_formula=~s(abund_cov,k=4)+s(abund_fac,bs="re"), family=nmix(), data=nmix_data)

Gaussian VAR1

:plankton_varunverifiedTensor-Product Environmental Smooths
obs: y ~ -1 | trend: ~ te(temp, month, k = c(4, 4)) + te(temp, month, k = c(4, 4), by = trend) - 1 [VAR(cor = TRUE)]

Vector Autoregressive (VAR) model for multivariate Gaussian plankton time series with correlated process errors. Environmental forcing (temperature × month tensor product) acts at the latent process level.

  • obs formula: no observation-level predictors

  • trend formula: shared tensor-product smooth te(temp, month, k=c(4,4)) plus species-specific deviations (by = trend); -1 removes intercept

  • trend_model = VAR(cor = TRUE): VAR with correlated cross-series innovations

The by = trend idiom in mvgam indexes each latent trend series, allowing species-specific environmental response curves.

Fit with: mvgam(y~-1, trend_formula=~te(temp,month,k=c(4,4))+te(temp,month,k=c(4,4),by=trend)-1, trend_model=VAR(cor=TRUE), family=gaussian(), data=plankton_train)

Portal Counts3

:portal_glm_reunverifiedHierarchical Year Random Effects
count ~ s(year_fac, bs = "re") - 1

Baseline Poisson GLM capturing inter-annual variation in rodent counts via hierarchical (random-effects) smooths on year. s(year_fac, bs = "re") - 1 is the mgcv notation for a random intercept per year level with no overall intercept. No explicit latent trend process.

Fit with: mvgam(count ~ s(year_fac, bs="re") - 1, family=poisson(), data=portal_train, trend_model="None")

:portal_ar_ndviunverifiedNDVI Smooth + AR(1) Latent Trend
obs: count ~ 1 | trend: ~ s(ndvi_ma12, k = 6) [AR()]

State-space Poisson model separating a smooth observation-level NDVI effect from a latent AR(1) trend process. The trend captures residual temporal autocorrelation not explained by the environmental covariate.

  • obs formula: intercept-only observation model

  • trend formula: smooth NDVI effect at the latent process level (k = 6 basis functions)

  • trend_model = AR(): AR(1) latent trend

Fit with: mvgam(count ~ 1, trend_formula = ~ s(ndvi_ma12, k=6), trend_model=AR(), family=poisson(), data=portal_train)

:portal_shared_trendunverifiedMulti-Series Seasonal AR(1)
obs: count ~ series - 1 | trend: ~ s(season, bs = "cc", k = 8) [AR()]

Multi-series Poisson model where all five species share a single latent AR(1) trend, with series-specific observation offsets and a cyclic seasonal spline at the trend level.

  • obs formula: series - 1 gives a species-specific intercept (fixed offset)

  • trend formula: cyclic cubic regression spline for seasonality (bs = "cc")

  • trend_model = AR() with trend_map forcing all series to share one trend

The shared-trend structure is specified via a trend_map data.frame passed separately to mvgam() mapping each series to the same latent trend index.

Fit with: mvgam(count~series-1, trend_formula=~s(season,bs="cc",k=8), trend_model=AR(), family=poisson(), data=portal_train, trend_map=trend_map)

Beta AR(1)1

:salmon_beta_arunverifiedTime-Varying Upwelling Effect on Salmon Survival
obs: survival ~ 1 | trend: ~ dynamic(CUI.apr, k = 25, scale = FALSE) - 1 [AR()]

Beta-distributed salmon survival proportions with an AR(1) latent trend and a time-varying effect of spring upwelling index (CUI.apr).

  • obs formula: intercept-only observation model (Beta family)

  • trend formula: dynamic(CUI.apr, k=25, scale=FALSE) makes the regression coefficient on upwelling a smooth function of time (random-walk basis with 25 knots)

  • trend_model = AR(): AR(1) latent process in addition to the TVP

The dynamic() function in mvgam fits a time-varying parameter (TVP) model where the coefficient evolves as a random walk or Hilbert-space GP over time.

Fit with: mvgam(survival~1, trend_formula=~dynamic(CUI.apr,k=25,scale=FALSE)-1, trend_model=AR(), family=betar(), data=salmon_train)

:lme4 — lme4 — Linear/Generalised Mixed Models (R) 8

CBPP1

:lme4_cbpp_glmmunverifiedBinomial GLMM (lme4 syntax)
cbind(incidence, size - incidence) ~ period + (1 | herd)

Binomial GLMM for CBPP incidence using lme4's matrix-response cbind syntax. Contrast with the brms equivalent: incidence | trials(size) ~ period + (1|herd).

glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
      family = binomial, data = cbpp)

Contraception1

:contraception_urbanunverifiedBinomial GLMM with Random Slopes
use ~ age + I(age^2) + livch + urban + (urban | district)

Binomial GLMM for contraception use with a random slope for urban within district — allowing the urban/rural gap to vary across districts. use is recoded from Y/N to integer 0/1.

glmer(use ~ age + I(age^2) + livch + urban + (urban | district),
      family = binomial, data = Contraception)

Dyestuff1

:dyestuff_reunverifiedMinimal Random-Intercept LMM
Yield ~ 1 + (1 | Batch)

The simplest possible LMM: grand-mean intercept plus a random intercept for each batch. Introductory example in Bates et al. (JSS 2015, §2).

lmer(Yield ~ 1 + (1 | Batch), data = Dyestuff)

Pastes1

:pastes_nestedunverifiedNested Random Effects
strength ~ (1 | batch/cask)

LMM with nested random effects. batch/cask expands to (1|batch) + (1|batch:cask); casks are identified locally within each batch, not globally.

lmer(strength ~ (1 | batch/cask), data = Pastes)

Penicillin1

:penicillin_crossedunverifiedCrossed Random Intercepts
diameter ~ 1 + (1 | plate) + (1 | sample)

LMM with two fully crossed random intercepts (plates and samples). Neither grouping factor is nested within the other.

lmer(diameter ~ 1 + (1 | plate) + (1 | sample), data = Penicillin)

Sleep Deprivation2

:sleepstudy_slopeunverifiedCorrelated Random Slopes
Reaction ~ Days + (Days | Subject)

LMM with correlated by-subject random slope and intercept for Days. (Days | Subject) fits one 2×2 random-effects covariance matrix per subject.

lmer(Reaction ~ Days + (Days | Subject), data = sleepstudy)
:sleepstudy_uncorrunverifiedUncorrelated Random Slopes
Reaction ~ Days + (Days || Subject)

LMM with uncorrelated by-subject random slope and intercept. (Days || Subject) constrains the off-diagonal covariance to zero (diagonal random-effects covariance matrix).

lmer(Reaction ~ Days + (Days || Subject), data = sleepstudy)

Verbal Aggression1

:verbagg_crossedunverifiedBernoulli GLMM, Crossed Random Effects
r2 ~ Anger + Gender + btype + situ + (1 | id) + (1 | item)

Bernoulli GLMM with two fully crossed random intercepts (subjects × items). r2 is recoded to integer 0/1 from Y/N.

glmer(r2 ~ Anger + Gender + btype + situ + (1|id) + (1|item),
      family = binomial, data = VerbAgg)

:mixed_models_jl — MixedModels.jl — Mixed Models (Julia) 7

Contraception1

:contraception_glmmunverifiedBernoulli GLMM with Polynomial Age
use ~ 1 + age + abs2(age) + livch + urban + (1 | district)

Bernoulli GLMM for contraception use in Bangladesh. MixedModels.jl uses abs2() (squaring function) inside @formula instead of R's I(age^2). use recoded from Y/N to integer 0/1.

fit(GeneralizedLinearMixedModel,
    @formula(use ~ 1 + age + abs2(age) + livch + urban + (1|district)),
    contraception, Bernoulli())

Dyestuff1

:dyestuff_reunverifiedMinimal Random-Intercept LMM
Yield ~ 1 + (1 | Batch)

The canonical introductory LMM in MixedModels.jl: one variance component for batch-to-batch variability, no fixed covariates.

fit(LinearMixedModel, @formula(Yield ~ 1 + (1 | Batch)), dyestuff)

Note: MixedModels.jl's bundled copy uses lowercase yield/batch; the Rdatasets CSV uses Yield/Batch.

Pastes1

:pastes_nestedunverifiedNested Random Effects
strength ~ 1 + (1 | batch/cask)

LMM with nested random effects: batch/cask expands to (1|batch) + (1|batch:cask). Cask labels are local to each batch.

fit(LinearMixedModel, @formula(strength ~ 1 + (1 | batch/cask)), pastes)

Penicillin1

:penicillin_crossedunverifiedCrossed Random Intercepts
diameter ~ 1 + (1 | plate) + (1 | sample)

LMM with two fully crossed random intercepts. Neither plate nor sample is nested within the other; both random intercepts appear additively.

fit(LinearMixedModel,
    @formula(diameter ~ 1 + (1 | plate) + (1 | sample)), penicillin)

Sleep Deprivation2

:sleepstudy_slopeunverifiedCorrelated Random Slopes
Reaction ~ 1 + Days + (1 + Days | Subject)

LMM with correlated by-subject random slope and intercept for Days. Idiomatic MixedModels.jl style writes explicit 1 + intercepts.

fit(LinearMixedModel, @formula(Reaction ~ 1 + Days + (1 + Days | Subject)), sleepstudy)
:sleepstudy_zerocorrunverifiedUncorrelated Random Slopes (zerocorr)
Reaction ~ 1 + Days + zerocorr(1 + Days | Subject)

Same as the correlated model but with the off-diagonal covariance forced to zero. MixedModels.jl uses zerocorr() instead of lme4's (x || g) syntax.

fit(LinearMixedModel,
    @formula(Reaction ~ 1 + Days + zerocorr(1 + Days | Subject)), sleepstudy)

Verbal Aggression1

:verbagg_crossedunverifiedBernoulli GLMM, Crossed Random Effects
r2 ~ 1 + Anger + Gender + btype + situ + (1 | id) + (1 | item)

Bernoulli GLMM with two crossed random intercepts (subjects × items). r2 recoded from Y/N to integer 0/1.

fit(GeneralizedLinearMixedModel,
    @formula(r2 ~ 1 + Anger + Gender + btype + situ + (1|id) + (1|item)),
    verbagg, Bernoulli())

:inla — R-INLA — INLA with f() random effects 12

Airline Passengers4

:airp_rw1unverifiedRandom Walk (RW1) Temporal Smoothing
log_y ~ 0 + f(t, model = 'rw1')

First-order random walk latent field on the time index t; the intercept is absorbed into the random walk (hence 0 +). Gaussian family. Equivalent to a Bayesian smoothing spline.

:airp_rw2unverifiedRandom Walk (RW2) Temporal Smoothing
log_y ~ 0 + f(t, model = 'rw2')

Second-order random walk; smoother than RW1, penalises second differences. Equivalent to cubic spline smoothing. Gaussian family.

:airp_ar1unverifiedAR(1) Temporal Process
log_y ~ 0 + f(t, model = 'ar1')

Latent AR(1) process over time. Estimates autocorrelation parameter ρ jointly with the observation variance. Gaussian family.

:airp_seasonalunverifiedSeasonal Latent Field
log_y ~ 0 + f(t, model = 'seasonal', season.length = 12)

Seasonal latent field with period 12 months (sum-to-zero constraint within each year). Captures multiplicative seasonality on the log scale. Gaussian family.

Boston Housing1

:boston_besagunverifiedGaussian Spatial (ICAR / Besag)
log(medv) ~ crim + zn + indus + chas + nox + rm + age + dis + rad + tax + ptratio + black + lstat + f(id, model = 'besag', graph = W)

Intrinsic CAR (Besag) spatial random effect for 506 Boston census tracts. f(id, model = "besag", graph = W) requires an adjacency matrix W (spdep object) passed separately — it is not contained in the tabular data. Gaussian family. Also fitted with "bym" (BYM = ICAR + IID) for comparison.

Cement1

:cement_lmunverifiedGaussian Linear Model (no random effects)
y ~ x1 + x2 + x3 + x4

inla() with family = "gaussian" — the simplest INLA use case, equivalent to lm() but with Bayesian inference via INLA. Demonstrates default weakly-informative priors on regression coefficients.

LIDAR1

:lidar_rw2unverifiedNonparametric Regression via RW2
logratio ~ -1 + f(range, model = 'rw2', constr = FALSE)

1D nonparametric regression using a second-order random walk latent field over the continuous predictor range. constr = FALSE drops the sum-to-zero constraint; -1 removes the fixed intercept (absorbed by the random walk). Gaussian family. Compare with spline-based approaches.

Penicillin1

:penicillin_iidunverifiedGaussian GLMM with IID Random Intercept
diameter ~ 1 + sample + f(plate_id, model = 'iid')

f(plate_id, model = "iid") specifies exchangeable random intercepts per assay plate — the INLA equivalent of (1|plate) in lme4. Gaussian family.

Sleep Deprivation2

:sleepstudy_iidunverifiedGaussian GLMM with IID Random Intercept
Reaction ~ 1 + Days + f(subject_id, model = 'iid')

Random intercept per subject; subject_id is the numeric version of Subject. Gaussian family. Equivalent to lmer(Reaction ~ Days + (1|Subject)).

:sleepstudy_slopesunverifiedGaussian GLMM with IID Random Slopes
Reaction ~ 1 + f(subject_id, Days, model = 'iid')

Random slopes model: f(subject_id, Days, ...) specifies subject-specific slopes for Days — the INLA way of writing (0 + Days | Subject). Gaussian family.

Hospital Mortality1

:surg_binomialunverifiedBinomial IID Overdispersion
r ~ f(hospital, model = 'iid')

12-hospital mortality benchmark. f(hospital, model = "iid") with family = "binomial" (trials = n) shrinks small-hospital rates toward the population mean. Demonstrates PC priors on the precision hyperparameter.

VA Lung Cancer1

:veteran_weibullunverifiedWeibull Survival Model
inla.surv(time, status) ~ trt + celltype + karno + diagtime + age + prior

inla.surv() wraps right-censored event times for INLA's survival families. Weibull proportional hazards model (family = "weibullsurv"); the shape parameter is estimated as a hyperparameter.

:mcmcglmm — MCMCglmm — MCMC GLMMs with animal models 7

Blue Tit Tarsus1

:btdata_animalunverifiedAnimal Model (Additive Genetic Variance)
fixed: tarsus ~ sex + hatchdate; random: ~fosternest + animal

The canonical MCMCglmm animal model: animal random effect with the inverse numerator relationship matrix Ainv (from BTped via inverseA()) separates additive genetic variance from shared rearing-environment variance. ginverse = list(animal = Ainv) must be passed at fitting time. Gaussian family.

Blue Tit Bivariate1

:btdata_bivariateunverifiedMultivariate Gaussian Animal Model
fixed: cbind(tarsus, back) ~ trait - 1 + trait:sex + trait:hatchdate; random: ~us(trait):fosternest + us(trait):animal; rcov: ~us(trait):units

Joint model for tarsus length and back colour. trait - 1 gives one intercept per response; us(trait):animal estimates a 2×2 genetic covariance matrix across traits. Allows estimating genetic correlations between morphological traits. ginverse = list(animal = Ainv) required. Gaussian/Gaussian family.

Blue Tit Tarsus1

:btdata_iidunverifiedGaussian GLMM with Foster-Nest Random Intercept
fixed: tarsus ~ sex + hatchdate; random: ~fosternest

Simple random intercept for rearing nest; estimates shared nest environment contribution to tarsus length. Gaussian family.

Chick Growth1

:chickweight_rslopeunverifiedRandom Regression (Unstructured G-matrix)
fixed: weight ~ Time + I(Time^2) + Diet:Time; random: ~us(1 + Time):Chick

Individual chicks vary in both baseline weight and growth rate. ~us(1 + Time):Chick fits a 2×2 unstructured G-matrix per chick capturing the (co)variance of intercepts and slopes. Gaussian family.

PBC1

:pbcseq_bivariateunverifiedBivariate Gaussian + Threshold Joint Model
fixed: cbind(log_bili, ascites) ~ trait - 1 + trait:(age + sex); random: ~us(trait):id; rcov: ~us(trait):units

Joint longitudinal model for continuous log-bilirubin (Gaussian) and binary ascites (threshold/probit). family = c("gaussian", "threshold"). The residual covariance ~us(trait):units accounts for within-visit correlation between the two outcomes after conditioning on the shared subject random effect.

Phenoloxidase1

:plodia_iidunverifiedGaussian GLMM with Full-Sib Family Random Effect
fixed: PO ~ 1; random: ~FSfamily

Intercept-only fixed effects; ~FSfamily random intercept partitions phenoloxidase variance into between-family and within-family components. Gaussian family. Textbook introductory example from the MCMCglmm reference manual.

Soay Sheep Horn Type1

:sshorns_ordinalunverifiedOrdinal Threshold Model
fixed: horn ~ sex; random: ~id

Ordered threshold (probit) model for horn morphology: polled < scurred < normal. family = "threshold"; residual variance is fixed at 1 for identifiability. ~id captures repeated-individual variation (some animals appear multiple times).

:glmmtmb — glmmTMB — GLMMs with ZI/hurdle and dispersion 9

Grouped Time Series1

:ar1_covarunverifiedAR(1) Random-Effect Covariance
y ~ ar1(times + 0 | group)

ar1(times + 0 | group) specifies AR(1) autocorrelation across ordered times within each group as a random-effect covariance structure. Gaussian family. Distinguishes glmmTMB from lme4, which does not support non-diagonal random-effect covariance natively.

Beta Regression1

:beta_dispunverifiedDispersion as Function of Predictor
y ~ x; disp: ~x

family = beta_family() with dispformula = ~x models both the mean proportion and the precision (φ) as functions of x. Demonstrates that ignoring heterogeneous dispersion (using dispformula = ~1) leads to worse fit.

Barn Owls4

:owls_zipunverifiedZero-Inflated Poisson GLMM
NCalls ~ (FT + ArrivalTime)*SexParent + offset(log_brood) + (1|Nest); zi: ~1

glmmTMB with family = poisson and ziformula = ~1 (constant zero-inflation probability). Nest random intercept handles clustering; offset accounts for brood size. Baseline model for owl sibling negotiation calls.

:owls_zinb2unverifiedZero-Inflated Negative Binomial (NB2) GLMM
NCalls ~ (FT + ArrivalTime)*SexParent + offset(log_brood) + (1|Nest); zi: ~1

Same formula as :owls_zip but with family = nbinom2 (variance = μ + μ²/k). Handles both overdispersion and excess zeros. AIC typically preferred over the Poisson version.

:owls_zinb1unverifiedZero-Inflated Negative Binomial (NB1) GLMM
NCalls ~ (FT + ArrivalTime)*SexParent + BroodSize + (1|Nest); zi: ~1

family = nbinom1 (variance = φμ, linear mean-variance relationship); brood size as a fixed covariate rather than offset. Contrasts NB1 vs NB2 parameterisation.

:owls_hurdleunverifiedHurdle NB1 GLMM
NCalls ~ (FT + ArrivalTime)*SexParent + BroodSize + (1|Nest); zi: ~.

Hurdle model: ziformula = ~. mirrors the conditional formula in the zero part, combined with family = truncated_nbinom1 for the positive count part. Treats zero-generation and positive-count processes as completely separate.

Salamanders2

:salamanders_zinb2unverifiedZI NB2 with Species-Varying Zero-Inflation
count ~ spp + (1|site); zi: ~spp

Zero-inflation probability varies by species (ziformula = ~spp). The conditional mean count also varies by species with a site random intercept. family = nbinom2.

:salamanders_genpoisunverifiedGeneralised Poisson with ZI
count ~ spp + mined + (1|site); zi: ~spp + mined

family = genpois (Generalised Poisson) handles both over- and under-dispersion; zero-inflation depends on both species and mining status.

Volcanic Topography1

:volcano_spatialunverifiedSpatial Exponential Covariance
z ~ 1 + exp(pos + 0 | group)

exp(pos + 0 | group) fits a spatial random field with exponential correlation decay. pos must be a numFactor encoding 2D coordinates (x, y). Gaussian family. All observations share one group so the full spatial covariance is estimated as a single 100×100 block. Note: pos = numFactor(x, y) must be computed before calling glmmTMB.

:glm_jl — GLM.jl — Generalised Linear Models (Julia) 6

Dobson Poisson1

:dobson_poissonunverifiedLog-Linear GLM
Counts ~ Outcome + Treatment

Canonical example from the GLM.jl documentation (and Dobson 1990). Poisson log-linear model for counts in a two-way layout.

glm(@formula(Counts ~ Outcome + Treatment), dobson, Poisson())

Life-Cycle Savings1

:savings_olsunverifiedMultiple Linear Regression
SR ~ Pop15 + Pop75 + DPI + DDPI

OLS regression of national savings rate on demographic and income predictors (50 countries). Classic textbook dataset (Belsley et al. 1980).

lm(@formula(SR ~ Pop15 + Pop75 + DPI + DDPI), LifeCycleSavings)

Pima Diabetes1

:pima_logisticunverifiedLogistic Regression
type ~ npreg + glu + bp + bmi + ped + age

Binary logistic regression for diabetes diagnosis in Pima Indian women. type is recoded from Yes/No to integer 0/1.

glm(@formula(type ~ npreg + glu + bp + bmi + ped + age), pima, Binomial())

Quine2

:quine_nbunverifiedNegative Binomial GLM
Days ~ Eth + Sex + Age + Lrn

Negative binomial GLM for overdispersed count data (school absent days). Example from the GLM.jl documentation; R equivalent is MASS::glm.nb().

negbin(@formula(Days ~ Eth + Sex + Age + Lrn), quine, LogLink())
:quine_poissonunverifiedPoisson GLM (vs. Negative Binomial)
Days ~ Eth + Sex + Age + Lrn

Poisson GLM for school absenteeism counts. Overdispersion relative to Poisson motivates the negative-binomial model (:quine_nb). Same formula, different distributional assumption.

glm(@formula(Days ~ Eth + Sex + Age + Lrn), quine, Poisson())

Trees1

:trees_lmunverifiedGaussian GLM (OLS)
Volume ~ Height + Girth

Linear regression of timber volume on tree girth and height; standard OLS via GLM.jl's lm() (equivalent to glm(..., Normal(), IdentityLink())).

lm(@formula(Volume ~ Height + Girth), trees)
Source Example Dataset Formula
:bambi escs escs
drugs ~ o + c + e + a + n
:bambi cherry_blossoms cherry_blossoms
doy ~ bs(year, knots=iknots, intercept=True)
:bambi cherry_blossoms cherry_blossoms
doy ~ bs(year, knots=iknots)
:bambi dietox dietox
Weight ~ Time + (Time|Pig)
:bambi sleepstudy sleepstudy
Reaction ~ 1 + Days + (Days | Subject)
:bambi radon radon
log_radon ~ 0 + floor
:bambi radon radon
log_radon ~ 0 + county:floor
:bambi radon radon
log_radon ~ 1 + (1|county)
:bambi radon radon
log_radon ~ 1 + floor + (1|county)
:bambi radon radon
log_radon ~ floor + (floor|county)
:bambi radon radon
log_radon ~ floor + log_u + (1|county)
:bambi strack_rrr strack_rrr
value ~ condition + (1|uid)
:bambi strack_rrr strack_rrr
value ~ condition + age + gender + (1|uid) + (condition|study) + (condition|stimulus)
:bambi shooter shooter
rate ~ S(race) * S(object) + (S(race) * S(object) | subject)
:bambi shooter shooter
rate ~ S(race) * S(object) + (S(race) * S(object) | subject) + (S(object) | target)
:bambi shooter shooter
shoot_or_not[shoot] ~ S(race)*S(object) + (S(race)*S(object) | subject) + (S(object) | target)
:bambi fixed_random fixed_random
y ~ x + z
:bambi fixed_random fixed_random
y ~ 0 + C(group) + x + z
:bambi fixed_random fixed_random
y ~ x + z + (1|group)
:bambi fixed_random fixed_random
y ~ x + z + xbar + (1|group)
:bambi t_regression t_regression
y ~ x
:bambi t_regression t_regression
y ~ x
:bambi predict_new_groups predict_new_groups
fvc ~ 0 + weeks + smoking_status + (0 + weeks | patient)
:bambi polynomial_regression poly_falling
x ~ I(t**2) + 1
:bambi polynomial_regression poly_falling
x ~ {t**2} + 1
:bambi polynomial_regression poly_falling
x ~ tsquared + 1
:bambi polynomial_regression poly_projectile
x ~ I(t**2) + t + 1
:bambi polynomial_regression poly_projectile
x ~ poly(t, 2, raw=True)
:bambi polynomial_regression poly_planets
Height ~ I(Time**2):Planet + Time + 0
:bambi logistic_anes logistic_anes
vote['clinton'] ~ party_id + party_id:age
:bambi model_comparison model_comparison
income['>50K'] ~ sex + race + scale(age) + scale(hs_week)
:bambi model_comparison model_comparison
income['>50K'] ~ sex + race + scale(age) + I(scale(age)**2) + scale(hs_week) + I(scale(hs_week)**2)
:bambi model_comparison model_comparison
income['>50K'] ~ sex + race + scale(age) + I(scale(age)**2) + I(scale(age)**3) + scale(hs_week) + I(scale(hs_week)**2) + I(scale(hs_week)**3)
:bambi hierarchical_binomial hierarchical_binomial
p(H, AB) ~ 0 + playerID
:bambi hierarchical_binomial hierarchical_binomial
p(H, AB) ~ 1 + (1|playerID)
:bambi wald_gamma wald_gamma
claimcst0 ~ C(agecat) + gender + area
:bambi wald_gamma wald_gamma
claimcst0 ~ agecat + gender + area
:bambi negative_binomial negative_binomial
daysabs ~ 0 + prog + scale(math)
:bambi negative_binomial negative_binomial
daysabs ~ 0 + prog + scale(math) + prog:scale(math)
:bambi count_roaches count_roaches
y ~ roach1 + treatment + senior + offset(log(exposure2))
:bambi count_roaches count_roaches
y ~ roach1 + treatment + senior + offset(log(exposure2))
:bambi beta_regression beta_probs
probabilities ~ 1
:bambi beta_regression beta_coin
p ~ delta_d
:bambi beta_regression beta_batting
batting_avg ~ 1
:bambi beta_regression beta_batting
batting_avg ~ batting_avg_shift
:bambi categorical_regression categorical_toy
y ~ x
:bambi categorical_regression categorical_regression
species ~ sepal_length + sepal_width + petal_length + petal_width
:bambi categorical_regression categorical_alligator
choice ~ length + sex
:bambi circular_regression circular_regression
direction ~ distance
:bambi circular_regression circular_regression
direction ~ distance
:bambi quantile_regression quantile_regression
bmi ~ bs(age, knots=knots)
:bambi quantile_regression quantile_regression
bmi ~ bs(age, knots=knots)
:bambi quantile_regression quantile_regression
bmi ~ bs(age, knots=knots)
:bambi quantile_regression quantile_regression
bmi ~ bs(age, knots=knots)
:bambi mister_p mister_p
p(abortion, n) ~ male + repvote + (1|state) + (1|eth) + (1|edu) + (1|male:eth) + (1|edu:age) + (1|edu:eth)
:bambi zero_inflated zero_inflated
count ~ livebait + camper + persons + child
:bambi zero_inflated zero_inflated
psi ~ livebait + camper + persons + child
:bambi zero_inflated zero_inflated
count ~ livebait + camper + persons + child
:bambi zero_inflated zero_inflated
psi ~ livebait + camper + persons + child
:bambi ordinal_regression ordinal_regression
response ~ 0
:bambi ordinal_regression ordinal_regression
response ~ 0 + action + intention + contact + action:intention + contact:intention
:bambi ordinal_regression hr_attrition
YearsAtCompany ~ 0 + TotalWorkingYears
:bambi distributional_models distributional_synth
y ~ x
:bambi distributional_models distributional_synth
y ~ x + alpha ~ x
:bambi distributional_models distributional_models
count ~ 0 + bs(hour, 8, intercept=True) + alpha ~ 0 + bs(hour, 8, intercept=True)
:bambi hsgp_1d hsgp_1d
y ~ 0 + hsgp(x, m=10, c=2)
:bambi hsgp_1d hsgp_1d
y ~ 0 + hsgp(x, m=10, c=2, centered=True)
:bambi hsgp_1d gam_data
y ~ 0 + hsgp(x2, by=fac, m=12, c=1.5)
:bambi hsgp_1d gam_data
y ~ 0 + hsgp(x2, by=fac, m=12, c=1.5, share_cov=False)
:bambi hsgp_2d hsgp_2d
outcome ~ 0 + hsgp(x, y, c=1.5, m=10)
:bambi hsgp_2d hsgp_2d
outcome ~ 0 + hsgp(x, y, by=group, c=1.5, m=10)
:bambi hsgp_2d hsgp_2d
outcome ~ 0 + hsgp(x, y, by=group, c=1.5, m=10, share_cov=False)
:bambi hsgp_2d hsgp_2d
outcome ~ 0 + hsgp(x, y, c=1.5, m=10, iso=False)
:bambi hsgp_2d poisson_data
Count ~ 0 + Year + X1:Year + (1|Site) + hsgp(Lon, Lat, by=Year, m=5, c=1.5)
:bambi survival_model survival_model
censored(days_to_event / 31, adopt) ~ 1
:bambi survival_model survival_model
censored(days_to_event / 31, adopt) ~ 0 + color_id
:bambi survival_discrete_time survival_discrete_time
event ~ treatment + age + time
:bambi survival_discrete_time child_mortality
p(events, at_risk) ~ sex + socBranch + period + scale(birth_decade)
:bambi survival_discrete_time child_mortality
p(events, at_risk) ~ sex + socBranch + bs(period, df=4) + scale(birth_decade)
:bambi survival_discrete_time child_mortality
events ~ sex + socBranch + period + scale(birth_decade) + offset(log(at_risk))
:bambi survival_continuous_time survival_continuous_time
censored(time, censoring) ~ treatment + age
:bambi survival_continuous_time retention
censored(month, censoring) ~ C(gender) + C(level) + C(field) + sentiment + intention
:bambi survival_continuous_time retention
censored(month, censoring) ~ C(gender) + C(level) + sentiment + intention + (1|field)
:bambi orthogonal_polynomial orthopoly_projectile
x ~ I(t**2) + t + 1
:bambi orthogonal_polynomial orthopoly_projectile
x ~ poly(t, 2) + 1
:bambi orthogonal_polynomial orthogonal_polynomial
mpg ~ horsepower
:bambi orthogonal_polynomial orthogonal_polynomial
mpg ~ poly(horsepower, 2)
:bambi orthogonal_polynomial orthogonal_polynomial
mpg ~ poly(horsepower, degree)
:bambi plot_predictions plot_predictions
mpg ~ 0 + hp * wt + cyl + gear
:bambi plot_predictions negative_binomial
daysabs ~ 0 + prog + scale(math) + prog:scale(math)
:bambi plot_predictions plot_pred_movies
certified_fresh ~ 0 + scale(length) * style
:bambi plot_predictions distributional_synth
y ~ x + alpha ~ x
:bambi plot_comparisons plot_comparisons
count ~ livebait + camper + persons + child
:bambi plot_comparisons titanic
Survived ~ PClass * SexCode * Age
:bambi plot_slopes plot_slopes
switch ~ dist100 + arsenic + educ4
:bambi plot_slopes plot_slopes
switch ~ dist100 + arsenic + educ4 + dist100:educ4 + arsenic:educ4
:bambi alternative_samplers alternative_samplers
y ~ x
:brms cbpp cbpp
incidence | trials(size) ~ period + (1|herd)
:brms cbpp cbpp
incidence | vint(size) ~ period + (1|herd)
:brms distreg distreg_dat1
bf(symptom_post ~ group, sigma ~ group)
:brms distreg distreg_fish
count ~ persons + child + camper
:brms distreg distreg_fish
bf(count ~ persons + child + camper, zi ~ child)
:brms distreg distreg_gam
bf(y ~ s(x1) + s(x2) + (1|fac), sigma ~ s(x0) + (1|fac))
:brms nhanes nhanes
bmi ~ age * chl
:brms nhanes nhanes
bf(bmi | mi() ~ age * mi(chl)) + bf(chl | mi() ~ age) + set_rescor(FALSE)
:brms nhanes nhanes
bf(bmi | mi() ~ age * mi(chl)) + bf(chl | mi(se = se_chl) ~ age) + set_rescor(FALSE)
:brms income income
ls ~ mo(income)
:brms income income
ls ~ income_num
:brms income income
ls ~ income
:brms income income
ls ~ mo(income) * age
:brms income income
ls ~ mo(income) * age + (mo(income) | city)
:brms btdata btdata
bf(mvbind(tarsus, back) ~ sex + hatchdate + (1|p|fosternest) + (1|q|dam)) + set_rescor(TRUE)
:brms btdata btdata
bf(tarsus ~ sex + hatchdate + (1|p|fosternest) + (1|q|dam)) + bf(back ~ sex + hatchdate + (1|p|fosternest) + (1|q|dam)) + set_rescor(TRUE)
:brms btdata btdata
bf(tarsus ~ sex + s(hatchdate, k=5) + (1|p|fosternest) + (1|q|dam), family = skew_normal()) + bf(back ~ sex + s(hatchdate, k=5) + (1|p|fosternest) + (1|q|dam)) + set_rescor(TRUE)
:brms nonlinear nonlinear_dat
bf(y ~ b1 * exp(b2 * x), b1 + b2 ~ 1, nl = TRUE)
:brms nonlinear nonlinear_dat
y ~ x
:brms nonlinear loss
bf(cum ~ ult * (1 - exp(-(dev/theta)^omega)), ult ~ 1 + (1|AY), omega ~ 1, theta ~ 1, nl = TRUE)
:brms phylogenetics phylo_simple
phen ~ cofactor + (1|gr(phylo, cov = A))
:brms phylogenetics phylo_simple
phen ~ cofactor + (1|gr(phylo, cov = A)) + (1|phylo)
:brms phylogenetics phylo_repeat
phen ~ cofactor + (1|gr(phylo, cov = A)) + (1|species)
:brms phylogenetics phylo_effect
Zr | se(sqrt(1/(N-3))) ~ 1 + (1|gr(phylo, cov = A))
:brms phylogenetics phylo_pois
phen_pois ~ cofactor + (1|gr(phylo, cov = A))
:mcelreath globe globe
w | trials(n) ~ 0 + Intercept
:mcelreath howell1 howell1
height ~ 1
:mcelreath howell1 howell1
height ~ 1 + weight_c
:mcelreath howell1 howell1
height ~ 1 + weight_s + weight_s2
:mcelreath howell1 howell1
height ~ 1 + weight_s + weight_s2 + weight_s3
:mcelreath howell1 howell1
bf(height ~ a + exp(lb) * weight_c, a ~ 1, lb ~ 1, nl = TRUE)
:mcelreath howell1 howell1
bf(w ~ log(3.141593 * k * p^2 * h^3), k + p ~ 1, nl = TRUE)
:mcelreath cherry_blossoms cherry_blossoms
doy ~ 1 + B
:mcelreath waffle_divorce waffle_divorce
D ~ 1 + A
:mcelreath waffle_divorce waffle_divorce
D ~ 1 + M
:mcelreath waffle_divorce waffle_divorce
D ~ 1 + M + A
:mcelreath waffle_divorce waffle_divorce
M ~ 1 + A
:mcelreath waffle_divorce waffle_divorce
bf(D ~ 1 + M + A) + bf(M ~ 1 + A) + set_rescor(FALSE)
:mcelreath waffle_divorce waffle_divorce
D_obs | mi(D_sd) ~ 1 + A + M
:mcelreath milk milk
kcal_s ~ 1 + neo_s
:mcelreath milk milk
kcal_s ~ 1 + logmass_s
:mcelreath milk milk
kcal_s ~ 1 + neo_s + logmass_s
:mcelreath milk milk
kcal_s ~ 0 + clade
:mcelreath milk milk
bf(k ~ 1 + mi(b) + m) + bf(b | mi() ~ 1) + set_rescor(FALSE)
:mcelreath plant_growth plant_growth
h1 ~ 0 + h0
:mcelreath plant_growth plant_growth
bf(h1 ~ h0 * (a + t * treatment + f * fungus), a + t + f ~ 1, nl = TRUE)
:mcelreath plant_growth plant_growth
bf(h1 ~ h0 * (a + t * treatment), a + t ~ 1, nl = TRUE)
:mcelreath happiness happiness
happiness ~ 0 + mid + a
:mcelreath happiness happiness
happiness ~ 0 + Intercept + a
:mcelreath rugged rugged
log_gdp_std ~ 1 + rugged_std_c
:mcelreath rugged rugged
log_gdp_std ~ 0 + cid + rugged_std_c
:mcelreath rugged rugged
bf(log_gdp_std ~ 0 + a + b * rugged_std_c, a ~ 0 + cid, b ~ 0 + cid, nl = TRUE)
:mcelreath tulips tulips
blooms_std ~ 1 + water_cent + shade_cent
:mcelreath tulips tulips
blooms_std ~ 1 + water_cent + shade_cent + water_cent:shade_cent
:mcelreath hetero hetero
bf(y ~ 1, sigma ~ 1 + x)
:mcelreath chimpanzees chimpanzees
pulled_left | trials(1) ~ 1
:mcelreath chimpanzees chimpanzees
bf(pulled_left | trials(1) ~ a + b, a ~ 0 + actor, b ~ 0 + treatment, nl = TRUE)
:mcelreath chimpanzees chimpanzees
bf(pulled_left | trials(1) ~ a + b, a ~ 1 + (1 | actor) + (1 | block), b ~ 0 + treatment, nl = TRUE)
:mcelreath chimpanzees chimpanzees
pulled_left | trials(1) ~ 0 + treatment + (0 + treatment | actor) + (0 + treatment | block)
:mcelreath ucbadmit ucbadmit
admit | trials(applications) ~ 0 + gid
:mcelreath ucbadmit ucbadmit
bf(admit | trials(applications) ~ a + d, a ~ 0 + gid, d ~ 0 + dept, nl = TRUE)
:mcelreath ucbadmit ucbadmit
admit | vint(applications) ~ 0 + gid
:mcelreath kline kline
total_tools ~ 1
:mcelreath kline kline
bf(total_tools ~ a + b * log_pop_std, a + b ~ 0 + cid, nl = TRUE)
:mcelreath kline kline
bf(total_tools ~ exp(a) * population^b / g, a + b ~ 0 + cid, g ~ 1, nl = TRUE)
:mcelreath kline2 kline2
bf(total_tools ~ exp(a) * population^b / g, a ~ 1 + gp(lat_adj, lon2_adj, scale=FALSE), b + g ~ 1, nl = TRUE)
:mcelreath trolley trolley
response ~ 1
:mcelreath trolley trolley
response ~ 1 + action + contact + intention + intention:action + intention:contact
:mcelreath trolley trolley
response ~ 1 + action + contact + intention + mo(edu_new)
:mcelreath reedfrogs reedfrogs
surv | trials(density) ~ 0 + factor(tank)
:mcelreath reedfrogs reedfrogs
surv | trials(density) ~ 1 + (1 | tank)
:mcelreath cafe cafe
wait ~ 1 + afternoon + (1 + afternoon | cafe)
:mcelreath primates301 primates301
b ~ 1 + m + g
:mcelreath primates301 primates301
b ~ 1 + m + g + fcor(R)
:mcelreath moralizing_gods moralizing_gods
moralizing_gods | trials(1) ~ 1 + writing
:mcelreath panda_nuts panda_nuts
bf(n_panda ~ seconds * phi * (1 - exp(-k * age_s))^theta, phi + k + theta ~ 1, nl = TRUE)
:mcelreath lynx_hare lynx_hare
Hare ~ 1 + ar(time = Year, p = 1)
:mcelreath lynx_hare lynx_hare
Hare ~ 1 + Hare_1
:mcelreath lynx_hare lynx_hare
bf(Hare ~ 1 + mi(Hare_1)) + bf(Hare_1 | mi() ~ 1) + set_rescor(FALSE)
:mcelreath lynx_hare lynx_hare
bf(Hare ~ 0 + Intercept + Hare_1 + Lynx_1) + bf(Lynx ~ 0 + Intercept + Lynx_1 + Hare_1) + set_rescor(FALSE)
:mcelreath btdata btdata
mvbind(tarsus, back) ~ 1
:mcelreath btdata btdata
mvbind(tarsus, back) ~ sex + hatchdate + (1 | p | fosternest) + (1 | q | dam)
:mcelreath btdata btdata
mvbind(tarsus, back) ~ sex * hatchdate + (1 | p | fosternest) + (1 | q | dam)
:kruschke z15n50 z15n50
y ~ 1
:kruschke z6n8z2n7 z6n8z2n7
y ~ 0 + s
:kruschke therapeutic_touch therapeutic_touch
y ~ 1 + (1 | s)
:kruschke batting_average batting_average
Hits | trials(AtBats) ~ 1 + (1 | PriPos) + (1 | PriPos:Player)
:kruschke recall recall
n_recalled | trials(20) ~ 0 + condition
:kruschke recall recall
n_recalled | trials(20) ~ 1
:kruschke two_group_iq two_group_iq
Score ~ 1
:kruschke two_group_iq two_group_iq
bf(Score ~ 0 + Group, sigma ~ 0 + Group)
:kruschke calcium calcium
decrease ~ 0 + treatment
:kruschke htwt htwt
weight_z ~ 1 + height_z
:kruschke hier_linreg hier_linreg
y_z ~ 1 + x_z + (1 + x_z || Subj)
:kruschke income_famsize income_famsize
median_income_z | se(se_z, sigma = TRUE) ~ 1 + family_size_z + I(family_size_z^2) + (1 + family_size_z + I(family_size_z^2) || State)
:kruschke guber1999 guber1999
satt_z ~ 1 + spend_z + prcnt_take_z
:kruschke guber1999 guber1999
satt_z ~ 0 + Intercept + spend_z + prcnt_take_z + prop_not_take_z
:kruschke guber1999 guber1999
satt_z ~ 1 + spend_z + prcnt_take_z + interaction_z
:kruschke fruitfly fruitfly
Longevity ~ 1 + (1 | CompanionNumber)
:kruschke fruitfly fruitfly
Longevity ~ 1
:kruschke fruitfly fruitfly
bf(Longevity ~ 0 + CompanionNumber, sigma ~ 0 + CompanionNumber)
:kruschke fruitfly fruitfly
Longevity ~ 1 + thorax_c + (1 | CompanionNumber)
:kruschke fruitfly fruitfly
Longevity ~ 1 + thorax_c + (1 + thorax_c | CompanionNumber)
:kruschke salary salary
Salary ~ 1 + (1 | Pos) + (1 | Org) + (1 | Pos:Org)
:kruschke salary salary
bf(Salary ~ 1 + (1 | Pos) + (1 | Org) + (1 | Pos:Org), sigma ~ 1 + (1 | Pos:Org))
:kruschke splitplot splitplot
Yield ~ 1 + (1 | Till) + (1 | Fert) + (1 | Field) + (1 | Till:Fert)
:kruschke splitplot splitplot
Yield ~ 1 + (1 | Till) + (1 | Fert) + (1 | Till:Fert)
:kruschke htwt110 htwt110
male ~ 1 + weight_z
:kruschke htwt110 htwt110
male ~ 1 + weight_z + height_z
:kruschke htwt110 htwt110
bf(male ~ a * 0.5 + (1 - a) * 1 / (1 + exp(-(b0 + b1 * weight_z))), a + b0 + b1 ~ 1, nl = TRUE)
:kruschke softmax softmax1
Y ~ 0 + Intercept + X1 + X2
:kruschke softmax softmax1
Y ~ 1
:kruschke softmax condlog1
Y_ord ~ 1 + cs(X1) + cs(X2)
:kruschke softmax condlog2
Y_ord ~ 1 + cs(X1) + cs(X2)
:kruschke ordinal_probit ordinal_probit
Y ~ 1
:kruschke ordinal_probit ordinal_probit
bf(Y ~ 1 + X) + lf(disc ~ 0 + X, cmc = FALSE)
:kruschke ordinal_probit ordinal_probit
bf(Y ~ 0 + X, sigma ~ 0 + X)
:kruschke happiness_assets happiness_assets
Happiness ~ 1 + Assets_s
:kruschke movies movies
Rating ~ 1 + Year_s + Length_s
:kruschke haireye haireye
Count ~ 1 + (1 | Hair) + (1 | Eye) + (1 | Hair:Eye)
:kruschke haireye haireye
Count | trials(264) ~ 1 + (1 | Hair) + (1 | Eye) + (1 | Hair:Eye)
:kruschke censored censored
y_na ~ 1
:kruschke censored censored
y1 | cens(cen1) ~ 1
:kruschke censored censored
y2 | cens(cen2, y3) ~ 1
:burkner_papers epilepsy epilepsy
count ~ zBase * Trt + (1 | patient)
:burkner_papers epilepsy epilepsy
count | trunc(ub = 104) ~ zBase * Trt + (1 | patient)
:burkner_papers epilepsy epilepsy
count ~ Trt + (1 | patient)
:burkner_papers inhaler inhaler
rating ~ period + carry + cs(treat)
:burkner_papers kidney kidney
time | cens(censored) ~ age * sex + disease + (1 | patient)
:burkner_papers hetero_jss hetero_jss
bf(y ~ x, sigma ~ 0 + x)
:burkner_papers hetero_jss hetero_jss
bf(y ~ x, quantile = 0.25)
:burkner_papers fish_rj fish_rj
count ~ persons + child + camper
:burkner_papers fish_rj fish_rj
bf(count ~ persons + child + camper, zi ~ child)
:burkner_papers rent99 rent99
rentsqm ~ t2(area, yearc) + (1 | district)
:burkner_papers rent99 rent99
bf(rentsqm ~ t2(area, yearc) + (1 | ID1 | district), sigma ~ t2(area, yearc) + (1 | ID1 | district))
:burkner_papers loss_rj loss_rj
bf(cum ~ ult * (1 - exp(-(dev/theta)^omega)), ult ~ 1 + (1 | AY), omega ~ 1, theta ~ 1, nl = TRUE)
:burkner_papers multi_member multi_member
y ~ 1 + (1 | mm(s1, s2))
:burkner_papers multi_member multi_member
y ~ 1 + (1 | mm(s1, s2, weights = cbind(w1, w2)))
:action_models rw_jget jget_sub
learning_rate ~ 1 + pdi_total + session + (1 | ID)
:action_models rw_jget jget_sub
action_noise ~ 1 + pdi_total + session + (1 | ID)
:action_models pvl_igt ahn_igt
learning_rate ~ clinical_group + (1 | subjID)
:action_models pvl_igt ahn_igt
reward_sensitivity ~ clinical_group + (1 | subjID)
:action_models pvl_igt ahn_igt
loss_aversion ~ clinical_group + (1 | subjID)
:action_models pvl_igt ahn_igt
action_noise ~ clinical_group + (1 | subjID)
:epidist outbreak_delays outbreak_aggregated
delay | weights(n) ~ 1
:epidist outbreak_delays outbreak_aggregated
delay_lwr | weights(n) + vreal(relative_obs_time, pwindow, swindow, delay_upr) ~ 1
:epinowcast epinowcast_basic hosp_triangle
enw_expectation(~0 + (1|day)) + enw_reference(~1, dist='lognormal')
:epinowcast epinowcast_basic hosp_triangle
enw_expectation(~0 + (1|day)) + enw_reference(~1, dist='lognormal') + enw_report(~(1|day_of_week))
:epinowcast epinowcast_basic hosp_triangle
enw_expectation(~0 + (1|day)) + enw_reference(parametric=~0, non_parametric=~0+delay)
:epinowcast epinowcast_age hosp_triangle_age
enw_expectation(~0 + (1|day_of_week) + (1|day:.group)) + enw_reference(~1 + (1|age_group)) + enw_report(~(1|day_of_week))
:epinowcast epinowcast_age hosp_triangle_age
enw_expectation(~0 + (1|day_of_week) + (1|day:.group)) + enw_reference(~1 + (1|age_group) + rw(week, by=age_group)) + enw_report(~(1|day_of_week))
:epinowcast epinowcast_rt hosp_triangle
enw_expectation(r=~1+rw(week), generation_time=gt_pmf, observation=~1+(1|day_of_week)) + enw_reference(~1, dist='lognormal')
:rstanarm mtcars mtcars
mpg ~ wt + am
:rstanarm clouds clouds
rainfall ~ seeding * (sne + cloudcover + prewetness + echomotion) + time
:rstanarm womensrole womensrole
cbind(agree, disagree) ~ education + sex
:rstanarm womensrole womensrole
cbind(agree, disagree) ~ education + I(education^2) + sex
:rstanarm kidiq kidiq
kid_score ~ mom_hs
:rstanarm kidiq kidiq
kid_score ~ mom_iq
:rstanarm kidiq kidiq
kid_score ~ mom_hs + mom_iq
:rstanarm kidiq kidiq
kid_score ~ mom_hs * mom_iq
:rstanarm clotting clotting
clot_time ~ log_plasma * lot_id
:rstanarm wells wells
switch ~ dist100
:rstanarm wells wells
switch ~ dist100 + arsenic
:rstanarm roaches roaches
y ~ roach1 + treatment + senior + offset(log(exposure2))
:rstanarm roaches roaches
y ~ roach1 + treatment + senior + offset(log(exposure2))
:rstanarm weightgain weightgain
weightgain ~ source * type
:rstanarm weightgain weightgain
weightgain ~ 1 + (1|source) + (1|type) + (1|source:type)
:rstanarm esoph esoph
tobgp ~ agegp + alcgp
:rstanarm gasoline_yield gasoline_yield
yield ~ gravity + pressure + temp10 + batch
:rstanarm gasoline_yield gasoline_yield
yield ~ gravity + pressure + temp10 + batch | gravity + pressure
:rstanarm cbpp_glmm cbpp_rs
cbind(incidence, size - incidence) ~ size + period + (1|herd)
:rstanarm bball_pooling bball1970
cbind(Hits, AB - Hits) ~ 1
:rstanarm bball_pooling bball1970
cbind(Hits, AB - Hits) ~ 0 + Player
:rstanarm bball_pooling bball1970
cbind(Hits, AB - Hits) ~ (1|Player)
:vasishth pupil pupil
p_size ~ 1 + c_load
:vasishth spacebar spacebar
t ~ 1 + c_trial
:vasishth recall_wm recall_wm
correct ~ 1 + c_set_size
:vasishth n400 n400
n400 ~ c_cloze + (c_cloze || subj)
:vasishth n400 n400
n400 ~ c_cloze + (c_cloze | subj)
:vasishth n400 n400
n400 ~ c_cloze + (c_cloze | subj) + (c_cloze | item)
:vasishth n400 n400
bf(n400 ~ c_cloze + (c_cloze | subj) + (c_cloze | item), sigma ~ 1 + (1 | subj))
:vasishth stroop stroop
RT ~ c_cond + (c_cond | subj)
:vasishth pooling pooling
y ~ 1 + (1 | subj)
:vasishth pooling pooling
y ~ 1
:vasishth pooling pooling
y ~ 0 + factor(subj)
:vasishth contrasts1 contrasts1
DV ~ F
:vasishth contrasts1 contrasts1
DV ~ -1 + F
:vasishth contrasts1 contrasts1
DV ~ 1 + mo(F)
:vasishth contrasts2x2 contrasts2x2
DV ~ A * B
:vasishth contrasts2x2 contrasts2x2
DV ~ B / A
:vasishth contrasts2x2 contrasts2x2
pDV ~ A * B
:vasishth meta_sbi meta_sbi
effect | resp_se(SE, sigma = FALSE) ~ 1 + (1 | study_id)
:vasishth indiv_diff indiv_diff
mean_rspeed ~ c_mean_pcu
:vasishth indiv_diff indiv_diff
mean_rspeed | resp_se(se_rspeed, sigma = TRUE) ~ me(c_mean_pcu, se_pcu)
:bmm color_wheel_mixture bays2009_synth
thetat ~ 0 + set_size + (0 + set_size | id); kappa ~ 0 + set_size + (0 + set_size | id)
:bmm color_wheel_mixture bays2009_synth
thetat ~ 0 + set_size + (0 + set_size | id); thetant ~ 0 + set_size + (0 + set_size | id); kappa ~ 0 + set_size + (0 + set_size | id)
:bmm sdm_condition sdm_synth
c ~ 0 + cond; kappa ~ 0 + cond
:bmm imm_condition imm_synth
c ~ 0 + cond; a ~ 0 + cond; s ~ 0 + cond; kappa ~ 0 + cond
:flocker single_season fd_rep_varying
occ: ~ uc1 + (1 + uc1 | species); det: ~ uc1 + ec1 + (1 + uc1 + ec1 | species)
:flocker single_season fd_rep_varying
occ: ~ uc1 + (1 + uc1 | species); det: ~ uc1 + (1 + uc1 | species)
:flocker colex_multiseason fd_multi
occ: ~ uc1; det: ~ uc1 + ec1; col: ~ uc1; ex: ~ uc1
:flocker colex_multiseason fd_multi
det: ~ uc1 + ec1; col: ~ uc1; ex: ~ uc1
:flocker autologistic_multiseason fd_multi
det: ~ uc1 + ec1; col: ~ uc1; auto: ~ 1
:flocker augmented_richness fd_augmented
occ: ~ (1 | ff_species); det: ~ uc1 + ec1 + (1 + uc1 + ec1 | ff_species)
:mvgam portal_counts portal_synth
count ~ s(year_fac, bs = "re") - 1
:mvgam portal_counts portal_synth
obs: count ~ 1 | trend: ~ s(ndvi_ma12, k = 6) [AR()]
:mvgam portal_counts portal_synth
obs: count ~ series - 1 | trend: ~ s(season, bs = "cc", k = 8) [AR()]
:mvgam plankton_var plankton_synth
obs: y ~ -1 | trend: ~ te(temp, month, k = c(4, 4)) + te(temp, month, k = c(4, 4), by = trend) - 1 [VAR(cor = TRUE)]
:mvgam salmon_survival salmon_synth
obs: survival ~ 1 | trend: ~ dynamic(CUI.apr, k = 25, scale = FALSE) - 1 [AR()]
:mvgam nmix_detection nmix_synth
obs: y ~ s(det_cov, k = 4) + s(det_cov2, k = 4) | trend: ~ s(abund_cov, k = 4) + s(abund_fac, bs = "re") [nmix()]
:lme4 sleep_deprivation sleepstudy
Reaction ~ Days + (Days | Subject)
:lme4 sleep_deprivation sleepstudy
Reaction ~ Days + (Days || Subject)
:lme4 dyestuff dyestuff
Yield ~ 1 + (1 | Batch)
:lme4 cbpp lme4_cbpp
cbind(incidence, size - incidence) ~ period + (1 | herd)
:lme4 penicillin penicillin
diameter ~ 1 + (1 | plate) + (1 | sample)
:lme4 pastes pastes
strength ~ (1 | batch/cask)
:lme4 verbal_aggression verbagg
r2 ~ Anger + Gender + btype + situ + (1 | id) + (1 | item)
:lme4 contraception contraception
use ~ age + I(age^2) + livch + urban + (urban | district)
:mixed_models_jl dyestuff dyestuff
Yield ~ 1 + (1 | Batch)
:mixed_models_jl sleep_deprivation sleepstudy
Reaction ~ 1 + Days + (1 + Days | Subject)
:mixed_models_jl sleep_deprivation sleepstudy
Reaction ~ 1 + Days + zerocorr(1 + Days | Subject)
:mixed_models_jl penicillin penicillin
diameter ~ 1 + (1 | plate) + (1 | sample)
:mixed_models_jl pastes pastes
strength ~ 1 + (1 | batch/cask)
:mixed_models_jl verbal_aggression verbagg
r2 ~ 1 + Anger + Gender + btype + situ + (1 | id) + (1 | item)
:mixed_models_jl contraception contraception
use ~ 1 + age + abs2(age) + livch + urban + (1 | district)
:inla cement cement
y ~ x1 + x2 + x3 + x4
:inla penicillin penicillin
diameter ~ 1 + sample + f(plate_id, model = 'iid')
:inla sleepstudy sleepstudy_inla
Reaction ~ 1 + Days + f(subject_id, model = 'iid')
:inla sleepstudy sleepstudy_inla
Reaction ~ 1 + f(subject_id, Days, model = 'iid')
:inla airpassengers_temporal airpassengers
log_y ~ 0 + f(t, model = 'rw1')
:inla airpassengers_temporal airpassengers
log_y ~ 0 + f(t, model = 'rw2')
:inla airpassengers_temporal airpassengers
log_y ~ 0 + f(t, model = 'ar1')
:inla airpassengers_temporal airpassengers
log_y ~ 0 + f(t, model = 'seasonal', season.length = 12)
:inla veteran_survival veteran
inla.surv(time, status) ~ trt + celltype + karno + diagtime + age + prior
:inla lidar_smooth lidar
logratio ~ -1 + f(range, model = 'rw2', constr = FALSE)
:inla surg_mortality surg
r ~ f(hospital, model = 'iid')
:inla boston_spatial boston_housing
log(medv) ~ crim + zn + indus + chas + nox + rm + age + dis + rad + tax + ptratio + black + lstat + f(id, model = 'besag', graph = W)
:mcmcglmm plodiaPO_iid plodiaPO
fixed: PO ~ 1; random: ~FSfamily
:mcmcglmm btdata_iid btdata
fixed: tarsus ~ sex + hatchdate; random: ~fosternest
:mcmcglmm btdata_animal btdata
fixed: tarsus ~ sex + hatchdate; random: ~fosternest + animal
:mcmcglmm chickweight_rslope chickweight
fixed: weight ~ Time + I(Time^2) + Diet:Time; random: ~us(1 + Time):Chick
:mcmcglmm btdata_bivariate btdata
fixed: cbind(tarsus, back) ~ trait - 1 + trait:sex + trait:hatchdate; random: ~us(trait):fosternest + us(trait):animal; rcov: ~us(trait):units
:mcmcglmm pbcseq_bivariate pbcseq
fixed: cbind(log_bili, ascites) ~ trait - 1 + trait:(age + sex); random: ~us(trait):id; rcov: ~us(trait):units
:mcmcglmm sshorns_ordinal sshorns
fixed: horn ~ sex; random: ~id
:glmmtmb owls_zi owls
NCalls ~ (FT + ArrivalTime)*SexParent + offset(log_brood) + (1|Nest); zi: ~1
:glmmtmb owls_zi owls
NCalls ~ (FT + ArrivalTime)*SexParent + offset(log_brood) + (1|Nest); zi: ~1
:glmmtmb owls_zi owls
NCalls ~ (FT + ArrivalTime)*SexParent + BroodSize + (1|Nest); zi: ~1
:glmmtmb owls_zi owls
NCalls ~ (FT + ArrivalTime)*SexParent + BroodSize + (1|Nest); zi: ~.
:glmmtmb salamanders_zi salamanders
count ~ spp + (1|site); zi: ~spp
:glmmtmb salamanders_zi salamanders
count ~ spp + mined + (1|site); zi: ~spp + mined
:glmmtmb beta_disp beta_sim
y ~ x; disp: ~x
:glmmtmb ar1_covar ar1_sim
y ~ ar1(times + 0 | group)
:glmmtmb volcano_spatial volcano_spatial
z ~ 1 + exp(pos + 0 | group)
:glm_jl dobson_poisson dobson_poisson
Counts ~ Outcome + Treatment
:glm_jl quine quine
Days ~ Eth + Sex + Age + Lrn
:glm_jl quine quine
Days ~ Eth + Sex + Age + Lrn
:glm_jl trees trees
Volume ~ Height + Girth
:glm_jl pima_diabetes pima_tr
type ~ npreg + glu + bp + bmi + ped + age
:glm_jl lifecycle_savings lifecycle_savings
SR ~ Pop15 + Pop75 + DPI + DDPI