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("MASS")) { + + quine.nb1 <- glm.nb(Days ~ 0 + Sex / (Age + Eth * Lrn), data = quine) + #quine.nb1 <- glm.nb(Days ~ Sex/(Age + Eth*Lrn), data = quine) + + ms <- dredge(quine.nb1) + + models <- get.models(ms, subset = TRUE) + models <- get.models(ms, subset = NA) + + print(summary(model.avg(models))) + + #dredge(quine.nb1) # OK + #dredge(quine.nb1x = NA) # OK + #dredge(quine.nb1) # OK + print(dredge(quine.nb1)) # OK + #dredge(quine.nb1) # Right, should be the same as above + ma <- model.avg(dredge(quine.nb1), subset = cumsum(weight) <= .9999) + + print(summary(ma)) + # Cannot predict with this 'averaging' + #pred <- predict(ma, se=TRUE) + + #pred <- cbind(pred$fit, pred$fit - (2 * pred$se.fit), pred$fit + (2 * pred$se.fit)) + #matplot(pred, type="l") + #matplot(family(quine.nb1)$linkinv(pred), type="l") + } Loading required package: MuMIn Call: model.avg(object = models) Component model call: glm.nb(formula = Days ~ <11 unique rhs>, data = quine, init.theta = <11 unique values>, link = log) Component models: df logLik AICc delta weight 12345 15 -531.51 1096.72 0.00 0.99 1234 13 -538.90 1106.56 9.84 0.01 123 11 -542.06 1108.09 11.38 0.00 1345 9 -547.12 1113.57 16.85 0.00 13 5 -551.84 1114.10 17.38 0.00 124 11 -546.72 1117.42 20.70 0.00 12 9 -549.22 1117.76 21.04 0.00 134 7 -551.77 1118.35 21.63 0.00 1 3 -558.64 1123.44 26.73 0.00 14 5 -558.26 1126.95 30.23 0.00 (Null) 1 -859.98 1721.98 625.26 0.00 Term codes: Sex Age:Sex Eth:Sex Lrn:Sex Eth:Lrn:Sex 1 2 3 4 5 Model-averaged coefficients: (full average) Estimate Std. Error Adjusted SE z value Pr(>|z|) SexF 3.02276 0.29916 0.30189 10.013 < 2e-16 *** SexM 2.54402 0.26152 0.26393 9.639 < 2e-16 *** AgeF1:SexF -0.70715 0.32391 0.32689 2.163 0.030522 * AgeF1:SexM -0.72304 0.33091 0.33396 2.165 0.030387 * AgeF2:SexF -0.61222 0.37238 0.37581 1.629 0.103300 AgeF2:SexM 0.62749 0.27414 0.27667 2.268 0.023329 * AgeF3:SexF -0.34158 0.32745 0.33047 1.034 0.301315 AgeF3:SexM 1.14840 0.31571 0.31859 3.605 0.000313 *** EthN:SexF -0.08045 0.27393 0.27630 0.291 0.770915 EthN:SexM -0.67571 0.25792 0.26027 2.596 0.009427 ** LrnSL:SexF 0.93464 0.33268 0.33556 2.785 0.005347 ** LrnSL:SexM 0.24089 0.33653 0.33961 0.709 0.478127 EthN:LrnSL:SexF -1.34377 0.40062 0.40387 3.327 0.000877 *** EthN:LrnSL:SexM 0.75308 0.44600 0.45000 1.673 0.094230 . (conditional average) Estimate Std. Error Adjusted SE z value Pr(>|z|) SexF 3.02276 0.29916 0.30189 10.013 < 2e-16 *** SexM 2.54402 0.26152 0.26393 9.639 < 2e-16 *** AgeF1:SexF -0.70743 0.32366 0.32665 2.166 0.030331 * AgeF1:SexM -0.72333 0.33066 0.33371 2.168 0.030197 * AgeF2:SexF -0.61247 0.37225 0.37568 1.630 0.103045 AgeF2:SexM 0.62774 0.27390 0.27644 2.271 0.023157 * AgeF3:SexF -0.34172 0.32744 0.33047 1.034 0.301113 AgeF3:SexM 1.14887 0.31492 0.31782 3.615 0.000300 *** EthN:SexF -0.08046 0.27393 0.27630 0.291 0.770908 EthN:SexM -0.67575 0.25788 0.26023 2.597 0.009410 ** LrnSL:SexF 0.93797 0.32856 0.33148 2.830 0.004661 ** LrnSL:SexM 0.24175 0.33682 0.33991 0.711 0.476951 EthN:LrnSL:SexF -1.35847 0.37721 0.38070 3.568 0.000359 *** EthN:LrnSL:SexM 0.76132 0.44139 0.44547 1.709 0.087449 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Standard errors cannot be calculated because some component models do not provide them Global model call: glm.nb(formula = Days ~ 0 + Sex/(Age + Eth * Lrn), data = quine, init.theta = 1.597990733, link = log) --- Model selection table Sex Age:Sex Eth:Sex Lrn:Sex Eth:Lrn:Sex df logLik AICc delta weight 32 + + + + + 15 -531.513 1096.7 0.00 0.989 16 + + + + 13 -538.899 1106.6 9.84 0.007 8 + + + 11 -542.061 1108.1 11.38 0.003 30 + + + + 9 -547.123 1113.6 16.85 0.000 6 + + 5 -551.836 1114.1 17.38 0.000 12 + + + 11 -546.723 1117.4 20.70 0.000 4 + + 9 -549.219 1117.8 21.04 0.000 14 + + + 7 -551.769 1118.3 21.63 0.000 2 + 3 -558.637 1123.4 26.73 0.000 10 + + 5 -558.260 1126.9 30.23 0.000 1 1 -859.976 1722.0 625.26 0.000 Models ranked by AICc(x) Call: model.avg(object = dredge(quine.nb1), subset = cumsum(weight) <= 0.9999) Component model call: glm.nb(formula = Days ~ <4 unique rhs>, data = quine, init.theta = 1.597990733, link = log) Component models: df logLik AICc delta weight 12345 15 -531.51 1096.72 0.00 0.99 1234 13 -538.90 1106.56 9.84 0.01 123 11 -542.06 1108.09 11.38 0.00 1345 9 -547.12 1113.57 16.85 0.00 Term codes: Sex Age:Sex Eth:Sex Lrn:Sex Eth:Lrn:Sex 1 2 3 4 5 Model-averaged coefficients: (full average) Estimate Std. Error Adjusted SE z value Pr(>|z|) SexF 3.02276 0.29918 0.30191 10.012 < 2e-16 *** SexM 2.54393 0.26143 0.26384 9.642 < 2e-16 *** AgeF1:SexF -0.70729 0.32378 0.32677 2.165 0.030426 * AgeF1:SexM -0.72318 0.33079 0.33385 2.166 0.030296 * AgeF2:SexF -0.61236 0.37231 0.37573 1.630 0.103150 AgeF2:SexM 0.62760 0.27403 0.27656 2.269 0.023248 * AgeF3:SexF -0.34165 0.32744 0.33047 1.034 0.301211 AgeF3:SexM 1.14863 0.31533 0.31823 3.609 0.000307 *** EthN:SexF -0.08033 0.27380 0.27617 0.291 0.771136 EthN:SexM -0.67580 0.25785 0.26020 2.597 0.009397 ** LrnSL:SexF 0.93486 0.33242 0.33530 2.788 0.005301 ** LrnSL:SexM 0.24093 0.33655 0.33962 0.709 0.478072 EthN:LrnSL:SexF -1.34410 0.40012 0.40337 3.332 0.000862 *** EthN:LrnSL:SexM 0.75326 0.44590 0.44990 1.674 0.094076 . (conditional average) Estimate Std. Error Adjusted SE z value Pr(>|z|) SexF 3.02276 0.29918 0.30191 10.012 < 2e-16 *** SexM 2.54393 0.26143 0.26384 9.642 < 2e-16 *** AgeF1:SexF -0.70745 0.32365 0.32664 2.166 0.030323 * AgeF1:SexM -0.72333 0.33066 0.33371 2.168 0.030194 * AgeF2:SexF -0.61249 0.37224 0.37567 1.630 0.103014 AgeF2:SexM 0.62774 0.27390 0.27643 2.271 0.023156 * AgeF3:SexF -0.34172 0.32744 0.33047 1.034 0.301103 AgeF3:SexM 1.14888 0.31492 0.31781 3.615 0.000300 *** EthN:SexF -0.08033 0.27380 0.27617 0.291 0.771136 EthN:SexM -0.67580 0.25785 0.26020 2.597 0.009397 ** LrnSL:SexF 0.93801 0.32852 0.33144 2.830 0.004654 ** LrnSL:SexM 0.24174 0.33682 0.33991 0.711 0.476960 EthN:LrnSL:SexF -1.35847 0.37721 0.38070 3.568 0.000359 *** EthN:LrnSL:SexM 0.76132 0.44139 0.44547 1.709 0.087449 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > > proc.time() user system elapsed 2.09 0.34 2.45