Post-hoc regression on occupancy estimates

17 views
Skip to first unread message

Cara Appel

unread,
Oct 1, 2025, 7:35:03 PMOct 1
to spOccupancy and spAbundance users
Hello,

I am wondering if it is possible to conduct post-hoc regression on yearly occupancy estimates within the spOccupancy package. For context, I am doing a multi-season spatial model using the stPGOcc() function. I am parameterizing "year" as a factor instead of numeric because I don't necessarily expect a linear trend. However, I am interested in testing for an overall trend, so I have done a simple linear regression on the derived occupancy estimates as a function of year.

What I'm wondering is if there is a way to derive this within the model itself so that uncertainly is properly propagated, like one could do within a Nimble or JAGS model. Alternatively, is there a better way to test for a trend using the full posterior samples rather than just the median value per year?

Thanks in advance,

Cara Appel

Jeffrey Doser

unread,
Oct 2, 2025, 5:16:00 AMOct 2
to spOccupancy and spAbundance users
Hi Cara, 

Yes, I think the function you're looking for is postHocLM(). You can provide the full posterior of any estimated value as the response variable in that model and then fit some sort of linear regression model, allowing for full uncertainty propagation. 

Kind regards,

Jeff

Cara Appel

unread,
Oct 2, 2025, 12:22:48 PMOct 2
to spOccupancy and spAbundance users
Hi Jeff,

Wonderful, that is indeed what I wanted. Thank you!

All the best,

Cara

Reply all
Reply to author
Forward
0 new messages