R Under development (unstable) (2024-06-20 r86796 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. > library(MuMIn) > options(na.action = "na.fail") > > set.seed(1) > zz <- data.frame(x=runif(15), f1=gl(3,5), f2=factor(rep(1:2,c(10,5)))) > zz$y <- 100*zz$x + as.numeric(zz$f1)*10 * as.numeric(zz$f2) > > nafit <- lm(y~f1*f2*x, zz) > > summary(nafit) Call: lm(formula = y ~ f1 * f2 * x, data = zz) Residuals: Min 1Q Median 3Q Max -1.543e-14 -2.853e-15 2.200e-17 1.580e-15 2.483e-14 Coefficients: (6 not defined because of singularities) Estimate Std. Error t value Pr(>|t|) (Intercept) 1.000e+01 9.723e-15 1.028e+15 <2e-16 *** f12 1.000e+01 1.439e-14 6.948e+14 <2e-16 *** f13 5.000e+01 1.377e-14 3.631e+15 <2e-16 *** f22 NA NA NA NA x 1.000e+02 1.836e-14 5.447e+15 <2e-16 *** f12:f22 NA NA NA NA f13:f22 NA NA NA NA f12:x 1.072e-14 2.364e-14 4.530e-01 0.661 f13:x 1.081e-14 2.658e-14 4.070e-01 0.694 f22:x NA NA NA NA f12:f22:x NA NA NA NA f13:f22:x NA NA NA NA --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.048e-14 on 9 degrees of freedom Multiple R-squared: 1, Adjusted R-squared: 1 F-statistic: 3.094e+31 on 5 and 9 DF, p-value: < 2.2e-16 Warning message: In summary.lm(nafit) : essentially perfect fit: summary may be unreliable > coef(nafit) (Intercept) f12 f13 f22 x f12:f22 1.000000e+01 1.000000e+01 5.000000e+01 NA 1.000000e+02 NA f13:f22 f12:x f13:x f22:x f12:f22:x f13:f22:x NA 1.071683e-14 1.081218e-14 NA NA NA > > gm <- get.models(dredge(nafit), subset = NA) Fixed term is "(Intercept)" There were 11 warnings (use warnings() to see them) > ma <- model.avg(gm) There were 11 warnings (use warnings() to see them) > > summary(ma) Call: model.avg(object = gm) Component model call: lm(formula = y ~ <19 unique rhs>, data = zz) Component models: df logLik AICc delta weight 13 5 465.19 -913.71 0.00 0.32 123 5 465.19 -913.71 0.00 0.32 1234 5 465.19 -913.71 0.00 0.32 1236 6 465.22 -907.94 5.77 0.02 12346 6 465.22 -907.94 5.77 0.02 135 7 465.39 -900.78 12.93 0.00 1235 7 465.39 -900.78 12.93 0.00 12345 7 465.39 -900.78 12.93 0.00 12356 7 465.39 -900.78 12.93 0.00 123456 7 465.39 -900.78 12.93 0.00 1234567 7 465.39 -900.78 12.93 0.00 23 4 -41.89 95.78 1009.49 0.00 236 5 -41.72 100.10 1013.81 0.00 3 3 -67.26 142.70 1056.41 0.00 2 3 -72.05 152.29 1066.00 0.00 (Null) 2 -74.03 153.05 1066.76 0.00 1 4 -70.88 153.77 1067.48 0.00 12 4 -70.88 153.77 1067.48 0.00 124 4 -70.88 153.77 1067.48 0.00 Term codes: f1 f2 x f1:f2 f1:x f2:x f1:f2:x 1 2 3 4 5 6 7 Model-averaged coefficients: (full average) Estimate Std. Error Adjusted SE z value Pr(>|z|) (Intercept) 1.000e+01 6.326e-15 7.049e-15 1.419e+15 <2e-16 *** f12 1.000e+01 6.594e-15 7.351e-15 1.360e+15 <2e-16 *** f13 5.000e+01 6.405e-15 7.203e-15 6.942e+15 <2e-16 *** x 1.000e+02 1.693e-14 1.758e-14 5.688e+15 <2e-16 *** f22 1.011e-218 6.807e-109 6.810e-109 0.000e+00 1.000 f12:f22 0.000e+00 0.000e+00 0.000e+00 NaN NaN f13:f22 0.000e+00 0.000e+00 0.000e+00 NaN NaN f22:x 1.556e-16 4.151e-15 4.698e-15 3.300e-02 0.974 f12:x 3.202e-17 1.419e-15 1.602e-15 2.000e-02 0.984 f13:x 3.231e-17 1.568e-15 1.778e-15 1.800e-02 0.986 f12:f22:x 0.000e+00 0.000e+00 0.000e+00 NaN NaN f13:f22:x 0.000e+00 0.000e+00 0.000e+00 NaN NaN (conditional average) Estimate Std. Error Adjusted SE z value Pr(>|z|) (Intercept) 1.000e+01 6.326e-15 7.049e-15 1.419e+15 <2e-16 *** f12 1.000e+01 6.594e-15 7.351e-15 1.360e+15 <2e-16 *** f13 5.000e+01 6.405e-15 7.203e-15 6.942e+15 <2e-16 *** x 1.000e+02 1.693e-14 1.758e-14 5.688e+15 <2e-16 *** f22 4.563e+01 2.950e+00 3.273e+00 1.394e+01 <2e-16 *** f12:f22 NA NA NA NA NA f13:f22 NA NA NA NA NA f22:x 4.352e-15 2.153e-14 2.448e-14 1.780e-01 0.859 f12:x 1.072e-14 2.364e-14 2.729e-14 3.930e-01 0.695 f13:x 1.081e-14 2.658e-14 3.068e-14 3.520e-01 0.725 f12:f22:x NA NA NA NA NA f13:f22:x NA NA NA NA NA --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > coef(ma, T) (Intercept) f12 f13 x f22 1.000000e+01 1.000000e+01 5.000000e+01 1.000000e+02 1.011128e-218 f12:f22 f13:f22 f22:x f12:x f13:x 0.000000e+00 0.000000e+00 1.556097e-16 3.202112e-17 3.230602e-17 f12:f22:x f13:f22:x 0.000000e+00 0.000000e+00 > confint(ma) 2.5 % 97.5 % (Intercept) 1.000000e+01 1.000000e+01 f12 1.000000e+01 1.000000e+01 f13 5.000000e+01 5.000000e+01 x 1.000000e+02 1.000000e+02 f22 3.921391e+01 5.204303e+01 f12:f22 NaN NaN f13:f22 NaN NaN f22:x -4.361967e-14 5.232386e-14 f12:x -4.277010e-14 6.420376e-14 f13:x -4.932415e-14 7.094851e-14 f12:f22:x NaN NaN f13:f22:x NaN NaN > > predict(ma) 1 2 3 4 5 6 7 8 36.55087 47.21239 67.28534 100.82078 30.16819 109.83897 114.46753 86.07978 9 10 11 12 13 14 15 82.91140 26.17863 80.59746 77.65568 128.70228 98.41037 136.98414 > > #Sys.sleep(5) > > proc.time() user system elapsed 0.93 0.10 1.03