I am working on what may be a simple problem, but I can’t quite wrap my head around it. I have spent time searching for a solution to a problem like this, but I must not be using the correct search terms.
I am trying to construct a simple linear model in brms with one response, one predictor, and a group level factor (3 islands in this case). The hard part is that one of the 3 “islands” is composed of 3 smaller islands. Here is some fake data:
fyi in the real data each “sub-island” has multiple data points.
The important thing to note is that I have the full values of island “C” without the sub-islands, but I would also like to take information about the sub-islands into account.
So starting with
size ~ 1 + age + (age | island) and moving towards something more complex.
I’ve thought about using multiple membership such as:
size ~ 1 + age + (age | mm( island, sub-island))
However, it may be possible (or better) to combine two models, like:
bf(size ~ 1 + age + (age | island), size ~ 1 + age + (age | sub-island))
but I am not sure how to structure this type of model to make sure the hierarchical group-level effect is used properly
Another option would be to set a single “sub-island” for islands A & B (i.e A1, B1) and run
size ~ 1 + age + (age | island) + (age | sub-island)
but I feel I may lose information or over-parameterize the model this way.
I’ve been stuck on this, and any suggestions on how to deal with this data structure would be very helpful to me.
Thank you for assisting a novice!
Please also provide the following information in addition to your question:
- Operating System: osx Mojave
- brms Version: 2.9.0