Hi, I am trying to fit a simple mixed Emax model with lme4 package (R version 2.12.0), with the following code: nlmer(Y~exp(EM)*C/(exp(EC)+C) ~(EM+EC|subject),start=c(EM=0.1,EC=-0.2),data=tableau) and I have the error code in return: "Erreur dans nlmer(Y ~ exp(EM) * C/(exp(EC) + C) ~ (EM + EC | subject), start = c(EM = 0.1, : gradient attribute of evaluated model must be a numeric matrix" despite the fact that I have already seen such code somewhere, I understand that instead of "Y ~ exp(EM) * C/(exp(EC) + C)" nlmer is expecting a function that returns also the gradient matrix in addition to output; it is easy to calculte the gradient but I have no idea on how this enriched output of this function should be specified in order to provide the gradient as well; any idea to help me ? thanks -- View this message in context: http://r.789695.n4.nabble.com/formula-in-nlmer-function-of-lme4-package-tp3015094p3015094.html Sent from the R help mailing list archive at Nabble.com.