Dear All, please help with writing the function for the following: we have data frame "raw" D1 <-c(2, 2, 2, 2, 2, 5, 5, 5, 5, 5, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 50, 50, 50, 50, 50) D2 <-c(0.2, 0.5, 1, 2, 5, 0.2, 0.5, 1, 2, 5, 0.2, 0.5, 1, 2, 5, 0.2, 0.5, 1, 2, 5, 0.2, 0.5, 1, 2, 5) E <-c(76.3, 48.8, 44.5, 15.5, 3.21, 56.7, 47.5, 26.8, 16.9, 3.25, 46.7, 35.6, 21.5, 11.1, 2.94, 24.8, 21.6, 17.3, 7.78, 1.84, 13.6, 11.1, 6.43, 3.34, 0.89) raw <-data.frame(D1,D2,E) reasonable starting parameters for nls (to the best of my knowledge): start <-c(p1=8,p2=80,p3=-0.7,p4=-2.5,p5=0.3,p6=0.7) I would like to fit this model: 1 = D1/(p1*((E/(p2-E))^(1/p3)))+D2/(p6*((E/(p2-E))^(1/p4)))+(p5*D1*D2)/(p1*p6*((E/(p2-E))^(0.5/p3+0.5/p4))) to the data in "raw" using nls(). The weighting of the fit in this case should be done using the inverse of the variance of raw$E. Having the model equal to 1 makes it quiet difficult for me to see or understand how this can be done (versus the "usual" nls(y~p1*x+p2,...)) using the software. As always, your help is greatly appreciated. Sincerely, Andras [[alternative HTML version deleted]]