Closed MikkoVihtakari closed 12 months ago
I think the issue is similar to when people have multiple sub-regions that they want to develop indices for? For those cases, there hasn't been a easy way to produce multiple indices simulteneously, and we've recommended (1) subsetting the prediction grid with each area (or in your case sex) of interest, and (2) calling get index for each subsetted prediction grid
Ah, I see now that when I subset one of the sexes from the prediction grid, I get index for that sex and when I won't subset, I get the summed-up index. Brilliant! Thanks a lot for help Eric. This issue can be closed from my part.
Ok great - glad it worked!
I am trying to make a model where sex of fish is represented using an interaction allowing sexes to have different trends over time:
sdmTMB(value ~ 0 + fyear * sex + poly(log(depth), 2), ...)
I can do
ggeffects::ggeffect(fit, terms = c("fyear", "sex"))
to get the marginal effects, but is there a way to split indices to sexes using theget_index()
function? When I run the function, I get the index with both sexes I presume. At least it is not split by the interaction.My prediction grid has both sexes
replicate_df
'd.