R Under development (unstable) (2024-06-18 r86781 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 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. > if (MuMIn:::testStart("nlme")) { + fm1Dial.gls <- gls(rate ~ (pressure + I(pressure^2) + I(pressure^3)) * QB, Dialyzer, + method = "ML") + + varying <- list(correlation = alist(AR1_0.771 = corAR1(0.771, form = ~1 | Subject), + AR1 = corAR1(), NULL), weights = alist(vp.press = varPower(form = ~pressure), + NULL)) + + dd <- dredge(fm1Dial.gls, m.lim = c(1, 2), fixed = ~pressure, varying = varying) + + models <- get.models(dd, subset = 1:4) + + predict(fm1Dial.gls, se.fit = TRUE, newdata = Dialyzer[1:5, ]) + + subset(dd, correlation == "AR1_0.771", recalc.delta = TRUE) + + ma <- model.avg(models, revised = TRUE) + ms <- model.sel(models) + print(ms, abbr = FALSE) + print(ms, abbr = TRUE) + summary(ma) + predict(ma)[1:10] + + # testing predict replacement: + fm1 <- lme(rate ~ (pressure + I(pressure^2) + I(pressure^3)) * QB, ~1 | Subject, + data = Dialyzer) + predict(fm1, newdata = Dialyzer[1:5, ], level = 0, se.fit = TRUE) + } Loading required package: MuMIn Fixed terms are "pressure" and "(Intercept)" Model selection table (Intercept) QB pressure I(pressure^2) correlation 8 -33.770 + -76.29 corAR1() 13 -11.250 60.38 -13.44 corAR1(0.771,~1|Subject) 14 -11.450 60.89 -13.67 corAR1() 16 -7.835 52.49 -11.03 corAR1(0.771,~1|Subject) weights df logLik AICc delta weight 8 varPower(~pressure) 6 -369.725 752.1 0.00 1 13 varPower(~pressure) 6 -386.580 785.8 33.71 0 14 varPower(~pressure) 6 -399.948 812.5 60.45 0 16 5 -404.638 819.7 67.64 0 Models ranked by AICc(x) Model selection table (Intrc) QB prssr prssr^2 correlation weights df logLik AICc delta 8 -33.770 + -76.29 cAR1() vrP(prs) 6 -369.725 752.1 0.00 13 -11.250 60.38 -13.44 cAR1(0.771,Sbjc) vrP(prs) 6 -386.580 785.8 33.71 14 -11.450 60.89 -13.67 cAR1() vrP(prs) 6 -399.948 812.5 60.45 16 -7.835 52.49 -11.03 cAR1(0.771,Sbjc) 5 -404.638 819.7 67.64 weight 8 1 13 0 14 0 16 0 Abbreviations: correlation: cAR1() = 'corAR1()', cAR1(0.771,Sbjc) = 'corAR1(0.771,~1|Subject)' weights: vrP(prs) = 'varPower(~pressure)' Models ranked by AICc(x) $fit [1] 3.116304 18.194821 36.298655 44.479981 45.928506 $se.fit [1] 1.1207662 0.9469506 1.0063416 0.9516658 0.9829981 > > > > proc.time() user system elapsed 2.01 0.39 2.40