Hi Jordyn,
Thank you for your questions and for reporting that bug. You are right, the key was wrong. The blue line is zero and the green line is the observed difference, but the legend had their labels swapped. I have fixed this in the developing version, we also improved the documentation of the function. To get the corrected version:
1. Clear your RStudio environment (Session > Clear Workspace). This deletes all objects in your environment, so make sure you can recreate them from your script.
2. Restart your R session (Session > Restart R).
3. Run:
devtools::install_github("green-striped-gecko/dartR.base@dev")
library(dartRverse)
Confirm that the final message is * DONE (dartR.base).
Google Groups sometimes changes the quotation marks in R code, so please check the quotes after pasting.
To your questions:
- The histogram is the bootstrap distribution of the difference in heterozygosity between the two populations, not a null distribution. The green line is the observed difference.
- The distribution being off zero means the two populations differ in heterozygosity. How far it sits from zero reflects the size of the difference, not a sample-size imbalance, as the estimate already corrects for sample size.
- The p-value is measured against the blue zero line, not the green observed line.
- The difference is pop1 minus pop2.
Also note that the updated function now lets you choose whether to bootstrap across individuals or across loci (boot.method), and it reports a confidence interval and an adjusted p-value for each pair.
Cheers,
Luis