Thanks for clarifying! My confusion about how weights are treated by rstanarm stems from the fact that `?stan_lm`

says that they’re treated the "same as `lm`

".

I don’t think `lm`

can be taking an approach analogous to `normal_lpdf(y[i] | yHat[i], sigma) * weights[i]`

though, because `lm`

weights are invariant to scale:

```
> y <- rnorm(100)
> w <- runif(100)
> fit_w <- lm(y ~ 1, weights = w)
> fit_10w <- lm(y ~ 1, weights = 10*w)
> SE <- function(fit) summary(fit)$coef['(Intercept)', 'Std. Error']
> SE(fit_w) == SE(fit_10w)
[1] TRUE
```

Perhaps it would be clearest to say that weights in rstanarm are replication counts that treat each observation as one or more real observations (analogous to Stata’s fweights).

This would help clarify that scale very much *does* matter for rstanarm weights – the sum of the weights is equal to the number of observations in the original dataset.