Predictive checks for hierarchical models

Daniel Corsi writes:

I was wondering if you could help me with some code to set up a posterior predictive check for an unordered multinomial multilevel model. In this case the outcome is categories of bmi (underweight, nomral weight, and overweight) based on individuals from 360 different areas. What I would like to do is set up a replicated dataset to see how the number of overweight/underweight/normal weight individuals based on the model compares to the actual data and some kind of a graphical summary. I am following along with chapter 24 of the arm book but I want to verify that the replicated data accounts for the multilevel structure of the data of people within areas. I am attaching the code I used to run a simple model with only 2 predictors (area wealth and urban/rural designation).

My reply: The Bugs code is a bit much for me to look at–but I do recommend that you run it from R, which will give you more flexibility in preprocessing and postprocessing the data. Beyond this, there are different ways of doing replications. You can replicate new people in existing areas or new people in new areas. It depends on your application. In a cluster sample, you’ll probably want new areas. In an exhaustive sample, there might not be any new areas and you’ll want to keep your existing group-level parameters.

1 thought on “Predictive checks for hierarchical models

  1. Also worth noting that OpenBUGS has a pile of functions to do posterior simulation, and calculate posterior p-values: even running through R it's probably easier to simulate them this way.

Comments are closed.