Specifying variables when summarising with posterior package

Does anyone know if I can select specific variables when using the posterior package in conjunction with cmdstan? Currently I’m just converting outputs from cmdstan into a stanfit datatype and then summarising with rstan. It seems like there must be a better way to do things but there’s not much documentation on the posterior and cmdstan packages.

ping @paul.buerkner

You can select variables via the subset_draws method and you can summarize via the summarize_draws method. I think they should be documented or are they not?

They’re documented but it was not clear to me that you can directly do that. @bbbales2 showed me how to do it.

1 Like