Package: rstanarm 2.35.0.9000

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], Eren Elci [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.35.0.9000.tar.gz
rstanarm_2.35.0.9000.zip(r-4.5)rstanarm_2.35.0.9000.zip(r-4.4)rstanarm_2.35.0.9000.zip(r-4.3)
rstanarm_2.35.0.9000.tgz(r-4.4-x86_64)rstanarm_2.35.0.9000.tgz(r-4.4-arm64)rstanarm_2.35.0.9000.tgz(r-4.3-x86_64)rstanarm_2.35.0.9000.tgz(r-4.3-arm64)
rstanarm_2.35.0.9000.tar.gz(r-4.5-noble)rstanarm_2.35.0.9000.tar.gz(r-4.4-noble)
rstanarm.pdf |rstanarm.html
rstanarm/json (API)
NEWS

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

Peer review:

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

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:
  • bball1970 - Datasets for rstanarm examples
  • bball2006 - Datasets for rstanarm examples
  • bcancer - Datasets for rstanarm examples
  • frail - Datasets for rstanarm examples
  • kidiq - Datasets for rstanarm examples
  • mice - 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:

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

103 exports 382 stars 7.97 score 114 dependencies 10 dependents 70 mentions 4.9k scripts 8.2k downloads

Last updated 2 months agofrom:2b405d15ff (on survival-rstantools). Checks:OK: 1 ERROR: 8. Indexed: yes.

TargetResultDate
Doc / VignettesOKAug 22 2024
R-4.5-win-x86_64ERRORAug 22 2024
R-4.5-linux-x86_64ERRORAug 22 2024
R-4.4-win-x86_64ERRORAug 22 2024
R-4.4-mac-x86_64ERRORAug 22 2024
R-4.4-mac-aarch64ERRORAug 22 2024
R-4.3-win-x86_64ERRORAug 22 2024
R-4.3-mac-x86_64ERRORAug 22 2024
R-4.3-mac-aarch64ERRORAug 22 2024

Exports:as_drawsas_draws_arrayas_draws_dfas_draws_listas_draws_matrixas_draws_rvarsbayes_R2cauchycollapse_within_groupscompare_modelsdecovdefault_prior_coefdefault_prior_interceptdirichletevaluate_log_survivalexponentialextract_parsfixefget_model_dataget_survget_xget_yget_zhshs_plusinvlogitkfoldlaplacelassolaunch_shinystanlinear_predictorlinkinvlkjll_argslog_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_checkquadrature_sumR2ranefrename_loossesigmastan_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.fitstan_survstanjm_liststanmvreg_liststanreg_liststudent_tSurvtveunpad_reTrmsVarCorrwaic

Dependencies:abindbackportsbase64encbayesplotBHbootbslibcachemcallrcheckmateclicolorspacecolourpickercommonmarkcpp11crayoncrosstalkdescdigestdistributionaldplyrDTdygraphsevaluatefansifarverfastmapfontawesomefsgenericsggplot2ggridgesgluegridExtragtablegtoolshighrhtmltoolshtmlwidgetshttpuvigraphinlineisobandjquerylibjsonliteknitrlabelinglaterlatticelazyevallifecyclelme4loomagrittrmarkdownMASSMatrixmatrixStatsmemoisemgcvmimeminiUIminqamunsellnlmenloptrnumDerivpillarpkgbuildpkgconfigplyrposteriorprocessxpromisespsQuickJSRR6rappdirsRColorBrewerRcppRcppArmadilloRcppEigenRcppParallelreshape2rlangrmarkdownrstanrstantoolssassscalesshinyshinyjsshinystanshinythemessourcetoolssplines2StanHeadersstringistringrsurvivaltensorAthreejstibbletidyselecttinytexutf8vctrsviridisLitewithrxfunxtablextsyamlzoo

Hierarchical Partial Pooling for Repeated Binary Trials

Rendered frompooling.Rmdusingknitr::rmarkdownon Aug 22 2024.

Last update: 2024-06-03
Started: 2016-02-09

How to Use the rstanarm Package

Rendered fromrstanarm.Rmdusingknitr::rmarkdownon Aug 22 2024.

Last update: 2023-02-07
Started: 2015-08-29

MRP with rstanarm

Rendered frommrp.Rmdusingknitr::rmarkdownon Aug 22 2024.

Last update: 2020-07-24
Started: 2019-10-02

Prior Distributions for rstanarm Models

Rendered frompriors.Rmdusingknitr::rmarkdownon Aug 22 2024.

Last update: 2024-06-03
Started: 2017-04-11

Probabilistic A/B Testing with rstanarm

Rendered fromab-testing.Rmdusingknitr::rmarkdownon Aug 22 2024.

Last update: 2023-02-07
Started: 2023-02-07

stan_aov: Estimating ANOVA Models with rstanarm

Rendered fromaov.Rmdusingknitr::rmarkdownon Aug 22 2024.

Last update: 2024-06-03
Started: 2015-08-31

stan_betareg: Modeling Rates/Proportions using Beta Regression with rstanarm

Rendered frombetareg.Rmdusingknitr::rmarkdownon Aug 22 2024.

Last update: 2024-06-03
Started: 2016-12-31

stan_glm: Estimating Generalized Linear Models for Binary and Binomial Data with rstanarm

Rendered frombinomial.Rmdusingknitr::rmarkdownon Aug 22 2024.

Last update: 2024-06-03
Started: 2015-09-03

stan_glm: Estimating Generalized Linear Models for Continuous Data with rstanarm

Rendered fromcontinuous.Rmdusingknitr::rmarkdownon Aug 22 2024.

Last update: 2024-06-06
Started: 2015-12-07

stan_glm: Estimating Generalized Linear Models for Count Data with rstanarm

Rendered fromcount.Rmdusingknitr::rmarkdownon Aug 22 2024.

Last update: 2024-06-06
Started: 2015-09-04

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

Rendered fromglmer.Rmdusingknitr::rmarkdownon Aug 22 2024.

Last update: 2024-06-03
Started: 2016-01-08

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

Rendered fromjm.Rmdusingknitr::rmarkdownon Aug 22 2024.

Last update: 2024-06-03
Started: 2017-11-11

stan_lm: Estimating Regularized Linear Models with rstanarm

Rendered fromlm.Rmdusingknitr::rmarkdownon Aug 22 2024.

Last update: 2024-06-03
Started: 2015-08-30

stan_polr: Estimating Ordinal Regression Models with rstanarm

Rendered frompolr.Rmdusingknitr::rmarkdownon Aug 22 2024.

Last update: 2024-06-03
Started: 2015-09-02

stan_surv: Estimating Survival (Time-to-Event) Models with rstanarm

Rendered fromsurv.Rmdusingknitr::rmarkdownon Aug 22 2024.

Last update: 2024-06-03
Started: 2018-10-30

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
Collapse the linear predictor across the lower level units clustered an individual, using the function specified in the 'grp_assoc' argumentcollapse_within_groups
Collapse the linear predictor across the lower level units clustered an individual, using the function specified in the 'grp_assoc' argumentcollapse_within_groups.default
Collapse the linear predictor across the lower level units clustered an individual, using the function specified in the 'grp_assoc' argumentcollapse_within_groups.matrix
Evaluate the log baseline hazard at the specified times given the vector or matrix of MCMC draws for the baseline hazard coeffients / parametersevaluate_log_survival
Evaluate the log baseline hazard at the specified times given the vector or matrix of MCMC draws for the baseline hazard coeffients / parametersevaluate_log_survival.default
Evaluate the log baseline hazard at the specified times given the vector or matrix of MCMC draws for the baseline hazard coeffients / parametersevaluate_log_survival.matrix
Example joint longitudinal and time-to-event modelexample_jm
Example modelexample_model
Extract parameters from stanmat and return as a listextract_pars
Extract parameters from stanmat and return as a listextract_pars.stanmvreg
Extract parameters from stanmat and return as a listextract_pars.stansurv
Return a data frame for each submodel that: (1) only includes variables used in the model formula (2) only includes rows contained in the glmod/coxmod model frames (3) ensures that additional variables that are required such as the ID variable or variables used in the interaction-type association structures, are included.get_model_data
Return a data frame for each submodel that: (1) only includes variables used in the model formula (2) only includes rows contained in the glmod/coxmod model frames (3) ensures that additional variables that are required such as the ID variable or variables used in the interaction-type association structures, are included.get_model_data.stanmvreg
Return a data frame for each submodel that: (1) only includes variables used in the model formula (2) only includes rows contained in the glmod/coxmod model frames (3) ensures that additional variables that are required such as the ID variable or variables used in the interaction-type association structures, are included.get_model_data.stansurv
K-fold cross-validationkfold kfold.stanreg
Using the ShinyStan GUI with rstanarm modelslaunch_shinystan launch_shinystan.stanreg
Methods for creating linear predictorlinear_predictor
Methods for creating linear predictorlinear_predictor.default
Methods for creating linear predictorlinear_predictor.matrix
Get inverse link functionlinkinv
Get inverse link functionlinkinv.character
Get inverse link functionlinkinv.family
Get inverse link functionlinkinv.stanmvreg
Get inverse link functionlinkinv.stanreg
get arguments needed for ll_funll_args
Alternative ll_args method for stanjm objects that allows data and pars to be passed directly, rather than constructed using pp_data within the ll_args method. This can be much faster when used in the MH algorithm within posterior_survfit, since it doesn't require repeated calls to pp_data.ll_args.stanjm
get arguments needed for ll_funll_args.stanreg
get arguments needed for ll_funll_args.stansurv
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.stansurv
Plot the estimated subject-specific or marginal survival functionplot.survfit.stanjm plot.survfit.stansurv 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
Posterior predictions for survival modelsposterior_survfit posterior_survfit.stanjm posterior_survfit.stansurv
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.stanmvreg 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
Perform importance sampling with stanreg objectspsis.stanreg
The 'QR' argumentQR-argument
Apply quadrature weights and sum over nodesquadrature_sum
Apply quadrature weights and sum over nodesquadrature_sum.default
Apply quadrature weights and sum over nodesquadrature_sum.matrix
loo/waic/kfold objects created by rstanarm have a model_name attribute. when a stanreg_list is created those attributes should be changed to match the names of the models used for the stanreg_list in case user has specified the model_names argumentrename_loos
Change model_name attributes of a loo/waic/kfold object stored in a stanreg object,rename_loos.stanreg
Change model_name attributes of loo/waic/kfold objects to correspond to model names used for stanreg_listrename_loos.stanreg_list
Datasets for rstanarm examplesbball1970 bball2006 bcancer frail kidiq mice mortality pbcLong pbcSurv radon roaches rstanarm-datasets tumors wells
Deprecated functionsprior_options rstanarm-deprecated
Split a vector or matrix into a specified number of segments and return each segment as an element of a list. The matrix method allows splitting across the column (bycol = TRUE) or row margin (bycol = FALSE).split2
Split a vector or matrix into a specified number of segments and return each segment as an element of a list. The matrix method allows splitting across the column (bycol = TRUE) or row margin (bycol = FALSE).split2.matrix
Split a vector or matrix into a specified number of segments and return each segment as an element of a list. The matrix method allows splitting across the column (bycol = TRUE) or row margin (bycol = FALSE).split2.vector
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
Bayesian survival models via Stanstan_surv
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
Method to truncate a numeric vector at defined limitstruncate.numeric
Time-varying effects in Bayesian survival modelstve
Drop the extra reTrms from a matrix xunpad_reTrms
Drop the extra reTrms from an array xunpad_reTrms.array
Drop the extra reTrms from a matrix xunpad_reTrms.default