Two species models correct formulae to test hypothesis

posts related to the RPresence library, which may not be of general interest to users of 'classic' PRESENCE.

Two species models correct formulae to test hypothesis

Postby tombr42 » Wed Jun 02, 2021 2:28 am

Hi all,

I am currently carrying out research on an invasive mammalian predator and whether there is any influence of a native predator on its occurrence and detectability. As part of this, I have developed single-season occupancy models for the individual species and am now carrying the findings from that model forward into two species single season models using RPresence. I wanted to double-check that my formulae and interpretations of them were correct before I went too far into it.

I plan to analyse wether there is an effect of habitat type (occupancy and detection), topography (occupancy and detection), and whether cameras pointing into the road were active (detection component only).

For my current example, I have just included habitat type to keep it simple.

Code: Select all
Mod_1<-occMod(model=list(psi~1,p~1),data=data,type="so.2sp.1",param="PsiBA")
Mod_2<-occMod(model=list(psi~SP,p~SP),data=data,type="so.2sp.1",param="PsiBA")
Mod_3<-occMod(model=list(psi~SP,p~SP+INT_o),data=data,type="so.2sp.1",param="PsiBA")
Mod_4<-occMod(model=list(psi~SP+INT,p~SP),data=data,type="so.2sp.1",param="PsiBA")
Mod_5<-occMod(model=list(psi~SP+INT,p~SP+INT_o),data=data,type="so.2sp.1",param="PsiBA")
Mod_6<-occMod(model=list(psi~SP+Hab_RF,p~SP+Hab_RF),data=data,type="so.2sp.1",param="PsiBA")
Mod_7<-occMod(model=list(psi~SP+Hab_RF,p~SP+INT_o+Hab_RF),data=data,type="so.2sp.1",param="PsiBA")
Mod_8<-occMod(model=list(psi~SP+INT+Hab_RF,p~SP+Hab_RF),data=data,type="so.2sp.1",param="PsiBA")
Mod_9<-occMod(model=list(psi~SP+INT+Hab_RF,p~SP+INT_o+Hab_RF),data=data,type="so.2sp.1",param="PsiBA")


Mod_1 Null model
Everything held at constant 1
Mod_2 ΨA, ΨBA = ΨBa, pN = rN
Neither habitat nor Species A presence influences Species B occupancy/detection
Mod_3 ΨA, ΨBA = ΨBa, pN, rN
Only Species A presence influences Species B detection
Mod_4 ΨA, ΨBA, ΨBa, pN = rN
Only Species A presence influences Species B occupancy
Mod_5 ΨA, ΨBA, ΨBa, pN, rN
Only Species A presence influences Species B occupancy/detection
Mod_6 ΨA(Hab), ΨBA(Hab) = ΨBa(Hab), pN (Hab) = rN (Hab)
Only habitat influences Species B occupancy/detection
Mod_7 ΨA(Hab), ΨBA(Hab) = ΨBa(Hab), pN (Hab), rN (Hab)
Habitat-mediated influence of Species A presence on Species B detection
Mod_8 ΨA(Hab), ΨBA(Hab), ΨBa(Hab), pN (Hab) = rN (Hab)
Habitat-mediated influence of Species A presence on Species B occupancy
Mod_9 ΨA(Hab), ΨBA(Hab), ΨBa(Hab), pN (Hab), rN (Hab)
Habitat-mediated Species A presence influence on Species B occupancy/detection


If anyone could have a quick look at the above and confirm whether I'm heading in the right direction with regards to my code and the questions they are asking, it would be greatly appreciated.

Thanks for your time.

Tom Bruce
tombr42
 
Posts: 1
Joined: Mon May 24, 2021 6:16 pm

Re: Two species models correct formulae to test hypothesis

Postby jhines » Wed Jun 02, 2021 11:00 am

Mod_1 - No, the '~1' notation in the formula means the parameter is constant, but not forced equal to 1. So, this model will estimate two
parameters, psi (constant and equal for the two species) and p (also constant and equal for the two species).

Mod_2 - correct, assuming the 'pN=rN' notation means 'pA=rA, pB=rBA=rBa'.

Mod_3 - description is correct, but detection parameters will be: 'pA, pB, rA, rBA=rBa' (different detection for species B depending on presence
of species A). Since the occupancy interaction (INT_o) is an additive effect, those 4 parameters are not estimated independently. The effect of
presence of the other species on detection is the same for both species. So,(pA - rA) = (pB - rBA). If you check the design matrix for
detection, you'll see only 3 columns, indicating only 3 estimated beta parameters. If you wanta model without that constraint, the formula would
be: p~SP*INT_o.

Mod_4 - correct, but same note as above about pN,rN.
Mod_5 - correct, but same note as above about pN,rN.

Mod_6 - No, occupancy is different for each species, but habitat affects occupancy of both species equally. That means if better habitat is
associated with higher occupancy of species A, it will also be associated with higher occupancy of species B. Also, occupancy for species B does
not affect occupancyof species A.Similarly for detection, detection is different for each species but habitat affects detection of both species
equally.

Mod_7 - Mod_9 - It's getting difficult to summarize a description for more complicated models in a few words. It's also difficult to
come up with short-concise model names when there are a lot of potentially different paraemters. For Mod_7, The occupancy part is the same as
Mod_6. Detection is similar to Mod_6, with the relaxing of the constraint of pA=rA, pBA=rBA, pBa=rBa. From the formula notation, we have
detection parameters for each species, then two more parameters, 1) the effect of occupancy of the other species on detection of each species
(ie., difference between detection for species A vs species B), and 2) effect of habitat on detection.

The best way to understand how the models work is to look at the design matrix for the model (use 'print(mod_7$dmat)'). Then, read each row
of the design matrix as an equation for computing that parameter. For example, the design matrices for Mod_7 are:

>print(mod7$dmat)

$psi
a1 a2 a3
psiA "1" "0" "Hab_psiA"
psiBA "1" "1" "Hab_psiBA"
psiBa "1" "1" "Hab_psiBa"

$p
b1 b2 b3 b4
pA[1] "1" "0" "0" "Hab_pA"
pA[2] "1" "0" "0" "Hab_pA"
pA[3] "1" "0" "0" "Hab_pA"
pA[4] "1" "0" "0" "Hab_pA"
pA[5] "1" "0" "0" "Hab_pA"
pB[1] "1" "1" "0" "Hab_pB"
pB[2] "1" "1" "0" "Hab_pB"
pB[3] "1" "1" "0" "Hab_pB"
pB[4] "1" "1" "0" "Hab_pB"
pB[5] "1" "1" "0" "Hab_pB"
rA[1] "1" "0" "1" "Hab_rA"
rA[2] "1" "0" "1" "Hab_rA"
rA[3] "1" "0" "1" "Hab_rA"
rA[4] "1" "0" "1" "Hab_rA"
rA[5] "1" "0" "1" "Hab_rA"
rBA[1] "1" "1" "1" "Hab_rBA"
rBA[2] "1" "1" "1" "Hab_rBA"
rBA[3] "1" "1" "1" "Hab_rBA"
rBA[4] "1" "1" "1" "Hab_rBA"
rBA[5] "1" "1" "1" "Hab_rBA"
rBa[1] "1" "1" "1" "Hab_rBa"
rBa[2] "1" "1" "1" "Hab_rBa"
rBa[3] "1" "1" "1" "Hab_rBa"
rBa[4] "1" "1" "1" "Hab_rBa"
rBa[5] "1" "1" "1" "Hab_rBa"

For psi, converting the design matrix to equations yields:

psiA = 1*a1 + 0*a2 + Hab*a3
psiBA = 1*a1 + 1*a2 + Hab*a3
psiBa = 1*a1 + 1*a2 + Hab*a3

The formula for psiBA and psiBa are the same, so psiBA = psiBa. The formula for psiBA and psiA differ only by a constant, a2.
So, a2 represents the difference between occupancy for species B and species A (on the logit scale). a3 represents the effect
of habitat-type on occupancy. It is the same for both species.

for p,

pA(i) = 1*b1 + 0*b2 + 0*b3 + Hab*b4
pB(i) = 1*b1 + 1*b2 + 0*b3 + Hab*b4
rA(i) = 1*b1 + 0*b2 + 1*b3 + Hab*b4
rBA(i) = 1*b1 + 1*b2 + 1*b3 + Hab*b4
rBa(i) = 1*b1 + 1*b2 + 1*b3 + Hab*b4

Note: Since there is no effect of survey occasion on the detection parameters, I summarized the equations.

Here, detection for species B when only species B is present (pB) is the same as detection for species A plus a constant, b2. If
b2 is positive, detection for species B will be higher than detection for species A for all values of Hab. If negative, it will be
lower for all values of Hab.

Detection for species A is different, depending on whethere species B is present (pA not = rA). b3 represents the difference in
detection for species A when species B is present. If b3 is positive, detection of species A will be higher when species B is
present for all values of Hab.

The formula for rBA and rBa are the same, so detection of species B does not depend on occupancy of species A. However, since the
formula for rBA (rBa) is different from the formula for pB with the difference represented by b3. That difference is the same for
detection of spcecies A when species B is present/absent.
jhines
 
Posts: 527
Joined: Fri May 16, 2003 9:24 am
Location: Laurel, MD, USA


Return to RPresence

Who is online

Users browsing this forum: No registered users and 1 guest

cron