Non linear regression by levels of several groups in R

Take the example of mtcars in R: I want to make a non linear regression for the relationship between mpg and disp with:

nls(data=mtcars, mpg ~ A * disp^2 + B * disp + C, start=list(A=1,B=1,C=1))

But, I need to analyse the relationship for every combination of cyl, gear and carb.

I tried to do this :

 nlsList(data=mtcars, mpg ~ A * disp^2 + B * disp + C | cyl * gear * carb, 
                                              start=list(A=1,B=1,C=1)) 

but I have always errors. The final objective is to plot datas with regression with facets of cyl, gear and carb. Could you help me?

链接地址: http://www.djcxy.com/p/5230.html

上一篇: 从gplots包创建气球图的注释

下一篇: 非线性回归的几个级别在R