Skip to content

rstanarm

Bayesian Applied Regression Modeling via Stan

v2.32.2 · Sep 30, 2025 · GPL (>= 3)

Description

Estimates previously compiled regression models using the 'rstan' package, which provides the R interface to the Stan C++ library for Bayesian estimation. Users specify models via the customary R syntax with a formula and data.frame plus some additional arguments for priors.

Downloads

CRAN

57.9K

Last 30 days

465th

123.4K

Last 90 days

358.4K

Last year

Trend: +47.5% (30d vs prior 30d)

r2u CRAN

393

Last 30 days

1.6K

Last 90 days

8.2K

Last year

Trend: -25% (30d vs prior 30d)

autoCRAN

0

Last 7 days

19

Last 30 days

0

All-time

autoCRAN-only: this name is served only by autoCRAN, so the count is exact.

conda-forge CRAN

226

Last 30 days

719

Last 90 days

5.4K

Last year

Trend: -38.9% (30d vs prior 30d)

CRAN Check Status

13 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Jun 23, 2026
ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Jun 20, 2026
ERROR r-devel-linux-x86_64-fedora-gcc

examples

Running examples in ‘rstanarm-Ex.R’ failed
The error most likely occurred in:

> ### Name: stan_betareg
> ### Title: Bayesian beta regression models via Stan
> ### Aliases: stan_betareg stan_betareg.fit
> 
> ### ** Examples
> 
> if (.Platform$OS.type
...[truncated]...
m = "optimizing" # just for speed of example
+  ) 
+ print(fit, digits = 2)
+ }
Error in stan_betareg(y ~ x | z, data = fake_dat, link = "logit", link.phi = "log",  : 
  Please install the betareg package before using 'stan_betareg'.
Execution halted
OK 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Jun 9, 2026
ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Jun 7, 2026
ERROR r-devel-linux-x86_64-debian-gcc

for unstated dependencies in examples

Warning in file(out, "wt") :
  cannot open file '/tmp/Rtmp9FDzbr/fileca42e572e9db3/pp_validate.R': No space left on device
Error in file(out, "wt") : cannot open the connection
Execution halted
OK 12 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Apr 25, 2026
NOTE 11 OK · 3 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Apr 22, 2026
NOTE r-oldrel-macos-arm64

installed package size

installed size is 312.4Mb
  sub-directories of 1Mb or more:
    R       2.1Mb
    doc     4.8Mb
    libs  304.5Mb
NOTE r-oldrel-macos-x86_64

installed package size

installed size is 314.8Mb
  sub-directories of 1Mb or more:
    R       2.0Mb
    doc     4.8Mb
    libs  307.0Mb
NOTE r-oldrel-windows-x86_64

installed package size

installed size is 20.6Mb
  sub-directories of 1Mb or more:
    R      1.8Mb
    doc    4.8Mb
    libs  13.0Mb
ERROR 10 OK · 3 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Apr 18, 2026
ERROR r-devel-windows-x86_64

whether package can be installed

Installation failed.
See 'd:/Rcompile/CRANpkg/local/4.6/rstanarm.Rcheck/00install.out' for details.
NOTE r-oldrel-macos-arm64

installed package size

installed size is 312.4Mb
  sub-directories of 1Mb or more:
    R       2.1Mb
    doc     4.8Mb
    libs  304.5Mb
NOTE r-oldrel-macos-x86_64

installed package size

installed size is 314.8Mb
  sub-directories of 1Mb or more:
    R       2.0Mb
    doc     4.8Mb
    libs  307.0Mb
NOTE r-oldrel-windows-x86_64

installed package size

installed size is 20.6Mb
  sub-directories of 1Mb or more:
    R      1.8Mb
    doc    4.8Mb
    libs  13.0Mb
NOTE 11 OK · 3 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026
NOTE r-oldrel-macos-arm64

installed package size

installed size is 312.4Mb
  sub-directories of 1Mb or more:
    R       2.1Mb
    doc     4.8Mb
    libs  304.5Mb
NOTE r-oldrel-macos-x86_64

installed package size

installed size is 314.8Mb
  sub-directories of 1Mb or more:
    R       2.0Mb
    doc     4.8Mb
    libs  307.0Mb
NOTE r-oldrel-windows-x86_64

installed package size

installed size is 20.6Mb
  sub-directories of 1Mb or more:
    R      1.8Mb
    doc    4.8Mb
    libs  13.0Mb

Code

Structure

Lines of code

107,421

Files

355

Compiled share

57.8%

Has compiled src

Yes

Language breakdown

R 23,563 (21.9%)C/C++/src 62,132 (57.8%)Tests 5,713 (5.3%)Docs 8,598 (8%)Vignettes 7,415 (6.9%)

API

Exported functions

90

Internal functions

431

Recent export changes

v2.9.0-4+2 posterior_vs_prior, pp_validate
v2.9.0-3−1 ppcheck

Testing & CI

Has tests

Yes

Test-to-code ratio

0.24

testthat edition

CI present

No

CI type

[]

PR gated

No

Docs

Return-value doc rate

87.8%

\dontrun example ratio

0%

Roxygen coverage

100%

Has pkgdown

No

NEWS present

Yes

Health & Security signals

Informational signals; not verdicts.

on.exit coverage

50%

Unsafe pattern score

12

Dep constraint coverage

70.6%

Secret pattern count

0

Bundled 3rd-party code

2 items

Portability & License

Min R version

3.4.0

System requirements

3

C++ standard

C++17

License

GPL (>= 3)

License flags

SPDX valid, OSI approved

History

Versions

23

First release

2016-01-09

Latest release

2025-09-30

Avg cadence

97 days

Cold removal rate

100%

Dep drift

20

LOC over versions

v2.9.0-1: 24,876 LOCv2.9.0-3: 27,437 LOCv2.9.0-4: 27,799 LOCv2.10.1: 28,935 LOCv2.11.1: 29,550 LOCv2.12.1: 29,584 LOCv2.13.1: 31,321 LOCv2.14.1: 38,064 LOCv2.15.2: 39,556 LOCv2.15.3: 39,502 LOCv2.17.2: 43,209 LOCv2.17.3: 43,222 LOCv2.17.4: 45,085 LOCv2.18.1: 45,520 LOCv2.18.2: 45,528 LOCv2.19.2: 47,779 LOCv2.19.3: 48,237 LOCv2.21.1: 48,536 LOCv2.21.3: 49,672 LOCv2.21.4: 49,692 LOCv2.26.1: 50,102 LOCv2.32.1: 50,115 LOCv2.32.2: 107,421 LOC

Per-file churn detail lives in the source pipeline: https://github.com/r-observatory/cran-code-metrics.

Reverse Dependencies (52)

depends

Dependency Network

Dependencies Reverse dependencies Rcpp bayesplot ggplot2 lme4 loo Matrix nlme posterior rstan rstantools shinystan survival RcppParallel reformulas AuxSurvey fbst BayesERtools IRexamples JMbdirect SIMPLE.REGRESSION bayesrules jmBIG outstandR tidyposterior webSDM BayesPostEst CLRtools INLAjoint RBesT +37 more reverse deps rstanarm

Version History

24 tracked
new 2.32.2 Mar 10, 2026
updated 2.32.2 ← 2.32.1 diff Sep 29, 2025
updated 2.32.1 ← 2.26.1 diff Jan 18, 2024
updated 2.26.1 ← 2.21.4 diff Sep 13, 2023
updated 2.21.4 ← 2.21.3 diff Apr 7, 2023
updated 2.21.3 ← 2.21.1 diff Apr 8, 2022
updated 2.21.1 ← 2.19.3 diff Jul 19, 2020
updated 2.19.3 ← 2.19.2 diff Feb 10, 2020
updated 2.19.2 ← 2.18.2 diff Oct 2, 2019
updated 2.18.2 ← 2.18.1 diff Nov 9, 2018
updated 2.18.1 ← 2.17.4 diff Oct 20, 2018
updated 2.17.4 ← 2.17.3 diff Apr 12, 2018
updated 2.17.3 ← 2.17.2 diff Feb 17, 2018
updated 2.17.2 ← 2.15.3 diff Dec 20, 2017
updated 2.15.3 ← 2.15.2 diff Apr 28, 2017