# Generate quantities in Stan or R

**URL:** <https://discourse.mc-stan.org/t/generate-quantities-in-stan-or-r/40267>\
**Category:** RStan\
**Tags:** rstan\
**Created:** [August 22, 2025, 7:36pm UTC](https://discourse.mc-stan.org/t/generate-quantities-in-stan-or-r/40267 "2025-08-22T19:36:50Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![benjamin\_hlina](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/benjamin_hlina/32/17511_2.png) [@benjamin\_hlina](https://discourse.mc-stan.org/u/benjamin_hlina)\
**Post date:** [August 22, 2025, 8:08pm UTC](https://discourse.mc-stan.org/t/generate-quantities-in-stan-or-r/40267/6 "2025-08-22T20:08:39Z")

</div>

I also found this related to cmdstanr which gives some other alternatives. Thanks for your quick response and info this is super helpful!

> [@Standalone generated quantities usage help : cmdstanr](https://discourse.mc-stan.org/t/standalone-generated-quantities-usage-help-cmdstanr/14548):
>
> Problem Description : I have a very large dataset and as having generated quantities makes sampling lot slower so I didn’t have this block in the Stan code to fit the model and get the samples. I currently have the samples stored in a csv file. In order to check that sampling is happening as expected I want to do posterior predictive checks for which I need the generated quantities block then use bayesplot package to plot graphs. Question Is it possible to use the gqs function of the rsta…

---

_[View the full topic](https://discourse.mc-stan.org/t/generate-quantities-in-stan-or-r/40267)._
