title: How can I perform a pairwise t.test in R across multiple independent vectors?
body: <p><strong>TL;DR edition</strong></p>
  
  <p>I have vectors X1,X2,X3,...Xn. I want to test to see whether the average value for any one vector is significantly different than the average value for any other vector, for every possible combination of vectors. I am seeking a better way to do this in R than running n^2 individual t.tests.</p>
  
  <p><strong>Full Story</strong></p>
  
  <p>I have a data frame full of census data for a particular CSA. Each row contains observations for each variable (column) for a particular census tract. </p>
  
  <p>What I need to do is compare means for the same variable across census tracts in different MSAs. In other words, I want to factor my data.frame according to the MSA designation variable (which is one of the columns) and then compare the differences in the means for another variable of interest pairwise across each newly-factored MSA. This is essentially doing pairwise t.tests across each ensuing vector, but I wish to do this in a more elegant way than writing t.test(MSAx, MSAy) over and over again. How can I do this?</p>