Gender as Categorical variable affecting g0 and sigma

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

Gender as Categorical variable affecting g0 and sigma

Postby mondulkiri » Mon Nov 15, 2010 10:02 pm

I’m running DENSITY 4.4.6.1 in Windows 7 to analyse camera-trap data on leopard.

I’m expecting movements and detectability to vary between sexes and therefore want to have gender as a categorical variable affecting both g0 and sigma. Is the following the correct format for the input file (trap ID format) with gender coded as either 1 and 2 in the final column (i.e. individual 3 is male; individual 2 is female)?

session ID Individual ID occasion Id trap ID Sex
1 2 52 A_41 2
1 3 16 A_75 1
1 3 23 A_97 1
1 3 23 A_26 1
1 6 51 A_66 1
1 7 31 A_77 2
1 7 38 A_92 2
1 8 1 A_113 2

Secondly is it possible to get separate estimates for g0 and sigma for the genders as an output of the model?

Thanks

Tom
mondulkiri
 
Posts: 6
Joined: Mon Nov 15, 2010 12:00 am

Re: Gender as Categorical variable affecting g0 and sigma

Postby murray.efford » Mon Nov 15, 2010 11:28 pm

Tom

It's possible to code sex as a continuous individual covariate as you have done, but in Density it is simpler and faster to treat groups such as males and females as separate 'sessions' (see Session in the Help index). For this you would replace your first column of '1's with your sex codes (1/2 or F/M):

2 2 52 A_41
1 3 16 A_75
1 3 23 A_97
1 3 23 A_26
1 6 51 A_66
2 7 31 A_77
2 7 38 A_92
2 8 1 A_113

Then you specify sex-specific models with the 'Between-session model'
tab in Options | ML SECR, choosing 'Session' as the 'constraint'
(double-clicking in the cell will do it). Run the model with 'GO All'.
The table of parameter estimates in the Log will include separate
estimates for each session (= sex).

I hope this is enough to get you going. Using the 'session' method can become messy if you also want to compare areas or times.

As an aside, all this is handled more cleanly in the R package 'secr', and it's easy to combine effects and compare models. In the following example we add a 'made-up' sex covariate to one of the demonstration data sets.

library(secr)
data(secrdemo) ## includes test data 'captdata'
madeupsex <- sample(c('F','M'), size=nrow(captdata), p=c(0.5,0.5), replace=T)
covariates(captdata) <- data.frame(sex = factor(madeupsex))
temp <- secr.fit(captdata, model = list(g0 ~ sex, sigma ~ sex), CL = T, trace = F)
predict(temp, new = data.frame(sex = c('F','M')))

$`sex = F`
link estimate SE.estimate lcl ucl
g0 logit 0.3076745 0.04150554 0.2327378 0.3943386
sigma log 30.1180428 1.83924256 26.7235474 33.9437160

$`sex = M`
link estimate SE.estimate lcl ucl
g0 logit 0.2442329 0.03596636 0.1807146 0.3213208
sigma log 28.7524848 1.75585094 25.5118965 32.4047013

## As we used conditional likelihood (CL = T), density is a 'derived' parameter
## We ask for it to be computed for groups defined by the 'sex' covariate

derived(temp, groups = 'sex')
$F
estimate SE.estimate lcl ucl varcomp1 varcomp2
esa 14.389646 NA NA NA NA NA
D 2.571293 0.4339077 1.851475 3.570963 0.1786905 0.009585403

$M
estimate SE.estimate lcl ucl varcomp1 varcomp2
esa 13.413020 NA NA NA NA NA
D 2.907623 0.4775929 2.111801 4.003345 0.2167761 0.01131885

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

Re: Gender as Categorical variable affecting g0 and sigma

Postby mondulkiri » Fri Nov 19, 2010 1:05 am

Murray,

Thanks for the help - I'll give this a go.

I'm hoping to attend the SECR workshop which WCS in organising in Malaysia in March so that could be a good opportunity to explore using secr in R,

Thanks

Tom
mondulkiri
 
Posts: 6
Joined: Mon Nov 15, 2010 12:00 am


Return to analysis help

Who is online

Users browsing this forum: No registered users and 3 guests

cron