[R] a question on plotting nonlinear regression

garciap garciap at usal.es
Sun Jul 24 21:59:47 CEST 2011


Hi to all the people,

I'm having a trouble when trying to plot a quadratic function. I have the
code:

regression<-nls(Survival~beta1+beta2*PI+beta3*PI^2, data=cubs,
start=list(beta1 = 1, beta2 = 1, beta3 = 1))
plot(Survival~PI,data=cubs, ylab="Survival", xlab="PI")
lines(cubs$PI, fitted(regression))

but the plotted line is not the quadratic one, rather it appears a number of
lines whose meaning I do not know. It seems to be an stupid trouble, but I
tried a number of alternatives and nothing works.

Regards,

pablo

--
View this message in context: http://r.789695.n4.nabble.com/a-question-on-plotting-nonlinear-regression-tp3690828p3690828.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list