Re: [R] An error in fitting a non linear regression

2009-02-25 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 24.02.2009 12:41:50: > > Hi Peter, > > You are totally right and it was a miscalculating and misunderstanding from > me. > Regarding the R-squared calculation of non linear model (question 2), is > there any way to do that? I am not an expert statist

Re: [R] An error in fitting a non linear regression

2009-02-24 Thread Saeed Ahmadi
Hi Peter, You are totally right and it was a miscalculating and misunderstanding from me. Regarding the R-squared calculation of non linear model (question 2), is there any way to do that? Regards Saeed Petr Pikal wrote: > > Hi > > r-help-boun...@r-project.org napsal dne 24.02.2009 11:31:22:

Re: [R] An error in fitting a non linear regression

2009-02-24 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 24.02.2009 11:31:22: > > Hi, > > Thank you for the reply and suggestions. > > I have two questions? > 1) If I want to use log, it seems that I have to take log from both sides of > the model which will lead to lm(log(q)~log(-depth)). What is tehdiff

Re: [R] An error in fitting a non linear regression

2009-02-24 Thread Saeed Ahmadi
Hi, Thank you for the reply and suggestions. I have two questions? 1) If I want to use log, it seems that I have to take log from both sides of the model which will lead to lm(log(q)~log(-depth)). What is tehdifference between this syntax and lm(log(q) ~ I(-depth))? 2) How can I calculate the R

Re: [R] An error in fitting a non linear regression

2009-02-20 Thread Christian Ritz
Hi Saeed, one approach is to try out several initial value combinations for a and b. It often helps to find initial values of the same order of magnitude and of the same sign as the final estimates. To get such initial values, you could linearize the model: lm(log(q) ~ I(-depth)) and supply

[R] An error in fitting a non linear regression

2009-02-20 Thread Saeed Ahmadi
Hi I have a data set with two variables "q" and "depth" as follows: q<-c(tapply(weight[Soil=="Jy"], Depth[Soil=="Jy"], mean)). This commns returns 7 "q" values: 0.68790 0.84555 0.405416667 0.15277 0.03310 0.03140 0.00518 The "depth" values are produced using this command