Page 1 of 1

Can runmlwin handle CAR models at two levels?

Posted: Fri May 18, 2018 7:51 pm
by yransome
Dear runmlwin community,

I am trying to fit a spatiotemporal model using with the following code

runmlwin outcome cons year covariate1, ///
level3(POLY_ID: year cons, carids(mmid1-mmid10) carweights(carweight1-carweight10)) ///
level2(POLY_ID: cons) ///
level1(POLY_ID: ) ///
discrete(distribution(poisson) link(log) offset(logexp)) ///
mcmc( burnin (10000) chain(50000) refresh(500)) initsprevious nopause irr

* I am trying to replicate code from CARBayes (to fit a Spatiotemporal model), which assigns a CAR component both to space (POLY_ID) and the year (year). I am successful fitting the CAR component to space by removing the year variable from level 3.

However, when I try to fit the CAR component to year as well, I get the error that "only constant terms may be random at the CAR classification"
Question: Can this be fit in runmlwin? or is the program not yet capable of fitting CAR to two levels? or is there some way to manipulate the code to accommodate both?

I attached a word document with the statistical model and description of what I am trying to replicate (S1).

Thank you in advance for reviewing and any feedback you may have,

Re: Can runmlwin handle CAR models at two levels?

Posted: Mon May 21, 2018 10:28 am
by billb
Hi Yransome,
The CAR modelling in MLwiN (and hence runMLwiN) is limited to only having a constant random at the CAR distributed residuals level i.e. we can't include a spatially varying random slope in a CAR model. We did extend the CAR modelling so that you could have different levels of CAR residuals e.g. having spatially correlated residuals at 2 different levels of geography but not random slopes.
Best wishes,

Re: Can runmlwin handle CAR models at two levels?

Posted: Tue May 29, 2018 1:44 pm
by yransome
Hello Billy,

Thank you for the reply.
A follow-up question, so at best with the current program, we can specify random intercepts at levels 2 and 3.

Although it's not the same as what i was trying to accomplish with the model, would it be possible then to
treat "year" as a level, and poly ID nested in year?
But then, I would have to somehow create new mmids and carweights for year?

Thanks in advance for your thoughts!


Re: Can runmlwin handle CAR models at two levels?

Posted: Tue May 29, 2018 1:50 pm
by billb
Hi Yusuf,
I guess you could and the dependence structure would presumably be easy with each year a neighbour of it's next and last but this is answering something completely different as this would be overall year effects and not different year effects per neighbourhood.
Best wishes,
Bill (no y!)