Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

parse_formula

Formula parser


Description

It parses the formula and separates the dependent, independent and fixed variables and also the constant and linear trends (if present).

Usage

parse_formula(formula, colnames_data)

Arguments

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 colnames(data)).

Details

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.

Value

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.

References

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

Author(s)

Kleanthis Natsiopoulos, klnatsio@gmail.com

See Also


ARDL

ARDL, ECM and Bounds-Test for Cointegration

v0.1.1
GPL-3
Authors
Kleanthis Natsiopoulos [aut, cre] (<https://orcid.org/0000-0003-1180-2984>), Nickolaos Tzeremes [aut] (<https://orcid.org/0000-0002-6938-3404>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.