Re: [R] a question on plotting nonlinear regression

2011-07-24 Thread Mark Seeto
Mark Seeto wrote: > > > garciap wrote: >> >> 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,

Re: [R] a question on plotting nonlinear regression

2011-07-24 Thread Mark Seeto
garciap wrote: > > 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="P

[R] a question on plotting nonlinear regression

2011-07-24 Thread garciap
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(regressio