Generate nested subsets in dredge

541 views Asked by At

In dredge (MuMIn package) I want to use "subset" in order to exclude any model combining variable A with one of B,C or D. I tried

library(MuMIn) dg <- dredge (global.model, subset = !("A"&c("B","C","D"))

which delivers the same result as dg <- dredge (global.model, subset = !("A"&"B"), thus only excludes models containing A and B together. Is there any way to feed subset with a vector of variable names?

I could use subset=!(A&B)|!(A&C)|!(A&D), of course - however I'd prefer to use an "exclude-vector".

1

There are 1 answers

3
Kamil Bartoń On BEST ANSWER

Simplest expression for that is probably subset = !A | !sum(B, C, D). It has the same result as !A | !(B | C | D).