output aggregation after msPGOcc

13 views
Skip to first unread message

Jeanne Käser

unread,
Dec 5, 2025, 1:10:50 PM (13 days ago) Dec 5
to spOccupancy and spAbundance users
Hi all,

Here I am again with another question about msPGOcc :)
I am running a model with 76 species of spiders, split up in 10 families. Some 20 species have an occupancy of 10% of plots or more, and a third of the species have only 1 presence.

I would be interested in calculating the output/tracing response curves for each covariate, on a family level instead of species level.

For this, I was wondering if there is a way, after running msPGOcc with the species data, to gather the output of the families together? I'm thinking like a mean/median weighted with each species' model fit, something like that, to avoid losing the information generated by the species level analysis.

I ran a postHocLM() using family as a covs, but there is no relevant signal overall. I would like to investigate the families' response for each covariate separately.

Thanks a lot! Kind regards,
Jeanne

Jeffrey Doser

unread,
Dec 10, 2025, 2:30:30 PM (8 days ago) Dec 10
to spOccupancy and spAbundance users
Hi Jeanne, 

Yes, this is certainly possible, although there isn't specific spOccupancy code to help you do it so you'll need to develop some manual code. Because this is a Bayesian analysis, you can generate derived quantities (like the mean effect of a covariate within a family of species) after fitting the model, with full uncertainty. The quickest way to do that would be to subset the "beta.samples" from the model output list to just include the species for a given family. Then if you take the average of the species-specific effects across all MCMC iterations, you will be left with a full posterior distribution for the average effect across all species in a family. This would involve using apply() and likely doing some rearranging of beta.samples in order to average things across all species in a family. 

Hope that helps, 

Jeff
Reply all
Reply to author
Forward
0 new messages