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)
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
source share