year effects in gdistsamp

431 views
Skip to first unread message

frthom...@gmail.com

unread,
Sep 30, 2015, 1:42:37 PM9/30/15
to unmarked
I am working with distance data for point counts at 350 points with one visit per year for three years.  I am mostly interested in estimating  effects of site covariates on abundance. I have some models set up and running using gdistsamp with abundance covariates and detection covariates.  But what if I want to estimates year effects on abundance--can I do this by modelling a year effect on phi?  And how would I do that because if I bring year in as a yearlySiteCovs as three columns, one for each year, there is only one class of year in each column and it doesn't the year categories will be treated correctly across all three years?  ---Frank Thompson


frthom...@gmail.com

unread,
Sep 30, 2015, 4:22:36 PM9/30/15
to unmarked
So I may have answered my own question.  If I use gdistsamp as proposed and include no covariates for phi, is it essentially modeling year effects on abundance? 

On Wednesday, September 30, 2015 at 12:42:37 PM UTC-5, frthom...@gmail.com wrote:
I am working with distance data for point counts at 350 points with one visit per year for three years.  I am mostly interested in estimating  effects of site covariates on abundance. I have some models set up and running using gdistsamp with abundance covariates and detection covariates.  But what if I want to estimates year effects on abundance--can I do this by modelling a year effect on phi?  And how would I do that because if I bring year in as a yearlySiteCovs as three columns, one for each year, there is only one class of year in each column and it doesn't seem the year categories will be treated correctly across all three years?  ---Frank Thompson


Dan Linden

unread,
Sep 30, 2015, 5:27:32 PM9/30/15
to unmarked
Hi Frank, I think the following thread is useful: https://groups.google.com/d/msg/unmarked/VWJfixK6Z2k/RqHQDjrqd8cJ

Essentially yes, you could capture yearly variation with phi.  And if you are most interested in site covariates, it will probably work well enough.  A more explicit hierarchical model for multi-year distance sampling was recently described here:

Sollmann, R., B. Gardner, R. B. Chandler, J. A. Royle, and T. S. Sillett. 2015. An open-population hierarchical distance sampling model. Ecology 96:325-331.

Jeffrey Royle

unread,
Sep 30, 2015, 5:47:40 PM9/30/15
to unma...@googlegroups.com
hi Frank -- we have a good example of this in the forthcoming book Applied Hierarchical Modeling which I cut a bit out of right here to show the structure of the unmarkedFrame where you see it has a categorical "rep" (replicate or year in your case perhaps) which is a factor nsites x nyears 

> wagtail$rep
       [,1] [,2] [,3] [,4]
  [1,] "1"  "2"  "3"  "4"
  [2,] "1"  "2"  "3"  "4"
  [3,] "1"  "2"  "3"  "4" 
  etc..[235 rows total]

and that was stuffed into the unmarkedFrame like this:

# Package into unmarked GDS data frame and inspect the data

umf <- unmarkedFrameGDS(y = Y[,1:24], survey="point", unitsIn="m",

   dist.breaks=breaks, numPrimary = 4,

   siteCovs = data.frame(POTATO, GRASS, LSCALE),

   yearlySiteCovs=list(rep = rep, DATE = DATE, HOUR = HOUR))

str(umf)

summary(umf)

 

Formal class 'unmarkedFrameGDS' [package "unmarked"] with 11 slots

  ..@ dist.breaks   : num [1:7] 0 50 100 150 200 250 300

  ..@ tlength       : num [1:235] 1 1 1 1 1 1 1 1 1 1 ...

  ..@ survey        : chr "point"

  ..@ unitsIn       : chr "m"

  ..@ numPrimary    : num 4

  ..@ yearlySiteCovs:'data.frame':      940 obs. of  3 variables:

  .. ..$ rep : Factor w/ 4 levels "1","2","3","4": 1 2 3 4 1 2 3 4 1 2 ...

  .. ..$ DATE: num [1:940] -1.45 -0.552 0.225 1.261 -1.297 ...

  .. ..$ HOUR: num [1:940] 1.748 0.159 -0.516 -1.09 2.332 ...

  ..@ y             : num [1:235, 1:24] 0 0 0 0 0 0 1 0 0 0 ...

  ..@ obsCovs       : NULL

  ..@ siteCovs      :'data.frame':      235 obs. of  3 variables:

  .. ..$ POTATO: num [1:235(1d)] 0.833 0.714 -0.753 0.935 -0.613 ...

  .. .. ..- attr(*, "dimnames")=List of 1

  .. .. .. ..$ : chr [1:235] "1" "2" "3" "4" ...

  .. ..$ GRASS : num [1:235(1d)] -0.388 -0.388 1.337 -0.388 -0.388 ...

  .. .. ..- attr(*, "dimnames")=List of 1

  .. .. .. ..$ : chr [1:235] "1" "2" "3" "4" ...

  .. ..$ LSCALE: num [1:235(1d)] -0.4509 -0.8946 0.5422 -0.0863 -0.6851 ...

  .. .. ..- attr(*, "dimnames")=List of 1

  .. .. .. ..$ : chr [1:235] "1" "2" "3" "4" ...

  ..@ mapInfo       : NULL

  ..@ obsToY        : num [1:4, 1:24] 1 0 0 0 1 0 0 0 1 0 ...

 

To fit a model with session-specific phi do this:

# Model with time-dependent phi

fm1 <- gdistsamp(lambdaformula = ~1, phiformula = ~rep-1,

   pformula = ~1, keyfun = "haz", output = "density", unitsOut = "ha",

   mixture = "P", K = 100, se = TRUE, data = umf)



regards
andy



--
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/d/optout.

Jeffrey Royle

unread,
Sep 30, 2015, 5:51:01 PM9/30/15
to unma...@googlegroups.com
also:  you could model year effects as a categorical effect of lambda too. I don't know which makes more sense (phi or lambda)

On Wed, Sep 30, 2015 at 1:17 PM, <frthom...@gmail.com> wrote:
I am working with distance data for point counts at 350 points with one visit per year for three years.  I am mostly interested in estimating  effects of site covariates on abundance. I have some models set up and running using gdistsamp with abundance covariates and detection covariates.  But what if I want to estimates year effects on abundance--can I do this by modelling a year effect on phi?  And how would I do that because if I bring year in as a yearlySiteCovs as three columns, one for each year, there is only one class of year in each column and it doesn't the year categories will be treated correctly across all three years?  ---Frank Thompson


frthom...@gmail.com

unread,
Oct 1, 2015, 8:27:01 AM10/1/15
to unmarked
Thanks Dan and Andy I think I know how to proceed now--Frank

frthom...@gmail.com

unread,
Oct 8, 2015, 11:31:25 AM10/8/15
to unmarked
So I proceeded as discussed in the above posts and fit models both with year and with no covariates for availability and a variety of covariates for p, and in all cases availability was essentially one. Several possible NB models that had high support had NANs for availability or its SE, I'm guessing because its appears to be essentially 1.  So for comparison I stacked the three years of site visits and set Primary = 1 and refit models.  The density estimate (back transformed) and its SE for the stacked data was slightly greater  0.355 (0.024) versus .0,272 (0.017).  I was initially avoiding stacking the data because of pseudoreplication issues and concerns it would bias the SE, but this doesn't seem to be an big issue (I'm assuming the SE is actually larger because the abundance is larger).  So my questions are:
1) If I retain the multi year approach can I ignore errors for NANs for availability in some models if its essentially one if the model is other highly supported?  
2)  Why should the abundance estimate be that much larger for the staked data?
3)  Should I just go ahead and stack the data if availability is essentially 1 and staking doesn't seem to greatly bias the SEs?
Thanks---Frank



On Wednesday, September 30, 2015 at 12:42:37 PM UTC-5, frthom...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages