title: How to calculate the standard error for proportion by groups
body: <p>Im struggling today with some basic statistics. I want to calculate the standard error of the proportion by group.</p>
  
  <p>this is code I use for proportion by group:</p>
  
  <pre><code>tapply(dt$v1, dt$v2, function(x){prop.table(table(x))})
  </code></pre>
  
  <p>This is formula for standard error of propotion <code>SE = sqrt(p*(1-p)/n)</code> where <code>p=proportion</code> and <code>n=total population</code>.</p>
  
  <p>I would like to include this formula in above code, is possible?</p>
  
  <p>Thank you in advance!</p>