# rstanarm

**URL:** https://discourse.mc-stan.org/c/interfaces/rstanarm/27.md?page=3

[Latest](https://discourse.mc-stan.org/latest.md) · [Categories](https://discourse.mc-stan.org/categories.md) · [Tags](https://discourse.mc-stan.org/tags.md)

**Page:** 4

---

## [Priors and scale adjustments for regression coefficients](https://discourse.mc-stan.org/t/priors-and-scale-adjustments-for-regression-coefficients/18597)

<div class="topic-metadata">

**Author:** [@Theo](https://discourse.mc-stan.org/u/Theo)\
**Replies:** 1\
**Last updated:** [October 20, 2020, 10:44pm UTC](https://discourse.mc-stan.org/t/priors-and-scale-adjustments-for-regression-coefficients/18597 "2020-10-20T22:44:09Z")

</div>

Hello, I am trying to understand how the scale of priors for regression coefficients is adjusted on rstanarm. I read https://mc-stan.org/rstanarm/articles/priors.html, however, I can’t find the same scale adjustment whe…

---

## [Obtaining effect size from “rstanarm” package's linear regression](https://discourse.mc-stan.org/t/obtaining-effect-size-from-rstanarm-packages-linear-regression/3601)

<div class="topic-metadata">

**Author:** [@izeh](https://discourse.mc-stan.org/u/izeh)\
**Replies:** 23\
**Last updated:** [October 10, 2020, 4:09pm UTC](https://discourse.mc-stan.org/t/obtaining-effect-size-from-rstanarm-packages-linear-regression/3601 "2020-10-10T16:09:13Z")

</div>

In my study a control group © is pretested (pre.c) and post-tested (pos.c). Similarly a treatment group (t) is prettested (pre.t) and post-tested (pos.t). So I have two groups (group factor) tested at two time points (ti…

---

## [How to know the exact predictors](https://discourse.mc-stan.org/t/how-to-know-the-exact-predictors/18204)

<div class="topic-metadata">

**Author:** [@wati](https://discourse.mc-stan.org/u/wati)\
**Replies:** 1\
**Last updated:** [September 25, 2020, 6:35pm UTC](https://discourse.mc-stan.org/t/how-to-know-the-exact-predictors/18204 "2020-09-25T18:35:50Z")

</div>

Hi everbody, I am trying to pass specific priors for all predictors to stan\_glm. But so far, I don’t know the exact predictors before the sampling, especially when there are interactions between factors. So actually, …

---

## [Conditional effects from stan\_clogit fit](https://discourse.mc-stan.org/t/conditional-effects-from-stan-clogit-fit/17587)

<div class="topic-metadata">

**Author:** [@benskov](https://discourse.mc-stan.org/u/benskov)\
**Replies:** 7\
**Last updated:** [September 11, 2020, 11:36am UTC](https://discourse.mc-stan.org/t/conditional-effects-from-stan-clogit-fit/17587 "2020-09-11T11:36:45Z")

</div>

Dear all, I’ve used rstanarm::stan\_clogit to estimate the effect of a certain intervention on mortality. In short, our design is a matched risk-set case-control study with 1 case and 5 controls per risk set/stratum. I u…

---

## [What is stan\_glm(algorithm = "optimizing") doing?](https://discourse.mc-stan.org/t/what-is-stan-glm-algorithm-optimizing-doing/17899)

<div class="topic-metadata">

**Author:** [@git314](https://discourse.mc-stan.org/u/git314)\
**Replies:** 1\
**Last updated:** [September 7, 2020, 5:08pm UTC](https://discourse.mc-stan.org/t/what-is-stan-glm-algorithm-optimizing-doing/17899 "2020-09-07T17:08:36Z")

</div>

I am just curious what is stan\_glm(algorithm = “optimizing”) doing?

---

## [Interpretation of stan\_surv with categorical variables in rstanarm](https://discourse.mc-stan.org/t/interpretation-of-stan-surv-with-categorical-variables-in-rstanarm/17771)

<div class="topic-metadata">

**Author:** [@nohemihuanca](https://discourse.mc-stan.org/u/nohemihuanca)\
**Replies:** 6\
**Last updated:** [September 4, 2020, 5:30am UTC](https://discourse.mc-stan.org/t/interpretation-of-stan-surv-with-categorical-variables-in-rstanarm/17771 "2020-09-04T05:30:18Z")

</div>

Hello, I am trying to compare survival between site and treatment (categorical variables) in rstanarm using stan\_surv(). I am first looking to compare the hazard of death and I am not sure if my interpretation is correc…

---

## [Speed issues since upgrading to RStan v2.21.2](https://discourse.mc-stan.org/t/speed-issues-since-upgrading-to-rstan-v2-21-2/17424)

<div class="topic-metadata">

**Author:** [@willte](https://discourse.mc-stan.org/u/willte)\
**Replies:** 39\
**Last updated:** [August 30, 2020, 3:24pm UTC](https://discourse.mc-stan.org/t/speed-issues-since-upgrading-to-rstan-v2-21-2/17424 "2020-08-30T15:24:57Z")

</div>

Since upgrading to RStudio (v1.3.1056), RTools (v4.0) and Rstan (2.21.2), the time it takes my model to run seems to have roughly 2x-3xed. I appreciate it could be so many things but I was just wondering if anything jump…

---

## [Intercept only model](https://discourse.mc-stan.org/t/intercept-only-model/12962)

<div class="topic-metadata">

**Author:** [@Geoffrey\_Simmons](https://discourse.mc-stan.org/u/Geoffrey_Simmons)\
**Replies:** 7\
**Last updated:** [August 26, 2020, 2:43am UTC](https://discourse.mc-stan.org/t/intercept-only-model/12962 "2020-08-26T02:43:50Z")

</div>

Operating System: Windows rstanarm Version: 2.19.2 I have a relatively simple problem - an assumed mean and variance for a normally distributed variable, followed by a few data observations (just outcomes, no predictor…

---

## [Knitr segfault](https://discourse.mc-stan.org/t/knitr-segfault/17493)

<div class="topic-metadata">

**Author:** [@CHGreene](https://discourse.mc-stan.org/u/CHGreene)\
**Replies:** 2\
**Last updated:** [August 24, 2020, 6:11pm UTC](https://discourse.mc-stan.org/t/knitr-segfault/17493 "2020-08-24T18:11:01Z")

</div>

I’m writing lecture slides using LaTeX beamer and knitr, and regular R code all works: loading libraries (arm and mosaic (a teaching package)), lm, xyplot, etc. I’m having segfaults just for loading the rstanarm library…

---

## [Gage R&R - Residuals and Repeatability](https://discourse.mc-stan.org/t/gage-r-r-residuals-and-repeatability/17426)

<div class="topic-metadata">

**Author:** [@Elef](https://discourse.mc-stan.org/u/Elef)\
**Replies:** 4\
**Last updated:** [August 24, 2020, 6:06pm UTC](https://discourse.mc-stan.org/t/gage-r-r-residuals-and-repeatability/17426 "2020-08-24T18:06:50Z")

</div>

Hi, I have tried to run something similar to Gage R&R and I have got the following results. According to Gage R&R the residuals should be the Repeatability which here should be 20.90. However, as there are 4 products…

---

## [Pop-up errors after updating rstanarm and rstan](https://discourse.mc-stan.org/t/pop-up-errors-after-updating-rstanarm-and-rstan/17461)

<div class="topic-metadata">

**Author:** [@mbschrimpf](https://discourse.mc-stan.org/u/mbschrimpf)\
**Replies:** 10\
**Last updated:** [August 16, 2020, 9:36pm UTC](https://discourse.mc-stan.org/t/pop-up-errors-after-updating-rstanarm-and-rstan/17461 "2020-08-16T21:36:06Z")

</div>

Hi, This morning I updated the rstanarm package (through Rstudio, Windows 10). At first things appeared to work normally, but then I started getting annoying pop-up messages that read: rsession.exe - Entry Point Not Fo…

---

## [Stan\_aov in R....why doesn't it work?](https://discourse.mc-stan.org/t/stan-aov-in-r-why-doesnt-it-work/17419)

<div class="topic-metadata">

**Author:** [@Thomas\_Richardson](https://discourse.mc-stan.org/u/Thomas_Richardson)\
**Replies:** 5\
**Last updated:** [August 13, 2020, 9:04pm UTC](https://discourse.mc-stan.org/t/stan-aov-in-r-why-doesnt-it-work/17419 "2020-08-13T21:04:10Z")

</div>

I can’t get a simple ancova to run in rstanarm. I can get the bayesian linear model with dummy variables to work fine (which is supposed to be equivalent?) but not the ancova, and unfortunately that’s what my coauthors d…

---

## [Posterior\_survfit() is not using the nd](https://discourse.mc-stan.org/t/posterior-survfit-is-not-using-the-nd/17185)

<div class="topic-metadata">

**Author:** [@nohemihuanca](https://discourse.mc-stan.org/u/nohemihuanca)\
**Replies:** 4\
**Last updated:** [August 9, 2020, 3:55am UTC](https://discourse.mc-stan.org/t/posterior-survfit-is-not-using-the-nd/17185 "2020-08-09T03:55:18Z")

</div>

Hello, I am having trouble generating posterior predictions using posterior\_survfit(). I am trying to use a new data frame, but it is not using the new data frame and instead is using values from the dataset I used to fi…

---

## [Formula syntax in rstanarm differences](https://discourse.mc-stan.org/t/formula-syntax-in-rstanarm-differences/17286)

<div class="topic-metadata">

**Author:** [@fazepher](https://discourse.mc-stan.org/u/fazepher)\
**Replies:** 2\
**Last updated:** [August 6, 2020, 9:55pm UTC](https://discourse.mc-stan.org/t/formula-syntax-in-rstanarm-differences/17286 "2020-08-06T21:55:33Z")

</div>

I am not an expert on the formula syntax for specifying models. I understand that it is always assumed that there is an intercept so that y ~ 1 + x would be equivalent to y ~ x. I think this is the case, regardless of v…

---

## [Errors producing a prior predictive distribution using smoothers in stan\_gamm4 with rstanarm](https://discourse.mc-stan.org/t/errors-producing-a-prior-predictive-distribution-using-smoothers-in-stan-gamm4-with-rstanarm/16620)

<div class="topic-metadata">

**Author:** [@kaybenleroll](https://discourse.mc-stan.org/u/kaybenleroll)\
**Replies:** 8\
**Last updated:** [August 4, 2020, 4:39pm UTC](https://discourse.mc-stan.org/t/errors-producing-a-prior-predictive-distribution-using-smoothers-in-stan-gamm4-with-rstanarm/16620 "2020-08-04T16:39:47Z")

</div>

I am having difficulty generating a prior predictive distribution for my count model when I try to add smooth predictors to the model. I have included a reproducible example below where I generate the input data (much m…

---

## [Loo with k\_threshold error for stan\_polr()](https://discourse.mc-stan.org/t/loo-with-k-threshold-error-for-stan-polr/17052)

<div class="topic-metadata">

**Author:** [@tomli](https://discourse.mc-stan.org/u/tomli)\
**Replies:** 23\
**Last updated:** [August 4, 2020, 9:04am UTC](https://discourse.mc-stan.org/t/loo-with-k-threshold-error-for-stan-polr/17052 "2020-08-04T09:04:44Z")

</div>

I’ve fitted models with stan\_polr and want to compare fits by loo. Some models have problematic Pareto k observations, and I’m trying to refit with exact loo for these observations. However, when I call loo(WL,k\_threshol…

---

## [New rstanarm user, having issues running my first model (error says there is a bug)](https://discourse.mc-stan.org/t/new-rstanarm-user-having-issues-running-my-first-model-error-says-there-is-a-bug/17105)

<div class="topic-metadata">

**Author:** [@bneuwirth](https://discourse.mc-stan.org/u/bneuwirth)\
**Replies:** 2\
**Last updated:** [July 30, 2020, 3:30pm UTC](https://discourse.mc-stan.org/t/new-rstanarm-user-having-issues-running-my-first-model-error-says-there-is-a-bug/17105 "2020-07-30T15:30:47Z")

</div>

Hello! I am new to rstanarm, and am having trouble getting up and running. I tried to follow the instructions in a previous post about this, but it still isn’t work for me. I was able to install rstan and rstanarm, but …

---

## [Transform Z matrix](https://discourse.mc-stan.org/t/transform-z-matrix/16619)

<div class="topic-metadata">

**Author:** [@retodomax](https://discourse.mc-stan.org/u/retodomax)\
**Replies:** 5\
**Last updated:** [July 26, 2020, 12:56pm UTC](https://discourse.mc-stan.org/t/transform-z-matrix/16619 "2020-07-26T12:56:16Z")

</div>

My goal is to incorporate correlation structure between the random effects which is by default not supported by rstanarm/lme4. The idea is to transform the Z matrix in the linear predictor X\\beta + Zb such that it accoun…

---

## [Unable to install rstanarm both with reference to Survival and without any reference](https://discourse.mc-stan.org/t/unable-to-install-rstanarm-both-with-reference-to-survival-and-without-any-reference/16125)

<div class="topic-metadata">

**Author:** [@MaryBo](https://discourse.mc-stan.org/u/MaryBo)\
**Replies:** 3\
**Last updated:** [June 26, 2020, 6:29am UTC](https://discourse.mc-stan.org/t/unable-to-install-rstanarm-both-with-reference-to-survival-and-without-any-reference/16125 "2020-06-26T06:29:20Z")

</div>

Hi everybody, I have the same problem. I want to install ‘rstanarm’ on windows with these commands: devtools::install\_github(“stan-dev/rstanarm”,ref = “feature/survival”, build\_vignettes = FALSE) It installed after u…

---

## [Trsnalte winBug model to get rstamarm to get the same results](https://discourse.mc-stan.org/t/trsnalte-winbug-model-to-get-rstamarm-to-get-the-same-results/15716)

<div class="topic-metadata">

**Author:** [@Rani](https://discourse.mc-stan.org/u/Rani)\
**Replies:** 1\
**Last updated:** [June 12, 2020, 8:38pm UTC](https://discourse.mc-stan.org/t/trsnalte-winbug-model-to-get-rstamarm-to-get-the-same-results/15716 "2020-06-12T20:38:03Z")

</div>

Dear All, how I can translate this winBug model for studying the treatment effect to rstanarm interface, using rstanarm package taking into account all the parameters defined below: and thanks in advance: \> mydata = d…

---

## [Odds ratio and querying posterior with different priors with stan\_glm function](https://discourse.mc-stan.org/t/odds-ratio-and-querying-posterior-with-different-priors-with-stan-glm-function/15231)

<div class="topic-metadata">

**Author:** [@Rani](https://discourse.mc-stan.org/u/Rani)\
**Replies:** 3\
**Last updated:** [May 30, 2020, 10:00am UTC](https://discourse.mc-stan.org/t/odds-ratio-and-querying-posterior-with-different-priors-with-stan-glm-function/15231 "2020-05-30T10:00:57Z")

</div>

Hello, Regarding the example here with standard package and stan\_glm() function for Bayesian logistic regression https://www.kaggle.com/avehtari/bayesian-logistic-regression-with-rstanarm library(rstanarm) options(mc.…

---

## [Relative Risk (RR) and absolute reduction in relative risk (ARR) with stan\_glm](https://discourse.mc-stan.org/t/relative-risk-rr-and-absolute-reduction-in-relative-risk-arr-with-stan-glm/15446)

<div class="topic-metadata">

**Author:** [@Rani](https://discourse.mc-stan.org/u/Rani)\
**Replies:** 5\
**Last updated:** [May 29, 2020, 1:55am UTC](https://discourse.mc-stan.org/t/relative-risk-rr-and-absolute-reduction-in-relative-risk-arr-with-stan-glm/15446 "2020-05-29T01:55:59Z")

</div>

Dear all, I would like o to ask about the choice of the family to use to compute RR and ARR, normally for RR I should choose these families in these lines \> str(mydata) 'data.frame': 190 obs. of 2 variables: $ trea…

---

## [Slower and freez machine when run brm model with brms package](https://discourse.mc-stan.org/t/slower-and-freez-machine-when-run-brm-model-with-brms-package/15425)

<div class="topic-metadata">

**Author:** [@Rani](https://discourse.mc-stan.org/u/Rani)\
**Replies:** 24\
**Last updated:** [May 27, 2020, 5:21pm UTC](https://discourse.mc-stan.org/t/slower-and-freez-machine-when-run-brm-model-with-brms-package/15425 "2020-05-27T17:21:29Z")

</div>

Dear all, I want to run the brm model, but it freezes the machine after a few seconds without results, just like the attached picture, could anyone help and thanks in advance. Note: my machine with os Debien 10. libra…

---

## [Joint model with stan\_jm: disallowed association structures](https://discourse.mc-stan.org/t/joint-model-with-stan-jm-disallowed-association-structures/14848)

<div class="topic-metadata">

**Author:** [@camposfa](https://discourse.mc-stan.org/u/camposfa)\
**Replies:** 2\
**Last updated:** [May 7, 2020, 12:59am UTC](https://discourse.mc-stan.org/t/joint-model-with-stan-jm-disallowed-association-structures/14848 "2020-05-07T00:59:43Z")

</div>

I’m interested in fitting a joint model using stan\_jm(), similar to the model described in this vignette, with a longitudinal biomarker submodel and a time-to-event (survival) submodel. One association structure that I’…

---

## [Robust conditional logistic regression with rstanarm::stan\_clogit?](https://discourse.mc-stan.org/t/robust-conditional-logistic-regression-with-rstanarm-stan-clogit/14747)

<div class="topic-metadata">

**Author:** [@benskov](https://discourse.mc-stan.org/u/benskov)\
**Replies:** 2\
**Last updated:** [May 4, 2020, 7:23am UTC](https://discourse.mc-stan.org/t/robust-conditional-logistic-regression-with-rstanarm-stan-clogit/14747 "2020-05-04T07:23:56Z")

</div>

Dear all, We’re (still, I’ve posted a few comments already) preparing a case-control study in which we’d like to use stan\_clogit to estimate the effect of some exposure on mortality. We have quite some patients who are …

---

## [Splines in matched-data analysis with rstanarm](https://discourse.mc-stan.org/t/splines-in-matched-data-analysis-with-rstanarm/14443)

<div class="topic-metadata">

**Author:** [@benskov](https://discourse.mc-stan.org/u/benskov)\
**Replies:** 3\
**Last updated:** [April 21, 2020, 3:37pm UTC](https://discourse.mc-stan.org/t/splines-in-matched-data-analysis-with-rstanarm/14443 "2020-04-21T15:37:33Z")

</div>

Dear all, I’m preparing case-control study with a binary outcome in which I’d like to model the numerical covariates with splines; I’ll have 3-5 controls per case (we didn’t decide finally yet). The model should account…

---

## [Reference on benefits of rstanarm GAM models over frequentist alternatives?](https://discourse.mc-stan.org/t/reference-on-benefits-of-rstanarm-gam-models-over-frequentist-alternatives/14114)

<div class="topic-metadata">

**Author:** [@benskov](https://discourse.mc-stan.org/u/benskov)\
**Replies:** 5\
**Last updated:** [April 20, 2020, 12:58pm UTC](https://discourse.mc-stan.org/t/reference-on-benefits-of-rstanarm-gam-models-over-frequentist-alternatives/14114 "2020-04-20T12:58:22Z")

</div>

Hi everybody, I would like to use rstanarm::stan\_gamm4 for a study we’re preparing, and to substantiate my choice of Bayesian parameter estimation (unfortunately, this is still needed) I’ve come across some these claims…

---

## [Nice printing in R Markdown of stanreg objects](https://discourse.mc-stan.org/t/nice-printing-in-r-markdown-of-stanreg-objects/13450)

<div class="topic-metadata">

**Author:** [@dkane](https://discourse.mc-stan.org/u/dkane)\
**Replies:** 0\
**Last updated:** [March 2, 2020, 2:24pm UTC](https://discourse.mc-stan.org/t/nice-printing-in-r-markdown-of-stanreg-objects/13450 "2020-03-02T14:24:47Z")

</div>

What recommendations do people have for printing out stanreg objects so that they look good in an R Markdown document? I had hoped that either the gtsummary or report packages would work well, but neither do. I co…

---

## [Improving the efficiency of fitting a model using stan\_lmer](https://discourse.mc-stan.org/t/improving-the-efficiency-of-fitting-a-model-using-stan-lmer/14237)

<div class="topic-metadata">

**Author:** [@tin\_oreskovic](https://discourse.mc-stan.org/u/tin_oreskovic)\
**Replies:** 5\
**Last updated:** [April 12, 2020, 12:05pm UTC](https://discourse.mc-stan.org/t/improving-the-efficiency-of-fitting-a-model-using-stan-lmer/14237 "2020-04-12T12:05:14Z")

</div>

Hi everyone. I’m a new rstanarm user, trying to fit the following to estimate the gender wage gap: stan\_lmer(formula = income ~ male + seniority + ( 1 + male + seniority | job), data = data) The dataset contains ~150…

---

## [Does rstanarm::plot\_nonlinear produce marginal or conditional plots?](https://discourse.mc-stan.org/t/does-rstanarm-plot-nonlinear-produce-marginal-or-conditional-plots/13979)

<div class="topic-metadata">

**Author:** [@benskov](https://discourse.mc-stan.org/u/benskov)\
**Replies:** 2\
**Last updated:** [April 6, 2020, 8:57am UTC](https://discourse.mc-stan.org/t/does-rstanarm-plot-nonlinear-produce-marginal-or-conditional-plots/13979 "2020-04-06T08:57:31Z")

</div>

Dear all, I’m preparing a study using rstanarm::stan\_gamm4 to model some continuous variables with splines and wanted to be sure about the output of the rstanarm::plot\_nonlinear. My question stems from i.a. the fact tha…

[Previous page](https://discourse.mc-stan.org/c/interfaces/rstanarm/27.md?page=2)

[Next page](https://discourse.mc-stan.org/c/interfaces/rstanarm/27.md?page=4)
