parse_formula: Formula parser

View source: R/parsers.R

parse_formulaR Documentation

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

parse_order


ARDL documentation built on Aug. 21, 2023, 9:10 a.m.