title: Running a McNemar test on all combinations of data
body: <p>I'm looking to run a McNemar test on a frame of data. The frame is set up as follows (valueToThrow are values that are irrelevant and that I don't want in the final output): </p>
  
  <pre><code>importantDescriptor1,importantDescriptor2,valueToThrow1,valueToThrow2,McNemarValue
  </code></pre>
  
  <p>This is one row of the data, and there are ~10000 lines to this frame. For each row, I want to run a McNemar test on all of the combinations of McNemarValue items in the frame in relation to the current row, while making an identifier out of a combination of the two rows that were used to create the McNemar statistic. For example, </p>
  
  <pre><code>(Header Line) combinationOfDescriptor1,combinationOfDescriptor2,chiSquaredValue
  ABX vs ABY, XYZ vs ZYX, 22
  ACX vs ADY, XRZ vs AYX, 41
  ABC vs EBY, XYT vs ZYS, 2
  </code></pre>
  
  <p>For the test itself, I'll be using the formula (CR)^2 = ( D - A ) / sqrt( D + A ). Is there any way to compare all of these values, and then output them to either a file or another data frame (which could then be outputted to a file)? </p>
  
  <p>To further elaborate, this is the equivalent pseudocode that I want to apply: </p>
  
  <pre><code>for i in len(frame){ //runs until i = len(frame)
      j=i+1
      for j in len(frame){ //runs until j=len(frame)
          pull data from i line
          pull data from j line
          McNemarTest(dataFromi,dataFromj)
          add to output
      }
  }
  </code></pre>