title: looping through variable names according to their prefix
body: <p>I have to carry out a number of paired t-tests, and I was wondering how to automate the overall procedure.
  Suppose I have only the following variables:</p>
  
  <pre><code>int_ma    est_ma    tot_ma    int_pa    est_pa    tot_pa   
  </code></pre>
  
  <p>What I need is to compute:</p>
  
  <pre><code>ttest int_ma=int_pa
  ttest est_ma=est_pa
  ttest tot_ma=tot_pa
  </code></pre>
  
  <p>Of course in some way it should be possible to exploit the fact that each pair has a unique prefix and the "_pa, _ma" suffixes, but unfortunately I cannot find an easy way to refer to only a part of each variable name..</p>
  
  <p>Thank you very much for any help!</p>