Hi,
This is possible to do with search_terms
, although a bit cumbersome to write, basically you have to think of search_terms
as formula building elements, so that each member indicates a valid submodel. You can only explore submodels that are grown from at least one other member. Let me have an example:
Let’s assume, for the sake of the example, that we only have A1 + A2 + B1 from your problem, and we want to keep A1 and A2 always together. The search_terms for this would be
search_tems <- c("1", "A1 + A2", "A1 + A2 + B1")
so that B1
can only be included after including A1 + A2
. In your example you are reusing terms a lot, so I would advise you to build search_terms using paste
and stored variables that are t1 <- "A1 + A2", t2 <- "B1 + B2"
, etc. I see you have some interaction requirements as well, you can have your minimal building term be (A1 + A2):F1
in your case as you want all of this included if A1 + A2
is included.
Does this help at all?
Thanks for the question, this is an interesting one!