R Under development (unstable) (2026-03-26 r89724 ucrt) -- "Unsuffered Consequences" Copyright (C) 2026 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:::.parallelPkgCheck(quiet = TRUE)) { + clusterType <- if(length(find.package("snow", quiet = TRUE))) "SOCK" else "PSOCK" + clust <- try(makeCluster(getOption("cl.cores", 2), type = clusterType)) + if(inherits(clust, "cluster")) { + + library(MuMIn) + library(nlme) + + data(Orthodont, package = "nlme") + #Orthodont <- Orthodont[sample.int(nrow(Orthodont), size = 64, + #replace = TRUE), ] + Orthodont$rand1 <- runif(nrow(Orthodont)) + Orthodont$rand2 <- runif(nrow(Orthodont)) + clusterExport(clust, "Orthodont") + clusterCall(clust, "library", "nlme", character.only = TRUE) + + # fm2 <- lmer(log(distance) ~ rand*Sex*age + (1|Subject) + (1|Sex), + # data = Orthodont, REML=FALSE) + fm2 <- lme(log(distance) ~ rand1*Sex*age + rand2, ~ 1|Subject / Sex, + data = Orthodont, method = "ML") + print(system.time(pdd1 <- dredge(fm2, cluster = FALSE))) + print(system.time(pddc <- dredge(fm2, cluster = clust))) + print(system.time(dd1 <- dredge(fm2))) + + print(pddc) + print(pdd1) + print(dd1) + + #print(all.equal(pddc, dd1)) + ma1 <- model.avg(pdd1, beta = "none") + ma0 <- model.avg(pddc) + + if(!isTRUE(test <- all.equal(ma1$avg.model, ma0$avg.model))) { + print(test) + warning("'ma1' and 'ma0' are not equal") + } + if(!isTRUE(test <- all.equal(ma1$summary, ma0$summary))) { + print(test) + warning("'ma1' and 'ma0' are not equal") + } + + if(!(identical(c(pddc), c(pdd1)) && identical(c(pdd1), c(dd1)))) { + warning("results of 'dredge' and 'pdredge' are not equal") + print(all.equal(c(pddc), c(pdd1))) + print(all.equal(c(pdd1), c(dd1))) + } + + stopCluster(clust) + + # suppressPackageStartupMessages(library(spdep)) + # suppressMessages(example(NY_data, echo = FALSE)) + # esar1f <- spautolm(Z ~ PEXPOSURE * PCTAGE65P + PCTOWNHOME, + # data=nydata, listw=listw_NY, family="SAR", method="full", verbose=FALSE) + # clusterCall(clust, "library", "spdep", character.only = TRUE) + # clusterExport(clust, "listw_NY", "nydata") + # options(warn=1) + + # varying <- list(family = list("CAR", "SAR"), method=list("Matrix_J", "full")) + + # dd <- dredge(esar1f, m.lim=c(0, 1), fixed=~PEXPOSURE, varying = varying, trace=FALSE) + + } else # if(inherits(clust, "try-error")) + message("Could not set up the cluster") + + } Fixed term is "(Intercept)" user system elapsed 1.57 0.06 1.64 Fixed term is "(Intercept)" user system elapsed 0.03 0.00 2.00 Fixed term is "(Intercept)" user system elapsed 1.42 0.05 1.47 Global model call: lme.formula(fixed = log(distance) ~ rand1 * Sex * age + rand2, data = Orthodont, random = ~1 | Subject/Sex, method = "ML") --- Model selection table (Int) Sex age rn1 rn2 Sex:age Sex:rn1 age:rn1 19 2.862 + 0.03170 + 23 2.879 + 0.03149 -0.025400 + 3 2.910 + 0.02740 55 2.891 + 0.03133 -0.043820 + + 27 2.864 + 0.03197 -0.0084040 + 7 2.926 + 0.02737 -0.028430 31 2.880 + 0.03173 -0.025250 -0.0075860 + 87 2.868 + 0.03243 -0.007717 + -0.001596 39 2.938 + 0.02719 -0.046600 + 11 2.910 + 0.02741 -0.0008016 63 2.893 + 0.03158 -0.043800 -0.0079760 + + 71 2.952 + 0.02502 -0.078790 0.004567 119 2.886 + 0.03181 -0.034700 + + -0.000811 15 2.926 + 0.02738 -0.028420 -0.0002703 95 2.863 + 0.03333 0.003746 -0.0091720 + -0.002613 103 2.969 + 0.02444 -0.106200 + 0.005325 247 2.938 + 0.02719 -0.122100 + + 0.006954 47 2.938 + 0.02720 -0.046610 -0.0006053 + 79 2.952 + 0.02492 -0.080370 0.0018870 0.004709 127 2.881 + 0.03270 -0.023390 -0.0090730 + + -0.001816 2 2.870 0.02740 111 2.969 + 0.02434 -0.107700 0.0018830 + 0.005466 255 2.933 + 0.02804 -0.110700 -0.0079730 + + 0.005946 6 2.883 0.02738 -0.024100 10 2.869 0.02733 0.0049630 70 2.910 0.02492 -0.076880 0.004782 14 2.881 0.02729 -0.024210 0.0056080 78 2.911 0.02449 -0.083560 0.0079590 0.005373 1 3.211 + 5 3.229 + -0.031220 37 3.250 + -0.069690 + 9 3.204 + 0.0134700 13 3.221 + -0.031180 0.0136200 45 3.244 + -0.069270 0.0124400 + 0 3.172 4 3.183 -0.021100 12 3.169 -0.021750 0.0271000 Sex:age:rn1 df logLik AICc delta weight 19 7 127.865 -240.6 0.00 0.221 23 8 128.655 -239.9 0.75 0.151 3 6 125.738 -238.6 1.97 0.083 55 9 129.170 -238.5 2.11 0.077 27 8 127.937 -238.4 2.19 0.074 7 7 126.686 -238.3 2.36 0.068 31 9 128.714 -237.6 3.02 0.049 87 9 128.670 -237.5 3.11 0.047 39 8 127.163 -236.9 3.74 0.034 11 7 125.739 -236.4 4.25 0.026 63 10 129.235 -236.2 4.41 0.024 71 8 126.812 -236.2 4.44 0.024 119 10 129.173 -236.1 4.53 0.023 15 8 126.686 -235.9 4.69 0.021 95 10 128.750 -235.2 5.38 0.015 103 9 127.335 -234.8 5.78 0.012 247 + 11 129.641 -234.5 6.08 0.011 47 9 127.163 -234.5 6.12 0.010 79 9 126.816 -233.8 6.82 0.007 127 11 129.253 -233.8 6.86 0.007 2 5 121.539 -232.5 8.12 0.004 111 10 127.338 -232.4 8.20 0.004 255 + 12 129.703 -232.1 8.49 0.003 6 6 122.213 -231.6 9.02 0.002 10 6 121.563 -230.3 10.32 0.001 70 7 122.350 -229.6 11.03 0.001 14 7 122.245 -229.4 11.24 0.001 78 8 122.412 -227.4 13.24 0.000 1 5 89.806 -169.0 71.59 0.000 5 6 90.299 -167.8 72.84 0.000 37 7 91.229 -167.3 73.27 0.000 9 6 89.882 -166.9 73.68 0.000 13 7 90.378 -165.6 74.97 0.000 45 8 91.296 -165.1 75.47 0.000 0 4 85.606 -162.8 77.79 0.000 4 5 85.827 -161.1 79.54 0.000 12 6 86.148 -159.5 81.15 0.000 Models ranked by AICc(x) Random terms (all models): 1 | Subject, 1 | Sex %in% Subject Warning message: In solve.default(-val) : system is computationally singular: reciprocal condition number = 2.53649e-18 (model 8 skipped) Global model call: lme.formula(fixed = log(distance) ~ rand1 * Sex * age + rand2, data = Orthodont, random = ~1 | Subject/Sex, method = "ML") --- Model selection table (Int) Sex age rn1 rn2 Sex:age Sex:rn1 age:rn1 20 2.862 + 0.03170 + 24 2.879 + 0.03149 -0.025400 + 4 2.910 + 0.02740 56 2.891 + 0.03133 -0.043820 + + 28 2.864 + 0.03197 -0.0084040 + 8 2.926 + 0.02737 -0.028430 32 2.880 + 0.03173 -0.025250 -0.0075860 + 88 2.868 + 0.03243 -0.007717 + -0.001596 40 2.938 + 0.02719 -0.046600 + 12 2.910 + 0.02741 -0.0008016 64 2.893 + 0.03158 -0.043800 -0.0079760 + + 72 2.952 + 0.02502 -0.078790 0.004567 120 2.886 + 0.03181 -0.034700 + + -0.000811 16 2.926 + 0.02738 -0.028420 -0.0002703 96 2.863 + 0.03333 0.003746 -0.0091720 + -0.002613 104 2.969 + 0.02444 -0.106200 + 0.005325 248 2.938 + 0.02719 -0.122100 + + 0.006954 48 2.938 + 0.02720 -0.046610 -0.0006053 + 80 2.952 + 0.02492 -0.080370 0.0018870 0.004709 128 2.881 + 0.03270 -0.023390 -0.0090730 + + -0.001816 3 2.870 0.02740 112 2.969 + 0.02434 -0.107700 0.0018830 + 0.005466 256 2.933 + 0.02804 -0.110700 -0.0079730 + + 0.005946 7 2.883 0.02738 -0.024100 11 2.869 0.02733 0.0049630 71 2.910 0.02492 -0.076880 0.004782 15 2.881 0.02729 -0.024210 0.0056080 79 2.911 0.02449 -0.083560 0.0079590 0.005373 2 3.211 + 6 3.229 + -0.031220 38 3.250 + -0.069690 + 10 3.204 + 0.0134700 14 3.221 + -0.031180 0.0136200 46 3.244 + -0.069270 0.0124400 + 1 3.172 5 3.183 -0.021100 13 3.169 -0.021750 0.0271000 Sex:age:rn1 df logLik AICc delta weight 20 7 127.865 -240.6 0.00 0.221 24 8 128.655 -239.9 0.75 0.151 4 6 125.738 -238.6 1.97 0.083 56 9 129.170 -238.5 2.11 0.077 28 8 127.937 -238.4 2.19 0.074 8 7 126.686 -238.3 2.36 0.068 32 9 128.714 -237.6 3.02 0.049 88 9 128.670 -237.5 3.11 0.047 40 8 127.163 -236.9 3.74 0.034 12 7 125.739 -236.4 4.25 0.026 64 10 129.235 -236.2 4.41 0.024 72 8 126.812 -236.2 4.44 0.024 120 10 129.173 -236.1 4.53 0.023 16 8 126.686 -235.9 4.69 0.021 96 10 128.750 -235.2 5.38 0.015 104 9 127.335 -234.8 5.78 0.012 248 + 11 129.641 -234.5 6.08 0.011 48 9 127.163 -234.5 6.12 0.010 80 9 126.816 -233.8 6.82 0.007 128 11 129.253 -233.8 6.86 0.007 3 5 121.539 -232.5 8.12 0.004 112 10 127.338 -232.4 8.20 0.004 256 + 12 129.703 -232.1 8.49 0.003 7 6 122.213 -231.6 9.02 0.002 11 6 121.563 -230.3 10.32 0.001 71 7 122.350 -229.6 11.03 0.001 15 7 122.245 -229.4 11.24 0.001 79 8 122.412 -227.4 13.24 0.000 2 5 89.806 -169.0 71.59 0.000 6 6 90.299 -167.8 72.84 0.000 38 7 91.229 -167.3 73.27 0.000 10 6 89.882 -166.9 73.68 0.000 14 7 90.378 -165.6 74.97 0.000 46 8 91.296 -165.1 75.47 0.000 1 4 85.606 -162.8 77.79 0.000 5 5 85.827 -161.1 79.54 0.000 13 6 86.148 -159.5 81.15 0.000 Models ranked by AICc(x) Random terms (all models): 1 | Subject, 1 | Sex %in% Subject Global model call: lme.formula(fixed = log(distance) ~ rand1 * Sex * age + rand2, data = Orthodont, random = ~1 | Subject/Sex, method = "ML") --- Model selection table (Int) Sex age rn1 rn2 Sex:age Sex:rn1 age:rn1 20 2.862 + 0.03170 + 24 2.879 + 0.03149 -0.025400 + 4 2.910 + 0.02740 56 2.891 + 0.03133 -0.043820 + + 28 2.864 + 0.03197 -0.0084040 + 8 2.926 + 0.02737 -0.028430 32 2.880 + 0.03173 -0.025250 -0.0075860 + 88 2.868 + 0.03243 -0.007717 + -0.001596 40 2.938 + 0.02719 -0.046600 + 12 2.910 + 0.02741 -0.0008016 64 2.893 + 0.03158 -0.043800 -0.0079760 + + 72 2.952 + 0.02502 -0.078790 0.004567 120 2.886 + 0.03181 -0.034700 + + -0.000811 16 2.926 + 0.02738 -0.028420 -0.0002703 96 2.863 + 0.03333 0.003746 -0.0091720 + -0.002613 104 2.969 + 0.02444 -0.106200 + 0.005325 248 2.938 + 0.02719 -0.122100 + + 0.006954 48 2.938 + 0.02720 -0.046610 -0.0006053 + 80 2.952 + 0.02492 -0.080370 0.0018870 0.004709 128 2.881 + 0.03270 -0.023390 -0.0090730 + + -0.001816 3 2.870 0.02740 112 2.969 + 0.02434 -0.107700 0.0018830 + 0.005466 256 2.933 + 0.02804 -0.110700 -0.0079730 + + 0.005946 7 2.883 0.02738 -0.024100 11 2.869 0.02733 0.0049630 71 2.910 0.02492 -0.076880 0.004782 15 2.881 0.02729 -0.024210 0.0056080 79 2.911 0.02449 -0.083560 0.0079590 0.005373 2 3.211 + 6 3.229 + -0.031220 38 3.250 + -0.069690 + 10 3.204 + 0.0134700 14 3.221 + -0.031180 0.0136200 46 3.244 + -0.069270 0.0124400 + 1 3.172 5 3.183 -0.021100 13 3.169 -0.021750 0.0271000 Sex:age:rn1 df logLik AICc delta weight 20 7 127.865 -240.6 0.00 0.221 24 8 128.655 -239.9 0.75 0.151 4 6 125.738 -238.6 1.97 0.083 56 9 129.170 -238.5 2.11 0.077 28 8 127.937 -238.4 2.19 0.074 8 7 126.686 -238.3 2.36 0.068 32 9 128.714 -237.6 3.02 0.049 88 9 128.670 -237.5 3.11 0.047 40 8 127.163 -236.9 3.74 0.034 12 7 125.739 -236.4 4.25 0.026 64 10 129.235 -236.2 4.41 0.024 72 8 126.812 -236.2 4.44 0.024 120 10 129.173 -236.1 4.53 0.023 16 8 126.686 -235.9 4.69 0.021 96 10 128.750 -235.2 5.38 0.015 104 9 127.335 -234.8 5.78 0.012 248 + 11 129.641 -234.5 6.08 0.011 48 9 127.163 -234.5 6.12 0.010 80 9 126.816 -233.8 6.82 0.007 128 11 129.253 -233.8 6.86 0.007 3 5 121.539 -232.5 8.12 0.004 112 10 127.338 -232.4 8.20 0.004 256 + 12 129.703 -232.1 8.49 0.003 7 6 122.213 -231.6 9.02 0.002 11 6 121.563 -230.3 10.32 0.001 71 7 122.350 -229.6 11.03 0.001 15 7 122.245 -229.4 11.24 0.001 79 8 122.412 -227.4 13.24 0.000 2 5 89.806 -169.0 71.59 0.000 6 6 90.299 -167.8 72.84 0.000 38 7 91.229 -167.3 73.27 0.000 10 6 89.882 -166.9 73.68 0.000 14 7 90.378 -165.6 74.97 0.000 46 8 91.296 -165.1 75.47 0.000 1 4 85.606 -162.8 77.79 0.000 5 5 85.827 -161.1 79.54 0.000 13 6 86.148 -159.5 81.15 0.000 Models ranked by AICc(x) Random terms (all models): 1 | Subject, 1 | Sex %in% Subject Warning messages: 1: In solve.default(-val) : system is computationally singular: reciprocal condition number = 2.53649e-18 (model 8 skipped) 2: In solve.default(-val) : system is computationally singular: reciprocal condition number = 2.53649e-18 (model 8 skipped) > > #system.time(pdredge(fm2, cluster = clust)) > #system.time(pdredge(fm2, cluster = F)) > #system.time(dredge(fm2)) > > proc.time() user system elapsed 6.40 0.39 9.14