2

I am not sure if my results can be trusted.

Let's say I fitted this model with informative priors:

library(rstanarm)
data <- iris[, c("Sepal.Length", "Petal.Width")]
model1 <- stan_glm(Sepal.Length ~ Petal.Width, data=iris, prior=normal(2, 3, autoscale=FALSE))

I would like, then, to update the model with standardized data, to see how standardization change the coefs.

model2 <- update(model1, data=as.data.frame(scale(iris)))

However, I am concerned that the results of model2 cannot be "trusted" as they might be wrongly (i.e., unwantedly) biased as they take into account the non-standardized priors set for model1.

Is there a way to "standardize" the priors so that I can pass them to the update function so that the priors set of model1 are, mutatis mutandis, equivalent to those in model2?

Note: due to the nature of my analysis, I cannot avoid the use of update.

Thanks a lot!

Dominique Makowski
  • 1,511
  • 1
  • 13
  • 30

1 Answers1

1

If you originally specify autoscale = FALSE when you call normal or some other prior function, and then try to update with different or transformed data, I doubt the scale of the priors would be calibrated properly the second time. But if you specify autoscale = TRUE, then it essentially scales the priors internally to be in standardized units, in which case updating with new data would be fine, although the internal rescaling would be different.

Ben Goodrich
  • 4,870
  • 1
  • 19
  • 18
  • Okay, if I understand, it is mandatory to specify `autoscale=TRUE` in the initial model for before further updating with different data. – Dominique Makowski Apr 11 '19 at 02:57
  • Mandatory would probably be an overly strong word, but if you are going to update the data and the updated data has different scales and if you are not using `autoscale = TRUE` and if you are not using `QR = TRUE`, then you should also change `prior` when you call `update`. – Ben Goodrich Apr 11 '19 at 12:36