Questions tagged [rstanarm]

An R package providing an interface for building and running inference for Bayesian regression models.

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.

http://mc-stan.org/rstanarm/

66 questions
0
votes
1 answer

What is "linear.predictors" as extractable from stan_glm() object in "rstanarm" package?

I'm writing to find out what is "linear.predictors" as returned by stan_glm() object. Apparently, "linear.predictors" is not the same as the predictor(s) provided by the user (documentation didn't help). In any case, is there a way to obtain…
rnorouzian
  • 7,397
  • 5
  • 27
  • 72
0
votes
1 answer

"lines()" acting like "polygon()" R?

I'm trying to draw two black lines around a red regression line. But the lines() command draws something more like a polygon() than a simple line (see picture below code). I'm wondering is there a fix to simply draw two lines around the regression…
rnorouzian
  • 7,397
  • 5
  • 27
  • 72
0
votes
1 answer

Problematic `rstanarm::stan_lmer` - invalid internal subsetting

I'm running into the following problem, which appears to be related to subsetting done within rstanarm. See this related problem Error in xj[i] : invalid subscript type 'list' reproducible…
alexwhitworth
  • 4,839
  • 5
  • 32
  • 59
0
votes
1 answer

Calculating credible intervals for marginal effects in binomial logit using rstanarm

In this method for calculating marginal effects for a binomial logit using rstanarm, https://stackoverflow.com/a/45042387/9264004 nd <- md nd$x1 <- 0 p0 <- posterior_linpred(glm1, newdata = nd, transform = TRUE) nd$x1 <- 1 p1 <-…
0
votes
1 answer

rstanarm Prior location must be greater than 0

I am trying to fit a linear model in rstanarm using the hierarchical shrinkage prior. I do however get an error stating that location of the prior must be greater than 0. Error: location > 0 is not TRUE I am kind of surprised, since the hs() prior…
Joaquin
  • 121
  • 9
0
votes
1 answer

Predicting from the full posterior distribution using stan_glmer

Could I ask for some help please? I have fit a binomial model using stan_glmer and have picked the model which I think best fits the data. I have used the posterior predict command to compare my observed data to data simulated by the model and it…
gemster
  • 3
  • 1
1 2 3 4
5