utils.stats.get_all_vars_from_formula
utils.stats.get_all_vars_from_formula(formula)Utility function to extract variables from a formula.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| formula | str | A formula. | required |
Returns
| Name | Type | Description |
|---|---|---|
| list | list | A list of variables. |
Examples
>>> from spotpython.utils.stats import get_all_vars_from_formula
get_all_vars_from_formula("y ~ x1 + x2")
['y', 'x1', 'x2']
get_all_vars_from_formula("y ~ ")
['y']