lizzieinvancouver / ospree

Budbreak review paper database
3 stars 0 forks source link

how to model species nested within continent (or evergreen/deciduous etc.) #443

Closed lizzieinvancouver closed 1 year ago

lizzieinvancouver commented 1 year ago

This relates to #442 and relevant to @dbuona.

I sort of found my notes on how to properly model things that we only have a few groups of (Europe/North America or evergreen/deciduous) and species is nested within. By nested I mean that a species can be evergreen or deciduous, but it cannot be both. The way I grew up we might make species random and a separate effect and evergreen/deciduous as a separate fixed effect, but this is wrong because species are nested within evergreen/deciduous and if we separate them we need to feel that's okay. I generally don't. The notes are in my small orange notebook from a meeting with Michael Betancourt (in April I believe) and they start then end with 'see piece of paper (star)' and of course I cannot find that piece of paper. But it has jogged my memory and here's what I remember:

You can basically do two things:

  1. Fit the model without the other effect (continent, leaf type) and group the species posteriors. This is what Alina and I did for her current work on local adaptation. SIDENOTE: If you want to show species is more important than the other effect, you can do LOO or such on a model without species but with continent or leaftype.
  2. Fit the effects separately; this is pretty similar to the Europe and NA only models that @dbuona fits with the Rangers. But you could do it better this way:

y = a + B{NAsp}*Climate + B{EURsp}*Climate

B_{EURsp} ~ normal(mu1, sigma1)

B_{NAsp} ~ normal(mu2, sigma2)

So basically you fit the species as separate. This sounds easy though I fear how to format the data could twist my brain. I think it should give a very similar answer to running each set of species separately, but I have not checked.