Dear Statalist members,
i am interested in fitting a three level negative binomial (random intercept) via bayesmh and made some progress with a working example using melanoma.dta as data source. Currently i am struggeling with the implementation of random intercepts - in short, a model with one random intercept for region takes very long to converge, but i'm not sure how to speed up the estimation process and how to implement a second random intercept as i am new bayesian analysis. Is there anything i can do to improve the syntax and implement a three-level approach
I've used the negative binomial likelihood evaluator provided by Houssein Assaad in this forum and prepared the data by creating a new variable for multivariate analysis:
A non-multilevel model works fine, but can't figure out where to implement a second random for nation term in my multilevel model (regions nested in nations)
Any comment would be highly appreciated.
i am interested in fitting a three level negative binomial (random intercept) via bayesmh and made some progress with a working example using melanoma.dta as data source. Currently i am struggeling with the implementation of random intercepts - in short, a model with one random intercept for region takes very long to converge, but i'm not sure how to speed up the estimation process and how to implement a second random intercept as i am new bayesian analysis. Is there anything i can do to improve the syntax and implement a three-level approach
I've used the negative binomial likelihood evaluator provided by Houssein Assaad in this forum and prepared the data by creating a new variable for multivariate analysis:
Code:
use http://www.stata-press.com/data/r14/melanoma, replace set seed 12345 generate random = uv*uniform()
Code:
* Frequentistic model
nbreg deaths uv random
* Bayesian model
bayesmh deaths uv random, lleval(negbin, param({lnalpha})) ///
prior({deaths:uv}{deaths:random}{deaths:_cons}, flat) ///
prior({lnalpha},flat)
* Frequentistic model (First Random Intercept: Region):
menbreg deaths uv random ||region:, nolog noheader
* Bayesian model (First Random Intercept: Region):
bayesmh deaths uv random i.region, lleval(negbin, param({lnalpha})) ///
prior({deaths:uv}{deaths:random}{deaths:_cons}, flat) ///
prior({deaths:i.region}, flat) ///
prior({var_region}, igamma(0.001, 0.001)) ///
prior({lnalpha}, flat) ///
block({deaths:_cons}{deaths:uv}{deaths:random}{lnalpha}) ///
block({deaths:i.region}) exclude({deaths:i.region}) ///
burnin(50000) mcmcsize(50000) dots

Comment