Skip to content

Instantly share code, notes, and snippets.

@MJacobs1985
Created October 3, 2021 19:12
Show Gist options
  • Select an option

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

Select an option

Save MJacobs1985/b41bc89e8ef9bcd077f5a689a2c3eabf to your computer and use it in GitHub Desktop.
NLMIXED in R
# Individual variancies for the standard samples
# weights = varIdent(form = ~ 1 | Standard.sample2)
fit8<-nlme(y~U+D*exp(-(Kd*x)),
data=Grass_new,
fixed=list(U+D+Kd~Standard.sample2),
random=pdDiag(U+D~1),
weights=varIdent(form=~1|Standard.sample2),
method="REML",
start=c(20,0,50.88,0,0.02698,0))
summary(fit8)
anova(fit7, fit8) # does not realy add anything --> no heteroscedastic model needed
plot(fit8, resid(.,type = "p")~ fitted(.)|Standard.sample2,id = 0.05, adj = -0.3 )
intervals(fit8)
plot(fit8, resid(.) ~ x |Trial,
panel = function(x, y, ...) {
panel.grid()
panel.xyplot(x, y)
panel.loess(x, y, lty = 2)
panel.abline(0, 0)
} )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment