Hi all,
I am interested how mothur calculates evenness from the Shannon index.
When I calculate the evenness from an community using the formula: [(Shannon index value)/ln(sobs)], I get a very different number than when I use the mothur shannoneven command.
I was curious and had some time to kill before seminar so I looked in the file containing the shannoneven code (shown below signature). I saw that the calculation seemed to be off since it used log(sobs) instead of ln(sobs). Is this a bug? Or do I have no idea on how to interpret coding and or perform stats?
Thanks ahead of time for your help and for coming up with such a cool analysis pipeline.
-J
EstOutput ShannonEven::getValues(SAbundVector* rank){
try {
//vector<double> simpsonData(3,0);
data.resize(1,0);
vector<double> shanData(3,0);
Shannon* shannon = new Shannon();
shanData = shannon->getValues(rank);
long int sobs = rank->getNumBins();
if(sobs > 1){
data[0] = shanData[0] / log(sobs);
}
else{
data[0] = 1;
}
delete shannon;
return data;
}
catch(exception& e) {
m->errorOut(e, "ShannonEven", "getValues");
exit(1);
}
}