NEON-biodiversity / Ostats

O-statistics (community pairwise niche overlap statistics)
https://neon-biodiversity.github.io/Ostats/
Other
7 stars 2 forks source link

Implement resampling (rarefaction) #16

Open qdread opened 3 years ago

qdread commented 3 years ago

As Sydne noted from reading the FAQ for hypervolume (see #14), it might be a problem if the overlaps are calculated across species with very different numbers of data points. This might be a problem for the one-variable overlaps too. But we don't want to assume anything and automatically resample the data points down.

My recommendation would be to throw a warning from Ostats() if there are any overlaps being calculated with very different numbers of data points for each species. We would have to figure out a threshold at which to throw the warning. Maybe be very conservative and throw the warning if they differ at all. That would leave it up to the user to do the rarefaction on their own. If we really wanted to we could add a function to the package to do the rarefaction, or an argument to Ostats() that would do it.

qdread commented 3 years ago

I included a warning (f01dcdd) but leaving this open if we want to write some code to actually do the resampling