title: Calculate a Phi coefficient in Java
body: <p>I want to calculate a Phi coefficient in Java for a Confusion Matrix 2 x 2 
  where the code so far as below : </p>
  
  <pre><code>double str= (trueP + falseP) *(trueP + falseN) * (trueN + falseP) * (trueN + falseN);
                 double output= Math.sqrt(str);
                  if (output!= 0.0)
                  return (trueP * trueN) / output;
              else return 0.0;
  </code></pre>
  
  <p>where the <strong>trueP=6930</strong>, <strong>trueN=6924</strong>, <strong>falseP=0, and falseN = 0</strong>, the output of this code is 3629.03401901938. 
  I have calculated the Phi coefficient in <strong>excel</strong> it returns value <strong>1</strong> for the same values</p>
  
  <p>What is the Wrong? </p>
  
  <p>Any help will be highly appreciated </p>