c@buhtz m@iii@g oii posteo@jp
2024-Jul-31 11:56 UTC
[R] Difference between stats.steps() and MuMIn.dredge() to select best fit model
Hello, I try to understand the different approaches how to select the best fit regression model. This is not about AIC, BIC, etc. It is about the difference between the steps() function (in stats package) and the dredge() function (in MuMIn) package. I see several examples on the internet. step() explore the model space with a step wise approach. And dredge() try out all possible combinations of the variables. But isn't that the same? I might have a mental block on this. Which model (formula) would dredge() "test" that step() wouldn't?` Thanks in advance, Christian
Ivan Krylov
2024-Aug-01 16:06 UTC
[R] Difference between stats.steps() and MuMIn.dredge() to select best fit model
? Wed, 31 Jul 2024 11:56:55 +0000 c.buhtz at posteo.jp ?????:> step() explore the model space with a step wise approach. > And dredge() try out all possible combinations of the variables. > > But isn't that the same? I might have a mental block on this. > > Which model (formula) would dredge() "test" that step() wouldn't?`Suppose that the predictors a, b, c, d, e, f are arranged in the descending order of contribution to the model. Consider a forward stepwise algorithm that is asked to choose three variables. It starts by testing a, b, c, d, e, f, and chooses a. It continues by testing a + b, a + c, a + d, a + e, a + f, and chooses a + b. It continues by testing a + b + c, a + b + d, a + b + e, a + b + f, and chooses a + b + c. By being greedy, it doesn't consider, for example, the model d + e + f, because for that it would have to pick d before a. A greedy algorithm for K variables out N tests N + (N-1) + ... + (N-K+1) = N*K - K(K-1)/2 models. An exhaustive search would have to test choose(N,K) = N!/(N-K)!/K! models. -- Best regards, Ivan
Maybe Matching Threads
- Error running MuMIn dredge function using glmer models
- Package MuMIn (dredge): Error in ret[, ] <- cbind(x, se, rep(if (is.null(df)) NA_real_ else df, : number of items to replace is not a multiple of replacement length.
- Error message in dredge function (MuMIn package) used with binary GLM
- Error message in dredge function (MuMIn package) with binary GLM
- dredge solely offset models in MuMIn