R Under development (unstable) (2023-12-18 r85702 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## Fitting nlme > ## I'm not sure why I wrote this test > library(nlme) > set.seed(101) > > run.cv.response <- FALSE > > if(run.cv.response){ + + dat <- expand.grid(time = 1:10, rep = 1:4, trt = letters[1:6]) + dat$eu <- with(dat, paste0(trt,"_",rep)) + + dat$y <- c(replicate(24, SSlogis(1:10, 10, 5, 1.5) + rnorm(10, sd = 0.25))) + + datG <- groupedData(y ~ time | eu, data = dat) + + plot(datG) + + fitL <- nlsList(SSlogis, datG) + + fnm1 <- nlme(fitL, random = pdDiag(Asym + xmid + scal ~ 1)) + + fxf <- fixef(fnm1) + + fnm2 <- update(fnm1, fixed = Asym + xmid + scal ~ trt, + start = c(fxf[1], rep(0, 5), + fxf[2], rep(0, 5), + fxf[3], rep(0, 5))) + + anova(fnm2) + + plot(fnm2) + + } > > > > proc.time() user system elapsed 0.15 0.04 0.18