data is fraway boot
I want to
Make a plot showing age- x axis and proportion of Down’s births in
each age-group -y axis. Add two curves showing the predicted probabilities
from the main effects model and the quadratic model. with legend.
lmod2 <- glm(prop ~ age + I(age^2),
family=quasibinomial, finaldata)
lmod <- glm(prop ~ age,
family=quasibinomial, finaldata)
things I tried:
plot(predict(lmod,lmod2, newdata = list(age = 16:50), type = 'response'), type = 'l',
+ ylab = "Probability of Down's syndrome per live birth",
+ xlab = 'Maternal age')
Error in !se.fit : invalid argument type
> plot(lmod,lmod2)
Error in plot.lm(lmod, lmod2) : 'which' must be in 1:6
please guide me.