Future of using Stan from Stata

Since version 16, Stata has featured close integration with Python, so you can type Python code inside your Stata script, and pass objects back and forth.

I wrote StataStan in 2014-15 and it is one of those make-do interfaces that are just wrappers for CmdStan. It relies on passing data, model, chains etc via text files, and that has always been a weakness, producing occasional problems dependent on users’ OSs, security settings and so on.

My view now is that anyone who wants to use Stan from Stata should do so through PyStan or CmdStanPy. In interface terms, the speed and stability will be better than the -stan- command. I intend to freeze StataStan for Stata versions pre-16 but not to maintain compatibility going forward.

I am posting this on Statalist and the GitHub page too. Please let me know if you have any contrary views. Best use my email robert@bayescamp.com


Thanks Robert, that makes sense to me.