]> git.donarmstrong.com Git - mothur.git/blobdiff - corraxescommand.cpp
added mantel command
[mothur.git] / corraxescommand.cpp
index 4f8dccb167fc8e8e6d08597f11504d4df2b26f24..f47427d62c2cc7f03615149b11cbfdee5135b083 100644 (file)
@@ -645,7 +645,7 @@ int CorrAxesCommand::calcKendall(map<string, vector<float> >& axes, ofstream& ou
                                        int numWithLowerRank = 0;
                                        float thisrank = otus[l].score;
                                        
-                                       for (int u = l; u < scores[j].size(); u++) {
+                                       for (int u = l+1; u < scores[j].size(); u++) {
                                                if (otus[u].score > thisrank) { numWithHigherRank++; }
                                                else if (otus[u].score < thisrank) { numWithLowerRank++; }
                                                count++;
@@ -655,9 +655,6 @@ int CorrAxesCommand::calcKendall(map<string, vector<float> >& axes, ofstream& ou
                                        numDisCoor += numWithLowerRank;
                                }
                                
-                               //comparing to yourself
-                               count -= lookupFloat.size();
-                               
                                double p = (numCoor - numDisCoor) / (float) count;
 
                                out << '\t' << p;