Friday, July 22, 2016

Background/similarity tests in the ENMTools R package

Okay, let's use our two species to run a background/similarity test.  This works a lot like the identity test (see the post preceding this one), but there's a new option called "test.type" that can be set to "asymmetric" or "symmetric".  Here's an asymmetric background test using Bioclim:




bg.bc.asym = background.test(species.1 = ahli, species.2 = allogus, env = env, type = "bc", nreps = 99, test.type = "asymmetric")
bg.bc.asym
## 
## 
##  
## 
## Asymmetric background test ahli vs. allogus background
## 
## background test p-values:
##        D        I rank.cor 
##      0.32      0.76      0.43 
## 
## 
## Replicates:
## 
## 
## |          |         D|         I|  rank.cor|
## |:---------|---------:|---------:|---------:|
## |empirical | 0.1328502| 0.3177390| 0.0706201|
## |rep 1     | 0.1430965| 0.3114858| 0.0824412|
## |rep 2     | 0.1284871| 0.2801639| 0.0156034|
## |rep 3     | 0.1599120| 0.3384525| 0.1136082|
## |rep 4     | 0.1431022| 0.3101197| 0.0766638|
plot of chunk unnamed-chunk-17


What is "symmetric" vs. "asymmetric"?  Well, an asymmetric test means that we are comparing the empirical overlap to a null distribution generated by comparing one species' real occurrences to the background of another (species.1 vs. background of species.2).  In the Warren et al. 2008 paper we used this sort of asymmetric test, repeating it in each direction (species.1 vs. background of species.2 and species.2 vs. background of species.1).  While we had the idea that that might generate some interesting biological insight, I think it's generated just as much (if not more) confusion.  For this reason, the new R package also provides the option to do symmetric tests.  These tests compare the empirical overlap to the overlap expected when points are drawn randomly from the background of both species (species.1 background vs. species.2 background), keeping sample sizes for each species constant, of course.

And now a symmetric background test using Domain:


bg.dm.sym = background.test(species.1 = ahli, species.2 = allogus, env = env, type = "dm", nreps = 99, test.type = "symmetric")

bg.dm.sym
## 
## 
##  
## 
## Symmetric background test ahli background vs. allogus background
## 
## background test p-values:
##        D        I rank.cor 
##      0.38      0.36      0.21 
## 
## 
## Replicates:
## 
## 
## |          |         D|         I|  rank.cor|
## |:---------|---------:|---------:|---------:|
## |empirical | 0.1328502| 0.3177390| 0.0706201|
## |rep 1     | 0.2382775| 0.4428653| 0.1774936|
## |rep 2     | 0.1518903| 0.3555431| 0.1002003|
## |rep 3     | 0.1250674| 0.3029139| 0.0717565|
## |rep 4     | 0.1165355| 0.2946842| 0.0841041|
plot of chunk unnamed-chunk-20


3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. (forgot to subscribe to comment, sorry)
    In the background & identity tests, is the overlap analysis equivalent to raster.overlap or enm.overlap? I assume the former, since enm.overlap is new. And in cases where the 2 overlap analyses produce substantially different results, would it make a qualitative difference for the background/identity tests? I've read through the descriptions of these tests several times - very slowly, sideways, and backwards lol - and still can't figure out if using enm.overlap in background/identity would be good, interesting, or inappropriate.

    ReplyDelete
  3. The hazards of developing methods so quickly - this post is already out of date! The tests now spit out the p values for both raster and environment space overlap. The new output is something like:

    ## Identity test ahli vs. allogus
    ##
    ## Identity test p-values:
    ## D I rank.cor env.D env.I env.cor
    ## 0.2 0.2 0.2 0.2 0.2 0.2
    ##

    Sorry those results are boring, but they're from only 4 reps.

    Whether it makes a qualitative difference for the hypothesis tests I think would come down to whether or not there were huge biases in the distribution of geographically available environments in environment space. As to whether that affects outcomes in the real world, I honestly don't know yet - this stuff is too new to have a real idea, which is exciting!

    ReplyDelete