Dear all
I am a master student and fairly new to R and first time user of the unmarked package.
For my thesis I would like to obtain abundance and detection estimates using the pcount() function.
I have 36 plots (in 4 different habitat types, 9 plots each) with 9 repeated visits each plot. Further I have a bunch of variables affecting detection and some variables affecting abundance.
# UMF model
>UMF_guentheri<-unmarkedFramePCount(cov_N_guentheri[,2:10],siteCovs = z_sitecovs_guentheri[,2:7],obsCovs = list(cc= z_cc[,2:10], day=z_day[,2:10],effort= z_effort[,2:10], intervall= cov_intervall[,2:10], wind= z_wind[,2:10], rain= cov_rain[,2:10], sun= cov_sunout[,2:10], temp= z_temp[,2:10])) see UMF plot in attachment
>summary(UMF_guentheri)
36 sites
Maximum number of observations per site: 9
Mean number of observations per site: 9
Sites with at least one detection: 36
Tabulation of y observations:
0 1 2 3 4
60 118 75 44 27
...
>fm.guentheri <- pcount(~cc+day+effort+intervall+sun+temp+wind+rain~trees+site,UMF_guentheri,K=106,mixture = "P")
Call:
pcount(formula = ~cc + day + effort + intervall + sun + temp +
wind + rain ~ trees + site, data = UMF_guentheri, K = 106,
mixture = "P")
Abundance (log-scale):
Estimate SE z P(>|z|)
(Intercept) 1.6151 0.2043 7.907 2.64e-15
trees 0.0201 0.0804 0.250 8.02e-01
siteNo Palm 0.3348 0.2420 1.384 1.66e-01
sitePalm -0.1328 0.2449 -0.542 5.88e-01
sitePandanus 0.0303 0.2375 0.128 8.98e-01
Detection (logit-scale):
Estimate SE z P(>|z|)
(Intercept) -1.0341 0.7375 -1.4021 0.16087
cc 0.0531 0.0687 0.7727 0.43970
day 0.2866 0.1283 2.2334 0.02552
effort 0.2221 0.0713 3.1145 0.00184
intervallmorning 0.1077 0.2047 0.5262 0.59877
intervallnight -0.1846 0.7125 -0.2590 0.79562
sunyes 0.2101 0.6966 0.3017 0.76291
temp -0.0632 0.1076 -0.5872 0.55708
wind 0.0641 0.0674 0.9512 0.34151
rainmiddle -0.9506 1.1152 -0.8524 0.39401
rainno 0.0348 0.2075 0.1678 0.86670
rainstrong -13.1160 258.6321 -0.0507 0.95955
AIC: 943.0453
Number of sites: 36
optim convergence code: 0
optim iterations: 82
Bootstrap iterations: 0
>gof.guentheri <- Nmix.gof.test(fm.guentheri,print.table = TRUE,nsim = 1000,report = TRUE,plot.seasons = TRUE)
Chi-square goodness-of-fit for N-mixture model of 'unmarkedFitPCount' class
Observed chi-square statistic = 260.12
Number of bootstrap samples = 1000
P-value = 0.902
Quantiles of bootstrapped statistics:
0% 25% 50% 75% 100%
212 277 295 316 426
Estimate of c-hat = 0.88
I continued using the dredge function for automated model selection by AICc.
The best models that I obtained are shown below.
> subset(dredge.fm.guentheri, delta < 2)
Global model call: pcount(formula = ~cc + day + effort + intervall + sun + temp +
wind + rain ~ trees + site, data = UMF_guentheri, K = 106,
mixture = "P")
---
Model selection table
p(Int) lam(Int) p(day) p(eff) p(int) p(ran) p(sun) p(tmp) df logLik AICc delta weight
1 54 -1.0220 1.660 0.2245 0.2399 + + 8 -458.500 938.3 0.00 0.133
2 38 -1.2100 1.697 0.2147 0.1863 + 5 -463.282 938.6 0.23 0.119
3 52 -1.1070 1.715 0.2308 + + 7 -460.333 938.7 0.33 0.113
4 36 -1.2970 1.761 0.1773 + 4 -464.992 939.3 0.94 0.083
5 116 -1.2380 1.693 0.2324 + + -0.10990 8 -458.983 939.3 0.97 0.082
6 14 -0.8448 1.684 0.2161 0.1789 + 6 -462.235 939.4 1.03 0.079
7 30 -0.7253 1.647 0.2247 0.2348 + + 9 -457.365 939.7 1.32 0.069
8 118 -1.1600 1.651 0.2087 0.2395 + + -0.10190 9 -457.388 939.7 1.37 0.067
9 102 -1.2580 1.688 0.2038 0.1824 + -0.08505 6 -462.404 939.7 1.37 0.067
10 28 -0.8112 1.697 0.2266 + + 8 -459.193 939.7 1.38 0.067
11 100 -1.3380 1.744 0.1742 + -0.09131 5 -463.941 939.9 1.55 0.061
12 12 -0.9370 1.746 0.1704 + 5 -463.953 939.9 1.57 0.061
Models ranked by AICc(x)
I used these top ranked models for predictions. however, they basically do not differ from each other, so I just continue with the best model
> predict(g1, type="state", appendData=FALSE)
Predicted SE lower upper
1 5.260214 0.825904 3.866844 7.155669
2 5.260214 0.825904 3.866844 7.155669
3 5.260214 0.825904 3.866844 7.155669
...
36 5.260214 0.825904 3.866844 7.155669
Looks good so far. There is no site covs in the model so I expect the same predictions of abundances for all sites.
> predict(g1, newdata=obs_guentheri2[,c(3:5,9)], type="det", appendData=TRUE)
Predicted SE lower upper effort sun day rain
1 0.9489066 0.0588755050 0.6321750 0.9950418 16 no 1 no
2 0.9489066 0.0588755050 0.6321750 0.9950418 16 no 1 no
3 0.9724097 0.0337771327 0.7492787 0.9975999 17 yes 1 no
4 0.9561620 0.0470254442 0.7075595 0.9949399 15 yes 1 no
5 0.9774980 0.0277364178 0.7858158 0.9980596 16 yes 3 no
6 0.9715695 0.0330283376 0.7663633 0.9971991 15 yes 3 no
7 0.9998427 0.0004873043 0.9361761 0.9999996 19 yes 22 no
...
Here I got suspicious...so I estimated mean detection probabilities for each of the plots
> pred.obs.guentheri.table
GPS site Predicted SE lower upper
1 1 No Palm 0.9616917 0.045272184 0.6058606 0.9958065
2 110 Mix 0.9628263 0.046072810 0.6312597 0.9966766
3 113 Pandanus 0.9487735 0.057333874 0.5993777 0.9943026
4 119 Palm 0.9992081 0.002568591 0.6361635 0.9999984
...
Which resulted that I have an almost 100% detection rate in all of my 36 plots.
Any advice how to deal with this? Earlier studies on this species estimated detection rates between 20 and 40%.
(I also tried to use ZIP instead of P, as there is quite some 0 in my data set, but I ended up with the same results)
What I found in an old post here, i think it was by Jim Baldwin, is that some data "barely obtain a unique maximum likelihood estimate". I am not sure if I used the provided code correctly but I run the first two bits of it
> mNull <- pcount(~1~1,UMF_guentheri, K=10000, control=list(reltol=0.0000000001)) #or K=100
> backTransform(mNull, type="state")
Backtransformed linear combination(s) of Abundance estimate(s)
Estimate SE LinComb (Intercept)
6.69 1.46 1.9 1
Transformation: exp
> backTransform(mNull, type="det")
Backtransformed linear combination(s) of Detection estimate(s)
Estimate SE LinComb (Intercept)
0.234 0.0498 -1.18 1
Transformation: logistic
> # Find correlation of the estimators of lambda and p
> covmat = solve(mNull@opt$hessian)
> covmat[1,2]/(covmat[1,1]*covmat[2,2])^0.5
[1] -0.939637
Do you have any advice how to proceed in such a case? Does this mean that the data I obtained in the field is not "enough" to successfully use pcount to estimate abundances?
Is there any other approach that I could follow to estimate abundances, that would work with my data?
My goal is to estimate abundances in the 4 different habitat types and (together with the specific areas of the different habitat types) get an estimate for overall population size.
Thanks a lot!
Markus