Skip to content

Instantly share code, notes, and snippets.

@MJacobs1985
Created October 3, 2021 17:36
Show Gist options
  • Select an option

  • Save MJacobs1985/b9fe7a0ed278a2e6c886f7562d56361b to your computer and use it in GitHub Desktop.

Select an option

Save MJacobs1985/b9fe7a0ed278a2e6c886f7562d56361b to your computer and use it in GitHub Desktop.
NLMIXED in R
Grass_new<-groupedData(y~x|Trial,
data=Grass2,
FUN=mean,
labels=list(x="Time", y="DMres"))
nlin<-nlsList(y~f1(x,U,D,Kd),
data=Grass_new,
start=list(U=19.7,D=52,Kd=0.035))
nlmixed<-nlme(y~U+D*exp(-(Kd*x)),
data=Grass_new,
fixed=list(U+D+Kd~1),
random=pdDiag(U+D~1),
method="REML",
start=c(20,50.88,0.02698))
plot(comparePred(nlin, nlmixed, level=1))
coef(nlmixed, level=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment