title: How do I do ttest var1==10, by(var2) in Stata?
body: <p>I'm trying to run a <code>ttest</code> against a variable when it equals a certain value, but that syntax doesn't work.</p>
  
  <p>How do I do <code>ttest var1==10, by(var2)</code> in Stata?</p>