Auxiliary function that takes in a two-sided formula, and extracts the variable names of either the covariates or instruments. The function returns an error if the formula includes a variable called 'intercept'.
getXZ(fm, inst = FALSE, terms = FALSE, components = FALSE)
the formula.
boolean expression, set to TRUE if the instrument names are to be extracted. Otherwise, the covariate names are extracted.
boolean expression, set to TRUE if the terms in the
formula fm
should be returned instead of the variable
names.
boolean expression, set to FALSE by default. Indicates that the formula being considered is constructed from a list of components, and thus the term 'intercept' is permitted.
vector of variable names.