AndrewLJackson / SIBER

ellipse and convex hull fitting package for stable isotope data
36 stars 14 forks source link

SEAc % Overlap Calculation using maxLikOverlap? #78

Closed vanmieva closed 1 year ago

vanmieva commented 3 years ago

Hello!

I am currently attempting to calculate the % overlap between the SEAc ellipses of 2 groups (group 7 & group 8) in community #4 using stable isotope data and the SIBER R package. I have followed the vignette example "Ellipse Overlap" that comes in the SIBER package and used the following code:

head(data.sb) iso1 iso2 group community 1 0.09881122 3.807466 10 4 2 -0.16367095 3.775113 8 4 3 -0.24213029 3.845701 8 4 4 -0.22786495 3.813348 8 4 5 -0.24213029 3.845701 8 4 6 -0.22786495 3.813348 8 4

siber.sb=createSiberObject(data.sb)

ellipse1 = "4.7" ellipse2 = "4.8"

sea.overlap <- maxLikOverlap(ellipse1, ellipse2, siber, p.interval = NULL, n = 100) sea.overlap My output is:

sea.overlap area.1 area.2 overlap 1.727520e-01 5.213493e-02 2.032879e-20

The code is working however, from my understanding this is calculating the overlap of SEA ellipses and not the SEAc (small sample size corrected) ellipses. I am wondering if there is a way to calculate SEAc overlap specifically with the maxLikOverlap function? Alternatively, is there a different function that does this calculation?

Any help would be greatly appreciated!!

Cheers, Victoria