just in case you still need it. In the second edition of Doing Bayesian Data Analysis by Kruschke, in Chapter 16 the author updated his original code in JAGS from 2013 into Stan. It is quite easy to understand (a little bit more simplified as in his original paper). In the following link (at the very bottom of the page) you can download a zip file containing all the programs used in the new edition of the book.
https://sites.google.com/site/doingbayesiandataanalysis/software-installation
If you don’t have access to the new book, the procedure is very straight forward:
Copy the following files into any folder in your PC:
Stan-Ymet-Xnom2grp-MrobustHet.R (file containing stan model basically and translation of stan fits into coda readable outputs)
Stan-Ymet-Xnom2grp-MrobustHet-Example.R (file for running the given example)
TwoGroupIQ.csv (data)
DBDA2E-utilities.R (source file for generating plots as shown in the paper from 2013)
Then, set your working directory as the one where you just copied all the files above, run the program and have fun (you may lack some packages for running the code at once, so be aware of warning messages when running the first times)
P.S. The code is plenty of notes that simplify the understanding of what is each part doing