<p>No need to dig into the source code. You only need to read the documentation. <code>?predict.randomForest</code> states that one of its arguments is called <code>predict.all</code>:</p>

<blockquote>
  <p><strong>predict.all</strong>  Should the predictions of all trees be kept?</p>
</blockquote>

<p>So setting that to <code>TRUE</code> will keep a prediction for each case, for each tree, which you can then use to calculate standard error for each case.</p>

<p>I have recently been made aware of <a href="http://arxiv.org/pdf/1311.4555.pdf" rel="noreferrer">this</a> paper by Stefan Wager, Trevor Hastie and Brad Efron which investigates more rigorously the idea of standard errors for the predictions generated by random forests (and other bagged predictors).</p>
randomForest in R: Is there a possibility of calculating casewise confidence intervals?
<p>R package <em>randomForest</em> reports mean squared errors for each <strong>tree</strong> in the forest. I need, however, a measure of confidence for each <strong>case</strong> in the data. Since <em>randomForest</em> calculates the casewise predictions by averaging the predictions of the single trees, I guess that it should also be possible to calculate a casewise standard error and thus a confidence interval. Can this be done using the output randomForest object (if so: how?) or do I have to dig into the source code?</p>