View source: R/e_model_all_subsets_formula.R
e_model_all_subsets_formula | R Documentation |
Return all possible model subsets based on specified model scopes.
e_model_all_subsets_formula(
x_var_names = NULL,
y_var_name = NULL,
var_formula = NULL,
max_scope = c("always", "FO", "TWI", "PQ", "SO", "one_TWI", "only_TWI", "only_PQ",
"only_SO", "only_one_TWI")[3],
sw_return = c("both", "formula", "table")[1]
)
x_var_names |
a character list of variable names or list of character lists.
If a list of multiple formulas or character lists is provided,
then each is subject to the |
y_var_name |
a character string |
var_formula |
NOT YET IMPLEMENTED |
max_scope |
one of or a list (corresponding to |
sw_return |
return a list of "formula", or a "table" of x-variable combinations, or a list of "both" |
a list of functions
# Two-way interaction model, return formulas
e_model_all_subsets_formula(
x_var_names = c("a", "b", "c")
, y_var_name = "z"
, var_formula = NULL
, max_scope = "TWI"
, sw_return = c("both", "formula", "table")[2]
)
# Two-way interaction model, return table of x-variable combinations
e_model_all_subsets_formula(
x_var_names = c("a", "b", "c")
, y_var_name = "z"
, var_formula = NULL
, max_scope = "TWI"
, sw_return = c("both", "formula", "table")[3]
)
# Two variables always in the model with a second-order model of two others
e_model_all_subsets_formula(
x_var_names = list(c("a", "b"), c("c", "d"))
, y_var_name = "z"
, var_formula = NULL
, max_scope = list("always", "SO")
, sw_return = c("both", "formula", "table")[3]
)
# One variable in two-way interactions with the other variables
e_model_all_subsets_formula(
x_var_names = list(c("a", "b", "c", "d"))
, y_var_name = "z"
, var_formula = NULL
, max_scope = list("one_TWI")
, sw_return = c("both", "formula", "table")[3]
)
# Four variables always in the model (a, b, c, d)
# with selection only on the two second-order variables (c, d),
# with TWI on the two variables (e, f)
e_model_all_subsets_formula(
x_var_names = list(c("a", "b", "c", "d"), c("c", "d"), c("e", "f"))
, y_var_name = "z"
, var_formula = NULL
, max_scope = list("always", "only_SO", "TWI")
, sw_return = c("both", "formula", "table")[3]
)
## Not run:
# Large example showing all options
e_model_all_subsets_formula(
x_var_names = list(letters[1:2], letters[4:5], letters[7:8], letters[10:11], letters[13:14])
, y_var_name = "z"
, var_formula = NULL
, max_scope = list("always", "FO", "TWI", "PQ", "SO")
, sw_return = c("both", "formula", "table")[3]
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.