Converts a no-intercept formula to the corresponding formula with an intercept while preserving the formula environment. Top-level no-intercept encodings such as - 1, + 0, and 0 + are removed without editing transformed calls such as I(x - 1) or offset(x - 1).

formula_add_intercept(formula)

Arguments

formula

a formula object.

Value

A formula object with an intercept.