Re: [unmarked] NAs and parboot

750 views
Skip to first unread message

Andy Royle

unread,
Sep 17, 2012, 9:01:27 AM9/17/12
to unma...@googlegroups.com
hi Alejandro,
 when you define the fit statistic, you need to define it only in terms of the non-missing values.  This doesn't require modifying the unmarked frame at all.
 somewhere in the webinar (see link below) we talked about this with an example.

There is an example on p. 29 of the slides located here:
https://sites.google.com/site/unmarkedinfo/home/webinars/2012-january/slides/moduleABUN.pdf?attredirects=0&d=1
This example involves the use of pcount() also.

regards
andy




J. Andy Royle
Research Statistician
USGS Patuxent Wildlife Research Center
12100 Beech Forest Rd.
Laurel, MD 20708
http://profile.usgs.gov/professional/mypage.php?name=aroyle
andy_...@usgs.gov
phone: 301-497-5846
fax: 301-497-5545

Book: "Hierarchical Modeling and Inference in Ecology: The Analysis of Data from Populations, Metapopulations and Communities" by J. A. Royle and R.M. Dorazio.  

unmarked: A very useful R package for fitting certain hierarchical models using likelihood methods. Available from:
http://cran.case.edu/web/packages/unmarked/index.html

A 5 hour "introduction to unmarked" Webinar can be found here:
http://www.pwrc.usgs.gov/Royalvideo.cfm





From: apietrek <alepi...@gmail.com>
To: unma...@googlegroups.com
Date: 09/17/2012 08:45 AM
Subject: [unmarked] NAs and parboot
Sent by: unma...@googlegroups.com





Dear unmarked users,
                                I've been trying to run parametric bootstrapping to assess goodness of fit of my models. However 3 out of 43 of my sites have at least one NA. Pcount handles NAs but apparently parboot does not. I ran all my models using the entire set of observations, but I found the only alternative to assess goodness of fit is to remove NAs of my unmarked frame.
 I would appreciate any suggestion that will help me to overcome this problem.


Alejandro

apietrek

unread,
Sep 17, 2012, 3:04:53 PM9/17/12
to unma...@googlegroups.com
Thanks Andy!

Rylee

unread,
Nov 27, 2012, 3:18:37 AM11/27/12
to unma...@googlegroups.com
Hi,

My single season occupancy model has 51 sites, each site was visited 5 times except 1 which was visited only 4 times. I used the code to omit NA's so that the parametric bootstrap will go forward, but when I get my output it tells me that there are 50 or more warnings:

In rbinom(M * J, 1, prob = p) : NAs produced

What is wrong with my code or my model that it would be doing this?

Thanks,
Rylee

ps. How do I get parboot to give me a confidence interval for an overall occupancy probability for all 51 of my sites?

fitstats <- function(d23)  {     #d23 is my model
  observed <- getY(occu.umf) #occu.umf is my unmarkedFrame
  expected <- fitted(d23)
  resids <- residuals(d23)
  r2<- resids^2
  sse <- sum(r2, 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)
}

(pb <- parboot(d23, fitstats, nsim=100, report=1))
plot(pb, main="")

Richard Chandler

unread,
Nov 29, 2012, 9:10:08 PM11/29/12
to Unmarked package
Hi Rylee,

I don't know. Can you send me your data in a couple of weeks? I'm too busy to look at it right now.

Richard

val...@gmail.com

unread,
Sep 19, 2013, 5:49:19 PM9/19/13
to unma...@googlegroups.com
Was wondering if you were able to determine the answer to this problem, as I am getting the same warning message.
Thanks,
Val

jholb...@gmail.com

unread,
Dec 8, 2013, 6:48:25 PM12/8/13
to unma...@googlegroups.com
I have the same question as Val...I am getting the "50 or more warnings" as well. 

Thanks,
Joe

Richard Chandler

unread,
Dec 9, 2013, 9:12:33 AM12/9/13
to Unmarked package
I think you can ignore these warnings, but it's always a good idea to do some simulation testing to make sure everything is working properly.


--
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.
For more options, visit https://groups.google.com/groups/opt_out.



--
Richard Chandler
Assistant Professor
Warnell School of Forestry and Natural Resources
University of Georgia
Reply all
Reply to author
Forward
0 new messages