Conduct simulation studies in RStan

Dear all,
I was fitted my spatial survival model on the real dataset in the RSTAN (N=40000). Now, I want to conduct a simulation study on the proposed spatial survival model.

  1. Are there any functions or guidelines (codes or examples) as to how to conduct simulation studies using RStan?
  2. Is simulating the data in R then passing it to Stan the best way to do this?

Thank you in advance!

Thanks,
Raphael

Maybe check out stantargets. I have a demo here.

Also maybe the in-development SBC package.