Occupancy estimates greater than one

269 views
Skip to first unread message

Rob McHenry

unread,
Nov 27, 2023, 11:22:00 AM11/27/23
to unmarked
Hi all,

I have been attempting to produce an occupancy model to predict the occupancy and detection values for predators by camera trap type over six sites. 

The estimates for the naive (0.5) and model with no covariates (det = 47% and occ = 50.6%) make sense. But once I try to add a camera trap type the values are greater than one producing a value greater than 100%
e.g  "Call:
occu(formula = ~High.End ~ 1, data = occupancy, control = list(maxit = 1000, trace = TRUE, REPORT = 1)) Occupancy (logit-scale): Estimate SE z P(>|z|) 9.08 56.6 0.161 0.872 Detection (logit-scale): Estimate SE z P(>|z|) (Intercept) -4.47 1.746 -2.56 0.0105 High.End 1.30 0.533 2.44 0.0149 AIC: 35.75543 Number of sites: 6 optim convergence code: 0 optim iterations: 661 Bootstrap iterations: 0"

And thus  cannot be back transformed to the original scale. Error message: "Error in .local(obj, ...) :
Cannot directly backTransform an unmarkedEstimate with length > 1.

Here are what my data look like

Screenshot (144).pngScreenshot (143).png

I hope you can help,

Let me know if you need any more information.

Many Thanks,

Rob.

Ken Kellner

unread,
Nov 27, 2023, 11:28:19 AM11/27/23
to 'Rob McHenry' via unmarked
Hi Rob,

The coefficient estimates unmarked returns are on the logit scale and are not probabilities.

In order to get a probability of occupancy or detection, the coefficient estimates need to be combined appropriately with covariate values (if any) to calculate a linear predictor, and then the linear predictor needs to be back-transformed into a probability. If you have covariates in your model you can use the predict() function to do this instead of backTransform().

Your shared results are hard to read due to the formatting, but it looks like the estimates of the occupancy coefficients are very large and have very large SEs, indicating problems with model fitting. Given that you have only six sites, you probably do not have enough data to fit models with covariates, particularly if for some levels of your trap type covariate you have no detections.

Ken
> --
> *** Three hierarchical modeling email lists ***
> (1) unmarked (this list): for questions specific to the R package unmarked
> (2) SCR: for design and Bayesian or non-bayesian analysis of spatial capture-recapture
> (3) HMecology: for everything else, especially material covered in the books by Royle & Dorazio (2008), Kéry & Schaub (2012), Kéry & Royle (2016, 2021) and Schaub & Kéry (2022)
> ---
> You received this message because you are subscribed to the Google Groups "unmarked" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/unmarked/1d92b696-f8a9-4ec2-a89c-f07d7bd45bb9n%40googlegroups.com.



Message has been deleted

Florent Bled

unread,
Nov 28, 2023, 10:17:37 AM11/28/23
to unmarked
Hello Rob!

The problem you have here is that you can use backTransform, when using a fitted model as input, ONLY if no covariates are present. This is explained really quickly in the help file for this function.

Reformatting your output for easier reading:
Call:
occu(formula = ~High.End ~ 1, data = occupancy, control = list(maxit = 1000, trace = TRUE, REPORT = 1))

Occupancy (logit-scale):
Estimate   SE       z   P(>|z|)
    9.08 56.6   0.161     0.872

Detection (logit-scale):
            Estimate       SE       z      P(>|z|)
(Intercept)    -4.47    1.746   -2.56       0.0105
High.End        1.30    0.533    2.44       0.0149

AIC: 35.75543
Number of sites: 6
optim convergence code: 0
optim iterations: 661
Bootstrap iterations: 0

So, if you want to get your estimates on the probability scale, you have 2 options:
1) use backTransform in conjunction with  linearComb to to first get an estimate on the logit scale for specific parameter combination, and then feed that to backTransform to get it on the probability scale, or

# For one level (here, High.End=3):
(lc <- linearComb( fmF, c(1,3) , type="det" ))
(btlc <- backTransform(lc))
confint(btlc, level = 0.95) 


# For multiple combinations (here, with High.End equal to 0, 3, and 4)
(lc <- linearComb(fmF, matrix( c(1,0,  
                                 1,3,
                                 1,4),
                                 ncol=2,nrow=3,byrow=T     
                                 ),
                                          type="det"
                  )
(btlc <- backTransform(lc))
confint(btlc, level = 0.95)



2) as Ken mentioned, simply use predict. By default, it will use your original dataset and produce estimates for each data points, but you can also get estimates for specific parameter combination by supplying a new data frame to predict over:
predict(fmF,"det")
predict(fmF, type="det", newdata = data.frame( High.End =c(0,3,4) ) 

As far as your occupancy probability estimate goes, as Ken mentioned, your results indicate that your estimated baseline occupancy probability (i.e., here, using only an intercept and no covariates) over all sites is not different from 0 on the logit-scale, or 0.5 on the probability scale. With half of your sites having no detection, that makes sense. As for the large SE, with only 6 sites and an intercept-only model, this is not surprising either.

I hope it helps!

Cheers,

Florent
Reply all
Reply to author
Forward
0 new messages