# Issue with rstanarm stan\_lm

**URL:** <https://discourse.mc-stan.org/t/issue-with-rstanarm-stan-lm/3736>\
**Category:** rstanarm\
**Created:** [March 30, 2018, 7:09pm UTC](https://discourse.mc-stan.org/t/issue-with-rstanarm-stan-lm/3736 "2018-03-30T19:09:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daphna\_Harel](https://avatars.discourse-cdn.com/v4/letter/d/d78d45/32.png) [@Daphna\_Harel](https://discourse.mc-stan.org/u/Daphna_Harel)\
**Post date:** [March 30, 2018, 7:09pm UTC](https://discourse.mc-stan.org/t/issue-with-rstanarm-stan-lm/3736/1 "2018-03-30T19:09:19Z")

</div>

Hello,

I am trying to fit a simple stan\_lm on some simulated data and I’m getting an error that says “please report bug”. Any ideas about what is going wrong?

library(rstanarm)

X = matrix(rnorm(500), nrow = 100)  
Y = 3+X%\*%c(1,2,3,0.5,0.5)

data = as.data.frame(cbind(Y,X))

model \<- stan\_lm(V1~V2 + V3+ V4+ V5+V6, data = data, prior = R2(location = 0.2))  
model

---

<div class="post-metadata">

**Author:** ![bgoodri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bgoodri/32/4451_2.png) [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Post date:** [March 30, 2018, 7:27pm UTC](https://discourse.mc-stan.org/t/issue-with-rstanarm-stan-lm/3736/2 "2018-03-30T19:27:05Z")

</div>

Your model has no error term and thus it cannot initialize with the default values, which is what all the preceding warning messages are about. I would recommend trying

```
Y <- 3 + X %*% c(1,2,3,0.5,0.5) + rnorm(500)

```

or something similar.
