Decides how a dependent variable should be modelled by inspecting its type and distribution of values. The measurement scale is the first branch of a principled model choice: it dictates the family (Gaussian, binomial, Poisson, cumulative-link) before any distributional assumption is checked.
Details
The rules are deliberately simple and transparent:
ordered factor \(\rightarrow\)
"ordinal";logical, a two-level factor, or a numeric/character with exactly two distinct values \(\rightarrow\)
"binary";unordered factor/character with more than two levels \(\rightarrow\)
"nominal";integer-valued numeric with at most
ordinal_max_levelsdistinct values (a Likert-type item) \(\rightarrow\)"ordinal";non-negative integer-valued numeric with more distinct values \(\rightarrow\)
"count";any other numeric \(\rightarrow\)
"continuous".
The heuristics can never be perfect (a 1–7 Likert item and a small count are
genuinely ambiguous); pass an explicit outcome_type to
recommend_test() when you want to override them.