title: Standard error and confidence interval for nonlinear function of least squares regression coefficients
body: <p>I am running an OLS regression in R from which I get a couple of coefficients. Here's part of the code:</p>
  
  <pre><code>Attacks &lt;- Treat.Terr.Dataset$Attacks[2:30]
  Attackslag &lt;- Treat.Terr.Dataset$Attacks[1:29]
  TreatmentEffect &lt;- Treat.Terr.Dataset$TreatmentEffect[2:30]
  TreatmentEffectlag &lt;- Treat.Terr.Dataset$TreatmentEffect[1:29]
  
  olsreg &lt;- lm(TreatmentEffect ~ TreatmentEffectlag + Attacks + Attackslag)
  coeffs&lt;-olsreg$coefficients
  </code></pre>
  
  <p>And then I would need to calculate: <code>(Attacks + Attackslag) / (1 - TreatmentEffectlag)</code>. The problem is that I can do this on R by using <code>(coeffs[3] + coeffs[4]) / (1 - coeffs[2])</code> but the result is a fixed number without any p-value or confidence interval, just as a calculator would show me.</p>
  
  <p>Does anyone know if there is any function I could use to calculate this with a confidence interval?</p>
  
  <hr>
  
  <p><strong>Editor note</strong></p>
  
  <p>If the target quantity is a linear function of regression coefficients, then the problem reduces to general linear hypothesis testing where exact inference is possible.</p>