Graph of a nonlinear mixed model compared to the source data

I am trying to build the resulting curve from fitting a non-linear mixed model. It should be something like a normal distribution curve, but skewed to the right. I followed the previous links here and here, but when I use my data, I can not do this for different difficulties (see below).

Here is the dataset and code

s=read.csv("GRVMAX tadpoles.csv") t=s[s$SPP== levels(s$SPP)[1],] head(t) vmax=t[t$PERFOR=="VMAX",] colnames(vmax)[6]="vmax" vmax$TEM=as.numeric(as.character(vmax$TEM)); require(lme4) start =c(TEM=25) is.numeric(start) nm1 <- nlmer ( vmax ~ deriv(TEM)~TEM|INDIVIDUO,nlpars=start, nAGQ =0,data= vmax)# this gives an error suggesting nlpars is not numeric, despite start is numeric...:~/ 

After that I want to build a curve over the source data

  with(vmax,plot(vmax ~ (TEM))) x=vmax$TEM lines(x, predict(nm1, newdata = data.frame(TEM = x, INDIVIDUO = "ACI5"))) 

Any clues?

Thank you in advance

+5
source share

Source: https://habr.com/ru/post/1258304/


All Articles