title: Replace lm coefficients in [r]
body: <p>Is it possible to replace coefficients in lm object?</p>
  
  <p>I thought the following would work</p>
  
  <pre><code># sample data 
  set.seed(2157010)
  x1 &lt;- 1998:2011
  x2 &lt;- x1 + rnorm(length(x1))
  y &lt;- 3*x1 + rnorm(length(x1))
  fit &lt;- lm( y ~ x1 + x2)
  
  # view origional coefficeints
  coef(fit)
  
  # replace coefficent with new values
  fit$coef(fit$coef[2:3]) &lt;- c(5, 1)
  
  # view new coefficents
  coef(fit)
  </code></pre>
  
  <p>Any assistance would be greatly appreciated</p>