SECR across populations: a solution and a new problem

questions concerning anlysis/theory using program DENSITY and R package secr. Focus on spatially-explicit analysis.

SECR across populations: a solution and a new problem

Postby Giacomo » Fri Jun 28, 2013 9:26 am

Hi,
I write a brief note from an e-mail exchange with Prof. Efford that some users might find useful. I found a new problem and I think it would be better to continue the debate on the Forum.
I originally wanted to compare lizard density across three islands using SECR model. Each island has a different detectors’ grid and there are no movements of individuals across grids. Among the possible solutions, Prof. Efford suggested me to enter each island as a separate session and enter the trap ID-files in three different files (the order needs to match the one in the capture file). To import the data the syntax is
island<-read.capthist('capturefile.txt', c('traps1.txt','traps2.txt','trap3.txt'), detector='proximity')
The island effect can be tested by simpy comparing the two models:
fit0 <- secr.fit(island, model = D~1, buffer = 25)
fit1 <- secr.fit(island, model = D~session, buffer = 25)

This worked perfectly and I hope other users might find it useful as I did.

Now, however, a have a new problem. The models above assumed g0~1 (the same g0 across islands). When trying to change this I have an error message

fit2 <- secr.fit(island, model = D~session, g0~t, buffer = 25)
no verify method for objects of class formula
Error in if (notOK) stop("'verify' found errors in 'mask' argument") :
argument is of length zero

The same happened with g0~session
I do not know how to impose a g0 variable over the sessions and the islands.
Any suggestion?

Thank you very much in advance
Giacomo
Giacomo
 
Posts: 13
Joined: Fri Apr 29, 2005 7:40 am

Re: SECR across populations: a solution and a new problem

Postby murray.efford » Fri Jun 28, 2013 5:04 pm

Hi Gaicomo

Formulae for different parameters should be combined in one list:
Code: Select all
fit2 <- secr.fit(island, model = list(D~session, g0~t), buffer = 25)

The 'list' wrapper is not needed when there is only one formula, but must be there when there is more than one so that R does not think 'g0~t' (in this case) is another argument of secr.fit.

Another word of unsolicited advice: Take care with your model specification. I am wary of ~t models at the best of times (lots of parameters to estimate, little gain) and here they only make sense if sampling was synchronous across sessions (t1 island1 = t1 island 2 etc.). In principle you could use session * t for separate time-specific detection one each island, but that will be even slower. Better to find a time covariate like temperature or sunshine hours and try that if you really think there is important day to day variation.

Murray
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: SECR across populations: a solution and a new problem

Postby Tom.B » Wed Jul 24, 2013 10:02 am

Hi all,

I have a somewhat similar data set to Gaicomo, I think (field mouse captures on three different trapping grids across multiple time sessions).

I am interested in both obtaining estimates of density for each grid, and examining differences between grids. I've approached the two goals separately; firstly finding the best model across all time sessions for each grid to obtain the 'best' estimates of D per grid, and then as suggested here coding grids as sessions and testing if allowing D to vary by grid (as a session) improves the models (separately for each time session).

This all seems to have worked fairly well, but I was wondering if there is a sensible way of doing pair-wise comparisons between the grids using the density estimates and their associated errors? The confidence intervals tend to be quite large and often overlap a lot even where my analysis shows that varying density by grid greatly improves model fit.

I'd rather not have to run separate models for each set of pairs... 3 sets of site pairs x 12 sessions x ~20 models = 720 individual models! Although I could perhaps argue it's appropriate just to re-run the preferred models rather than all of them.

Cheers,
Tom
Tom.B
 
Posts: 19
Joined: Fri Jan 22, 2010 12:01 pm

Re: SECR across populations: a solution and a new problem

Postby murray.efford » Wed Jul 24, 2013 10:45 am

Hi Tom

This looks like a new thread to me. Your question has to do with analysis strategy, and I hesitate to be too prescriptive, but...

1. Your testing of a bunch of models (for detection?) scares me but may have revealed some strong and important effects (esp. learned responses, perhaps also unmodelled or modelled heterogeneity). I hope this gives you a clear idea of what to include in the next phase of analysis (<20 models!). (Soapbox: wanton trawling through detection models for a low AIC is boring and bad practice).

2. Plotting confidence intervals is probably the best (most credible, robust) route to inference. The problem is how to get the tightest and most informative intervals. That probably involves pooling data on detection, rather than separate estimation for each grid x time.

3. A clean strategy would be to treat both grids (3) and times (12) as 'sessions' - for which read 'independent units of data'. Session covariates may then be used to model spatial effects, temporal trend etc. This becomes painfully slow if you try to estimate separate detection parameters and density for each grid and session, because there is a need to simultaneously maximize the likelihood over dozens of parameters. However, that is probably a bad model (no pooling of detection information) and may be avoidable. If you take my suggestion from (2) you might consider fitting the conditional likelihood for the detection parameters, with whatever pooling / sessioncov model you like, and then plotting the CI from derived().

Murray
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: SECR across populations: a solution and a new problem

Postby Tom.B » Wed Jul 24, 2013 12:36 pm

Hi Murray,

Thanks very much for the rapid response.

A little more about my data - it comprises approx 4600 captures of 700 individuals, spread across three grids and twelve sessions (each grid*session combo contains 5 occasions - classic robust design). The sessions themselves are spread across three years and these being temperate small mammals there are large (factor of 10) seasonal swings in the number/density of individuals within each year. We tend to catch about twice as many males as females.

Models so far have suggested fairly strong behavioural effects (b) on both g0 and sigma (trap happiness and what I'm interpreting as a corresponding reduction in ranging behaviour over the course of a session). Compounded with this, t (or T) also seem to greatly improve model fit and shows an increase in g0 and decrease in sigma within a session. Sigma also appears to vary between sessions and between sexes during the breeding season, but not in winter.

In an ideal world (and what I have been trying to do!), I would like to obtain the best possible density estimates for each grid*session combo, and test the hypotheses that there are significant differences in density between grids and between sexes.

I had been trying to keep things relatively simple by performing model selection separately for each sex and grid and allowing D to vary by session, but even so some models were taking several weeks to run (even using CL). I'm not sure I realistically have time now to run models which are pooled more than that and will presumably also be slow to run.

I could of course just compare the confidence intervals for the estimates I currently have to assess significance, but I had hoped for a better way, given that comparing pairs of confidence intervals is overly conservative.
Tom.B
 
Posts: 19
Joined: Fri Jan 22, 2010 12:01 pm

Re: SECR across populations: a solution and a new problem

Postby murray.efford » Wed Jul 24, 2013 1:29 pm

Hi
[a lengthy reply was ditched by phidot when it timed me out - this is the terse version]
I would never wait weeks for an answer: some compromises may be needed (fewer points on mask, ignore immaterial variation in g0 or sigma, use ncores>1 for heavily multi-session data).

I'd work on your hypotheses: do you really want session-specific answers? The new hcov models in 2.6 can help with sex comparisons - send a subset of data offline if you want to follow up on that.

Murray
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: SECR across populations: a solution and a new problem

Postby Tom.B » Wed Jul 24, 2013 2:04 pm

I think grid and session specific density estimates are important. I am trying to tie this in to some stable isotope work that shows dietary differences between grids, which in turn appear to drive increased summer recruitment on one grid compared to the others. However, overwinter mortality leaves all grids at roughly the same density by the following spring. So there are season-specific spatial differences in D, for which we need grid*session estimates.

With regards to sex differences, modelling sexes separately and comparing CIs shows that there is no difference in density estimates on two of the grids despite catching more males (due to sex differences in sigma). However, on the third grid density estimates are consistently 50-100% greater for males compared to females, but with somewhat overlapping CIs.
Tom.B
 
Posts: 19
Joined: Fri Jan 22, 2010 12:01 pm

Re: SECR across populations: a solution and a new problem

Postby murray.efford » Wed Jul 24, 2013 3:04 pm

I meant to say: in case you hadn't noticed, you can use a likelihood ratio test (LR.test() in secr) to compare nested models (e.g. with grid difference and without). score.test() in theory allows you to do this even without fitting the more complex model, but may be a little hard to explain to reviewers.

If you have access to a multicore machine it not hard to set up a parallel job to run a whole lot of model fits.

Murray
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: SECR across populations: a solution and a new problem

Postby Tom.B » Wed Jul 24, 2013 6:08 pm

Murray, I've emailed your Otago address with some data and further discussion as I seem to have ended up some distance from the original topic in this thread.
Tom.B
 
Posts: 19
Joined: Fri Jan 22, 2010 12:01 pm


Return to analysis help

Who is online

Users browsing this forum: No registered users and 13 guests