p values for dynamic occupancy models

292 views
Skip to first unread message

Christina

unread,
Jan 16, 2021, 8:02:28 AM1/16/21
to unmarked

Hello, 

I ran parboot on a dynamic occupancy model after using mb.gof.test because it never gave a result for p.global, only a p value which equals 0. My dataframe, model, and parboot code is below, showing strong p values for all 3 fit statistics. Should I have run it on each season separately instead to get p values? Or does anyone have insight on why I didn’t get p. global values which would have shown p values for all 4 seasons? Thanks

>coyoteMS.umf <- unmarkedMultFrame(y= coyoteMS.data[,2:329],

siteCovs = coyoteMS.data[,c("natveg", "dev", "psize", "dist",”hp”)],

obsCovs=NULL,

yearlySiteCovs=NULL,

numPrimary=4)

 

>coyoteMS_global<-colext(psiformula= ~1, gammaformula = ~ 1, epsilonformula = ~ 1, pformula = ~natveg+dev+psize+dist+hp, coyoteMS.umf, se=TRUE)  


>mb.gof.test(coyoteMS_global,nsim=1000)

Goodness-of-fit for dynamic occupancy model

Number of seasons:  4

 

Chi-square statistic:

    Season 1     Season 2     Season 3     Season 4

7.619132e+09 2.132495e+44 1.193411e+48 2.267485e+22

 

Total chi-square = 1.193624e+48

Number of bootstrap samples = 1000

P-value = 0

 

Quantiles of bootstrapped statistics:

     0%     25%     50%     75%    100%

6.3e+13 4.7e+17 3.9e+18 4.6e+19 1.8e+24

 

Estimate of c-hat = 1.577709e+26 


> fitstats <- function(coyoteMS_global) {

+ observed <- getY(coyoteMS_global@data)

+ expected <- fitted(coyoteMS_global)

+ resids <- residuals(coyoteMS_global)

+ sse <- sum((resids^2),na.rm=TRUE)

+ chisq <- sum(((observed - expected)^2 / expected),na.rm=TRUE)

+ freeTuke <- sum(((sqrt(observed) - sqrt(expected))^2),na.rm=TRUE)

+ out <- c(SSE=sse, Chisq=chisq, freemanTukey=freeTuke)

+ return(out)

+ }

> parboot(coyoteMS_global,fitstats,nsim=1000,report=1)

t0 = 378.6994 8585.066 674.4327

Running in parallel on 7 cores. Bootstrapped statistics not reported.

 

Call: parboot(object = coyoteMS_global, statistic = fitstats, nsim = 1000, report = 1)

 

Parametric Bootstrap Statistics:

               t0 mean(t0 - t_B) StdDev(t0 - t_B) Pr(t_B > t0)

SSE           379          -49.1             48.2        0.836

Chisq        8585          -44.0            408.8        0.513

freemanTukey  674          -16.5             64.8        0.608

 

t_B quantiles:

               0% 2.5%  25%  50%  75% 97.5%  100%

SSE           288  333  395  428  458   519   586

Chisq        7583 7866 8343 8609 8886  9482 10188

freemanTukey  504  566  651  691  734   815   936

Marc J. Mazerolle

unread,
Jan 18, 2021, 7:55:27 AM1/18/21
to unmarked

Hi Christina,


When you have a dynamic occupancy model fit with mb.gof.test( ), the function returns the global chi-square statistic and corresponding P-value. The global chi-square is computed by summing the chi-squares obtained for each season. This is exactly what you have in the output you included in your original message. If you look into the object a little further, you can also get the summary of observed vs predicted frequencies for each season separately. For example, if you stored the result of mb.gof.test( , nsim = 5000) in an object called outGOF, then you can access these season-specific chi-square tables with:


> dd$chisq.table$tables


These tables can help identify the seasons that are associated with the largest chi-square values. That being said, the huge values you are getting for each season suggest strong lack-of-fit. Also note that the second part of your code with the different test statistics you tried are not appropriate for a model based on detections/non-detections. For the chi-square to work with detection/non-detection data, you need to summarize information (e.g., for detection histories, or rows, or columns).


Good luck,


Marc


____________________
Marc J. Mazerolle
Professeur agrégé et directeur du bac. en environnements naturels et aménagés
Département des sciences du bois et de la forêt
2405 rue de la Terrasse
Université Laval
Québec, Québec G1V OA6, Canada
Tel: (418) 656-2131 ext. 407120
Email: marc.ma...@sbf.ulaval.ca

Veuillez noter que je suis en télétravail. Le meilleur moyen de me rejoindre est par courriel.

De : unma...@googlegroups.com <unma...@googlegroups.com> de la part de Christina <christina.a...@gmail.com>
Envoyé : 15 janvier 2021 14:59
À : unmarked
Objet : [unmarked] p values for dynamic occupancy models
 
[Externe UL*]
--
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/f19be378-be7f-46eb-8cf2-80c95db16858n%40googlegroups.com.
*ATTENTION : L’émetteur de ce courriel est externe à l’Université Laval.
Évitez de cliquer sur un hyperlien, d’ouvrir une pièce jointe ou de transmettre des informations si vous ne connaissez pas l’expéditeur du courriel. En cas de doute, contactez l’équipe de soutien informatique de votre unité ou hamec...@ulaval.ca.


Christina

unread,
Jan 18, 2021, 8:24:36 AM1/18/21
to unmarked
Thank you for helping me with the interpretation. I will not use the multi season model. However I would like to ask, since I also ran a single season model. Am I correct that these results indicate better fit, even with some overdispersion? 

Chi-square statistic = 2.70343e+152

Number of bootstrap samples = 1000

P-value = 0

 

Quantiles of bootstrapped statistics:

     0%     25%     50%     75%    100%

6.8e+37 1.3e+46 3.3e+48 6.0e+50 1.2e+61

 

Estimate of c-hat = 1.944875e+94 


 thank you


Marc J. Mazerolle

unread,
Jan 18, 2021, 8:28:41 AM1/18/21
to unma...@googlegroups.com

Christina,


The chi-square is still huge and so is the c-hat estimate. I would not use models with such lack-of-fit for inferences. I think you should back up a bit and do some reading on the approaches you are using. There are many resources available online and in print.


Best,


Marc


____________________
Marc J. Mazerolle
Professeur agrégé et directeur du bac. en environnements naturels et aménagés
Département des sciences du bois et de la forêt
2405 rue de la Terrasse
Université Laval
Québec, Québec G1V OA6, Canada
Tel: (418) 656-2131 ext. 407120
Email: marc.ma...@sbf.ulaval.ca

Veuillez noter que je suis en télétravail. Le meilleur moyen de me rejoindre est par courriel.
Envoyé : 18 janvier 2021 08:24
À : unmarked
Objet : Re: [unmarked] p values for dynamic occupancy models
 
[Externe UL*]
Reply all
Reply to author
Forward
0 new messages