title: How to compute standard error for predicted data in R using predict
body: <p>Here is my data:</p>
  
  <pre><code>a &lt;- c(60, 65, 70, 75, 80, 85, 90, 95, 100, 105)
  b &lt;- c(26, 24.7, 20, 16.1, 12.6, 10.6, 9.2, 7.6, 6.9, 6.9)
  a_b &lt;- cbind(a,b)
  
  plot(a,b, col = "purple")
  abline(lm(b ~ a),col="red")
  reg &lt;- lm(b ~ a)
  </code></pre>
  
  <p>I would like to use the predict function in order to compute the standard error for the predicted b value at 110.</p>
  
  <pre><code>z &lt;- predict(reg, newdata=data.frame(year=110), se.fit=TRUE)
  </code></pre>
  
  <p>This is the output I get, but I think this is just giving me the standard errors for my 10 time points, but not the new 11th data point:</p>
  
  <pre><code> z
   $fit
     1         2         3         4         5         6         7         8         9        10 
   24.456364 22.146061 19.835758 17.525455 15.215152 12.904848 10.594545   8.284242  5.973939  3.663636 
  
   $se.fit
         1         2         3         4         5         6         7         8         9        10 
   1.2616229 1.0700007 0.8998935 0.7657760 0.6889958 0.6889958 0.7657760 0.8998935 1.0700007 1.2616229 
  
   $df
  [1] 8
  
   $residual.scale
  [1] 2.146516
  </code></pre>
  
  <p>I'm not sure what to make of this, any help is appreciated!</p>