Error in R - no applicable method for 'predict' applied to an object of class "formula"
<p>I'd like to ask for help with the predict function. I want to get a fitting line to my data analog to abline(). For a different system I used this approach before.</p>

<pre><code>mod1&lt;-glm(data$Lengthmm ~ data$qbH.yr.med, family=quasipoisson,
    subset = data$Age==1)

xv &lt;- seq(min(data$qbH.yr.med), max(data$qbH.yr.med), 
    length.out = length(data$Lengthmm))                #    poisson regression

yv &lt;- predict(mod1 ~ data$qbH.yr.med, family=quasipoisson, list(x = xv))
</code></pre>

<blockquote>
  <p>Error in UseMethod("predict") : 
    no applicable method for 'predict' applied to an object of class "formula"</p>
</blockquote>

<pre><code>typeof(mod1)
# [1] "list"
typeof(xv)
# [1] "double"
class(mod1)
# [1] "glm" "lm" 
class(xv)
# [1] "numeric"
</code></pre>

<p>I have no idea why it asks for the "formula" as non of my factors are of this class... I would by happy about help, or ideas for this error.</p>