title: Using predict to find values of non-linear model
body: <p>I'm trying the next code to try to see if predict can help me to find the values of the dependent variable for a polynomial of order 2, in this case it is obvious y=x^2:</p>
  
  <pre><code>x &lt;- c(1, 2, 3, 4, 5 , 6)
  y &lt;- c(1, 4, 9, 16, 25, 36)
  mypol &lt;- lm(y ~ poly(x, 2, raw=TRUE))
  
  &gt; mypol
  
  Call:
  lm(formula = y ~ poly(x, 2, raw = TRUE))
  
  Coefficients:
              (Intercept)  poly(x, 2, raw = TRUE)1  poly(x, 2, raw = TRUE)2  
                        0                        0                        1  
  </code></pre>
  
  <p>If I try to find the value of x=7, I get this:</p>
  
  <pre><code>&gt; predict(mypol, 7)
  Error in eval(predvars, data, env) : not that many frames on the stack
  </code></pre>
  
  <p>What am I doing wrong? </p>