Skip to content

derivative for nlmer

1 message · Raquel Souza Dias

#
Hi 
I have data on phosphorus intake (avP) and P retention (Pret) of pigs from 11 studies which I consider a random effect of my model. I am trying to fit a monomolecular equation to this data and I get the following error: gradient matrix must be of size 46 by 3
See bellow my code:
myfun <- function(a, b, c, avP) {
+     a-(a+b)*exp(-c*avP)}
+                 namevec = c("avP", "a", "b", "c"),
+                 function.arg=myfun)
+                       data=data, start=startsite, verbose = TRUE) 

It seems to be a very simple case. I am learning how to work in R. 
I really appreciate any help!
Thank you!
Raquel