title: Stata: adding coefficients to estout
body: <p>I want to output the results of several regressions as a nicely formatted LaTeX table and am happy to see that for most cases the <code>estout</code> package on SSC seems to do exactly that.</p>
  
  <p>However, what I want is a bit special: Between the table section that shows the coefficient estimates and their standard errors, and the section that shows R^2 and the like, I would like to add a section that shows point estimates and standard errors (bonus points for stars) for particular linear combinations of the coefficients. Both point estimates and standard errors are easily computed via <code>lincom</code> but the best solution I've found so far for getting these numbers into the table involves the massily hacky addition of these numbers, one <code>estadd scalar ...</code> at a time. Is there a more elegant way to do this?</p>
  
  <p>Example code:</p>
  
  <pre><code>sysuse auto
  eststo, title("Model 1"): regress price weight mpg
  lincom weight+mpg
  estadd scalar skal r(estimate)
  estadd scalar skalsd r(se)
  eststo, title("Model 2"): regress price weight mpg foreign
  lincom weight+mpg
  estadd scalar skal r(estimate)
  estadd scalar skalsd r(se)
  label variable foreign "Car type (1=foreign)"
  estout, cells(b(star fmt(3)) t(par fmt(2)))  ///
       stats(skal skalsd r2 N, labels("Linear Combination" "S.E." R-squared "N. of cases")) ///
       label legend varlabels(_cons Constant)
  </code></pre>