Formula parser
It parses the formula and separates the dependent, independent and fixed variables and also the constant and linear trends (if present).
parse_formula(formula, colnames_data)
formula |
A "formula" describing the linear model. Details for model specification are given under 'Details'. |
colnames_data |
A character vector containing the colnames of the data
used in the formula (usually via |
The notation we follow (e.g., using y, x, z, w etc.) is according to Pesaran et al. (2001).
The formula
should contain only variables that exist in the data
provided through data
plus some additional functions supported by
dynlm
(i.e., trend()
).
You can also specify fixed variables that are not supposed to be lagged (e.g.
dummies etc.) simply by placing them after |
. For example, y ~
x1 + x2 | z1 + z2
where z1
and z2
are the fixed variables and
should not be considered in order
. Note that the |
notion
should not be confused with the same notion in dynlm
where it
introduces instrumental variables.
A list containing other lists with the names of the dependent, independent and fixed variables, the constant and linear trends and the number of variables in each category.
Pesaran, M. H., Shin, Y., & Smith, R. J. (2001). Bounds testing approaches to the analysis of level relationships. Journal of Applied Econometrics, 16(3), 289-326
Kleanthis Natsiopoulos, klnatsio@gmail.com
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.