Package: rstanarm 2.32.2

Ben Goodrich

rstanarm: Bayesian Applied Regression Modeling via Stan

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.

Authors:Jonah Gabry [aut], Imad Ali [ctb], Sam Brilleman [ctb], Jacqueline Buros Novik [ctb], AstraZeneca [ctb], Trustees of Columbia University [cph], Simon Wood [cph], R Core Deveopment Team [cph], Douglas Bates [cph], Martin Maechler [cph], Ben Bolker [cph], Steve Walker [cph], Brian Ripley [cph], William Venables [cph], Paul-Christian Burkner [cph], Ben Goodrich [cre, aut]

rstanarm_2.32.2.tar.gz
rstanarm_2.32.2.zip(r-4.6)rstanarm_2.32.2.zip(r-4.5)rstanarm_2.32.2.zip(r-4.4)
rstanarm_2.32.2.tgz(r-4.5-x86_64)rstanarm_2.32.2.tgz(r-4.5-arm64)rstanarm_2.32.2.tgz(r-4.4-x86_64)rstanarm_2.32.2.tgz(r-4.4-arm64)
rstanarm_2.32.2.tar.gz(r-4.6-arm64)rstanarm_2.32.2.tar.gz(r-4.6-x86_64)rstanarm_2.32.2.tar.gz(r-4.5-arm64)rstanarm_2.32.2.tar.gz(r-4.5-x86_64)
rstanarm.pdf |rstanarm.html
rstanarm/json (API)
NEWS

# Install 'rstanarm' in R:
install.packages('rstanarm', repos = c('https://community.r-multiverse.org', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/stan-dev/rstanarm/issues

Pkgdown site:https://mc-stan.org

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:
  • bball1970 - Datasets for rstanarm examples
  • bball2006 - Datasets for rstanarm examples
  • kidiq - Datasets for rstanarm examples
  • mortality - Datasets for rstanarm examples
  • pbcLong - Datasets for rstanarm examples
  • pbcSurv - Datasets for rstanarm examples
  • radon - Datasets for rstanarm examples
  • roaches - Datasets for rstanarm examples
  • tumors - Datasets for rstanarm examples
  • wells - Datasets for rstanarm examples

On CRAN:

Conda:

bayesianbayesian-data-analysisbayesian-inferencebayesian-methodsbayesian-statisticsmultilevel-modelsrstanrstanarmstanstatistical-modelingcpp

13.70 score 399 stars 13 packages 35k downloads 70 mentions 90 exports 114 dependencies

Last updated from:aabb521eeb (on v2.32.2). Checks:9 OK, 3 NOTE, 1 FAIL. Indexed: no.

TargetResultTotal timeArtifact
linux-devel-arm64OK981
linux-devel-x86_64OK961
source / vignettesOK1578
linux-release-arm64OK983
linux-release-x86_64OK924
macos-release-arm64OK835
macos-release-x86_64OK1417
macos-oldrel-arm64NOTE924
macos-oldrel-x86_64NOTE1532
windows-develOK1495
windows-releaseOK1438
windows-oldrelNOTE1387
wasm-releaseFAIL188

Exports:as_drawsas_draws_arrayas_draws_dfas_draws_listas_draws_matrixas_draws_rvarsbayes_R2cauchycompare_modelsdecovdefault_prior_coefdefault_prior_interceptdirichletexponentialfixefget_xget_yget_zhshs_plusinvlogitkfoldlaplacelassolaunch_shinystanlkjlog_liklogitlooloo_compareloo_linpredloo_model_weightsloo_predictloo_predictive_intervalloo_R2neg_binomial_2ngrpsnormalnsamplespairs_conditionpairs_style_npplot_nonlinearplot_stack_jmposterior_epredposterior_intervalposterior_linpredposterior_predictposterior_survfitposterior_trajposterior_vs_priorpp_checkpp_validatepredictive_errorpredictive_intervalprior_optionsprior_summaryproduct_normalps_checkR2ranefsesigmastan_aovstan_betaregstan_betareg.fitstan_biglmstan_biglm.fitstan_clogitstan_gamm4stan_glmstan_glm.fitstan_glm.nbstan_glmerstan_glmer.nbstan_jmstan_lmstan_lm.fitstan_lm.wfitstan_lmerstan_mvmerstan_nlmerstan_polrstan_polr.fitstanjm_liststanmvreg_liststanreg_liststudent_tSurvVarCorrwaic

Dependencies:abindbackportsbase64encbayesplotBHbootbslibcachemcallrcheckmateclicolourpickercommonmarkcpp11crosstalkdescdigestdistributionaldplyrDTdygraphsevaluatefarverfastmapfontawesomefsgenericsggplot2ggridgesgluegridExtragtablegtoolshighrhtmltoolshtmlwidgetshttpuvigraphinlineisobandjquerylibjsonliteknitrlabelinglaterlatticelazyevallifecyclelitedownlme4loomagrittrmarkdownMASSMatrixmatrixStatsmemoisemimeminiUIminqanlmenloptrnumDerivpillarpkgbuildpkgconfigplyrposteriorprocessxpromisespspurrrQuickJSRR6rappdirsrbibutilsRColorBrewerRcppRcppEigenRcppParallelRdpackreformulasreshape2rlangrmarkdownrstanrstantoolsS7sassscalesshinyshinyjsshinystanshinythemessourcetoolsStanHeadersstringistringrsurvivaltensorAthreejstibbletidyrtidyselecttinytexutf8vctrsviridisLitewithrxfunxtablextsyamlzoo

Hierarchical Partial Pooling for Repeated Binary Trials

Rendered frompooling.Rmdusingknitr::rmarkdownon Oct 06 2025.

Last update: 2025-09-29
Started: 2016-02-09

How to Use the rstanarm Package

Rendered fromrstanarm.Rmdusingknitr::rmarkdownon Oct 06 2025.

Last update: 2025-09-29
Started: 2015-08-29

MRP with rstanarm

Rendered frommrp.Rmdusingknitr::rmarkdownon Oct 06 2025.

Last update: 2020-01-15
Started: 2019-09-16

Prior Distributions for rstanarm Models

Rendered frompriors.Rmdusingknitr::rmarkdownon Oct 06 2025.

Last update: 2022-03-16
Started: 2017-04-11

Probabilistic A/B Testing with rstanarm

Rendered fromab-testing.Rmdusingknitr::rmarkdownon Oct 06 2025.

Last update: 2025-10-06
Started: 2020-10-15

Estimating ANOVA Models with rstanarm

Rendered fromaov.Rmdusingknitr::rmarkdownon Oct 06 2025.

Last update: 2020-01-15
Started: 2015-08-31

Modeling Rates/Proportions using Beta Regression with rstanarm

Rendered frombetareg.Rmdusingknitr::rmarkdownon Oct 06 2025.

Last update: 2020-01-15
Started: 2016-12-31

Estimating Generalized Linear Models for Binary and Binomial Data with rstanarm

Rendered frombinomial.Rmdusingknitr::rmarkdownon Oct 06 2025.

Last update: 2025-09-29
Started: 2015-09-03

Estimating Generalized Linear Models for Continuous Data with rstanarm

Rendered fromcontinuous.Rmdusingknitr::rmarkdownon Oct 06 2025.

Last update: 2025-09-29
Started: 2015-12-07

Estimating Generalized Linear Models for Count Data with rstanarm

Rendered fromcount.Rmdusingknitr::rmarkdownon Oct 06 2025.

Last update: 2025-09-29
Started: 2015-09-04

Estimating Generalized (Non-)Linear Models with Group-Specific Terms with rstanarm

Rendered fromglmer.Rmdusingknitr::rmarkdownon Oct 06 2025.

Last update: 2021-05-07
Started: 2016-01-08

Estimating Joint Models for Longitudinal and Time-to-Event Data with rstanarm

Rendered fromjm.Rmdusingknitr::rmarkdownon Oct 06 2025.

Last update: 2022-03-16
Started: 2017-11-11

Estimating Regularized Linear Models with rstanarm

Rendered fromlm.Rmdusingknitr::rmarkdownon Oct 06 2025.

Last update: 2020-01-15
Started: 2015-08-30

Estimating Ordinal Regression Models with rstanarm

Rendered frompolr.Rmdusingknitr::rmarkdownon Oct 06 2025.

Last update: 2020-01-15
Started: 2015-09-02

Readme and manuals

Help Manual

Help pageTopics
Applied Regression Modeling via RStanrstanarm-package rstanarm
'adapt_delta': Target average acceptance probabilityadapt_delta
Extract the posterior sampleas.array.stanreg as.data.frame.stanreg as.matrix.stanreg
Estimation algorithms available for 'rstanarm' modelsavailable-algorithms
Modeling functions available in 'rstanarm'available-models
Compute a Bayesian version of R-squared or LOO-adjusted R-squared for regression models.bayes_R2 bayes_R2.stanreg loo_R2 loo_R2.stanreg
Example joint longitudinal and time-to-event modelexample_jm
Example modelexample_model
K-fold cross-validationkfold kfold.stanreg
Using the ShinyStan GUI with rstanarm modelslaunch_shinystan launch_shinystan.stanreg
Pointwise log-likelihood matrixlog_lik log_lik.stanjm log_lik.stanmvreg log_lik.stanreg
Logit and inverse logitinvlogit logit
Compute weighted expectations using LOOloo_linpred loo_linpred.stanreg loo_predict loo_predict.stanreg loo_predictive_interval loo_predictive_interval.stanreg
Information criteria and cross-validationcompare_models loo loo.stanreg loo_compare loo_compare.stanreg loo_compare.stanreg_list loo_model_weights loo_model_weights.stanreg_list waic waic.stanreg
Family function for negative binomial GLMsneg_binomial_2
Methods for stanreg objectscoef.stanreg confint.stanreg fitted.stanreg fixef fixef.stanreg ngrps ngrps.stanreg nobs.stanmvreg nobs.stanreg nsamples nsamples.stanreg ranef ranef.stanreg residuals.stanreg se.stanreg sigma sigma.stanreg stanreg-methods update.stanreg VarCorr VarCorr.stanreg vcov.stanreg
Pairs method for stanreg objectspairs.stanreg pairs_condition pairs_style_np
Plot the estimated subject-specific or marginal longitudinal trajectoryplot.predict.stanjm
Plot method for stanreg objectsplot.stanreg
Plot the estimated subject-specific or marginal survival functionplot.survfit.stanjm plot_stack_jm
Posterior uncertainty intervalsposterior_interval posterior_interval.stanreg
Posterior distribution of the (possibly transformed) linear predictorposterior_epred posterior_epred.stanreg posterior_linpred posterior_linpred.stanreg
Draw from posterior predictive distributionposterior_predict posterior_predict.stanmvreg posterior_predict.stanreg
Estimate subject-specific or standardised survival probabilitiesposterior_survfit
Estimate the subject-specific or marginal longitudinal trajectoryposterior_traj
Juxtapose prior and posteriorposterior_vs_prior posterior_vs_prior.stanreg
Graphical posterior predictive checkspp_check pp_check.stanreg
Model validation via simulationpp_validate
Predict method for stanreg objectspredict.stanreg
In-sample or out-of-sample predictive errorspredictive_error predictive_error.matrix predictive_error.ppd predictive_error.stanreg
Predictive intervalspredictive_interval predictive_interval.matrix predictive_interval.ppd predictive_interval.stanreg
Print method for stanreg objectsprint.stanmvreg print.stanreg
Summarize the priors used for an rstanarm modelprior_summary prior_summary.stanreg
Prior distributions and optionscauchy decov default_prior_coef default_prior_intercept dirichlet exponential hs hs_plus laplace lasso lkj normal priors product_normal R2 student_t
Graphical checks of the estimated survival functionps_check
The 'QR' argumentQR-argument
Datasets for rstanarm examplesbball1970 bball2006 kidiq mortality pbcLong pbcSurv radon roaches rstanarm-datasets tumors wells
Deprecated functionsprior_options rstanarm-deprecated
Bayesian regularized linear models via Stanstan_aov stan_lm stan_lm.fit stan_lm.wfit
Bayesian beta regression models via Stanstan_betareg stan_betareg.fit
Bayesian regularized linear but big models via Stanstan_biglm stan_biglm.fit
Conditional logistic (clogit) regression models via Stanstan_clogit
Bayesian generalized linear additive models with optional group-specific terms via Stanplot_nonlinear stan_gamm4
Bayesian generalized linear models via Stanstan_glm stan_glm.fit stan_glm.nb
Bayesian generalized linear models with group-specific terms via Stanstan_glmer stan_glmer.nb stan_lmer
Bayesian joint longitudinal and time-to-event models via Stanstan_jm
Bayesian multivariate generalized linear models with correlated group-specific terms via Stanstan_mvmer
Bayesian nonlinear models with group-specific terms via Stanstan_nlmer
Bayesian ordinal regression models via Stanstan_polr stan_polr.fit
Methods for stanmvreg objectscoef.stanmvreg fitted.stanmvreg fixef.stanmvreg formula.stanmvreg ngrps.stanmvreg ranef.stanmvreg residuals.stanmvreg se.stanmvreg sigma.stanmvreg stanmvreg-methods update.stanjm update.stanmvreg
Create lists of fitted model objects, combine them, or append new models to existing lists of models.print.stanreg_list stanjm_list stanmvreg_list stanreg_list
Create a 'draws' object from a 'stanreg' objectas_draws as_draws.stanreg as_draws_array as_draws_array.stanreg as_draws_df as_draws_df.stanreg as_draws_list as_draws_list.stanreg as_draws_matrix as_draws_matrix.stanreg as_draws_rvars as_draws_rvars.stanreg stanreg-draws-formats
Fitted model objectsstanreg-objects
Summary method for stanreg objectsas.data.frame.summary.stanreg print.summary.stanmvreg print.summary.stanreg summary.stanmvreg summary.stanreg