extract_variables: Extract the first and second stage regressors of ivreg...

View source: R/utility.R

extract_variablesR Documentation

Extract the first and second stage regressors of ivreg formula

Description

extract_variables takes a formula object for ivreg::ivreg(), i.e. in a format of y ~ x1 + x2 | x1 + z2 and extracts the different elements in a list.

Usage

extract_variables(formula)

Arguments

formula

A formula for the ivreg::ivreg function, i.e. in format y ~ x1 + x2 | z1 + z2.

Value

extract_variables returns a list with three components: $yvar stores the name of the dependent variable, $first the names of the regressors of the first stage and $second the names of the second stage regressors.


ivgets documentation built on Sept. 11, 2024, 6:19 p.m.