[R] Problems with the commands FUNCTION and DERIV to build a polynomial

2009-09-17 Thread Noela Sánchez
Hi all, I need to automate a process in order to prepare a a big loop in the future but I have a problem with the *command function* First I fit a model with lm > model1<-lm(data2[,2]~data2[,1]+I(data2[,1]^2)+I(data2[,1]^3)+I(data2[,1]^4)) I extract the coefficients to build the polynomial. c

Re: [R] Problems with the commands FUNCTION and DERIV to build a polynomial

2009-09-17 Thread Thomas Lumley
On Thu, 17 Sep 2009, [ISO-8859-1] Noela Sánchez wrote: Hi all, I need to automate a process in order to prepare a a big loop in the future but I have a problem with the *command function* First I fit a model with lm model1<-lm(data2[,2]~data2[,1]+I(data2[,1]^2)+I(data2[,1]^3)+I(data2[,1]^

[R] Problems with the commands FUNCTION and DERIV to build a polynomial

2009-09-17 Thread Noela Sánchez
Hi all, I need to automate a process in order to prepare a a big loop in the future but I have a problem with the *command function* First I fit a model with lm > model1<-lm(data2[,2]~data2[,1]+I(data2[,1]^2)+I(data2[,1]^3)+I(data2[,1]^4)) I extract the coefficients to build the polynomial. c