Backtransforming abundance estimates in pcount with random effect

38 views
Skip to first unread message

Jelaine Gan

unread,
Apr 17, 2024, 7:16:49 AMApr 17
to unmarked
Hi all. 

I am using pcount() to determine the effect of abundance covariates on bird abundances using repeated point counts. I have the following formula: 

mod = pcount(~ timesun + hab + TOD ~ scale(forest_pland500)* scale(ED500) + (1|transect), umf, mixture="ZIP") 

because I have covars, I couldn't do direct back-transformation and from what I understood on the examples, have to use linearComb() first. I tried with vector of 0 values for the covar, but got the error below: 

lc <- linearComb(mod, c(1,0,0,0), type="state")  
backTransform(lc)
Error in .local(obj, coefficients, ...) : ncol(coefficients) == length(est) is not TRUE

So I tried to see where the problem was, and removed the random effect, and it worked fine. 

mod = pcount(~ timesun + hab + TOD ~ scale(forest_pland500)* scale(ED500), umf, mixture="ZIP") 
lc <- linearComb(mod, c(1,0,0,0), type="state") 
backTransform(lc) 

May I ask for help on how to get abundance estimates for each site when there is a random effect in your covar? 

Ken Kellner

unread,
Apr 17, 2024, 7:49:22 AMApr 17
to unmarked
I recommend using predict() instead of linearComb/backTransform for this task, so you don't have to guess about the order of the covariate values.

Also, is your grouping covariate 'transect' a series of numbers? If so that causes unique issues with prediction. Read through this recent thread 


for more information and a solution.

Ken

Jelaine Gan

unread,
Apr 18, 2024, 6:17:04 AMApr 18
to unmarked
Hi Ken, 

Thank you very much for the quick response! I will make sure the random effects are read as factor too. 

Thank you again! 

Jelaine

Reply all
Reply to author
Forward
0 new messages