title: Statistical testing for multiple columns from a dataframe
body: <p>For the data frame below I want to perform kolmogorov-smirnov tests for multiple columns. Column ID is the record ID, A-D are factors consisting of 2 levels ('Other' and A,B,C,D respectively. My test variable is in column E.</p>
  
  <p>Now I would like to perform 4 KS tests:</p>
  
  <ul>
  <li>Distributions of E for column A (A vs O)</li>
  <li>Distributions of E for column B (B vs O)</li>
  <li>Distributions of E for column C (C vs O)</li>
  <li>Distributions of E for column A (D vs O)</li>
  </ul>
  
  <p>In reality, I have 80 columns, so I'm looking for a way to perform these 80 tests 'Simultaneously'</p>
  
  <pre><code>  ID A B C D  E
  1  1 O B C O  1
  2  2 O O O O  3
  3  3 O O O D  2
  4  4 A O C D  7
  5  5 A B O O 12
  6  6 O O O O  4
  7  7 O B O O  8
  </code></pre>