## Playing around with the Soybean data library(nlme) data(Soybean) fit1 <- nlsList(weight ~ SSlogis(Time, Asym, xmid, scal) ,data = Soybean) #fit2 <- nlsList(weight ~ SSgompertz(Time, Asym, b2, b3) ,data = Soybean) fit.nlme1 <- nlme(fit1) #fit.nlme2 <- nlme(fit2, random = pdDiag(Asym + b2 + b3 ~ 1)) ## Adding the effect of Variety fix <- fixef(fit.nlme1) fit.nlme2 <- update(fit.nlme1, fixed = Asym + xmid + scal ~ Variety, start = c(fix[1], 0, fix[2], 0, fix[3], 0), data = Soybean) plot(fit.nlme2) plot(augPred(fit.nlme2, level = 0:1)) fit.bgf <- nlsList(weight ~ SSbgf(Time, w.max, t.e, t.m), data = Soybean) fit.nlme.bgf <- nlme(fit.bgf, random = pdDiag(w.max ~ 1)) plot(fit.nlme.bgf) plot(augPred(fit.nlme.bgf, level = 0:1)) anova(fit.nlme1, fit.nlme.bgf)