formula_builder: Builds models formulae with every combination of control...

View source: R/helpers.R

formula_builderR Documentation

Builds models formulae with every combination of control variables possible.

Description

Builds models formulae with every combination of control variables possible.

Usage

formula_builder(y, x, controls, fixedEffects = NA)

Arguments

y

A string containing the dependent variable name.

x

A string containing the independent variable name.

controls

A vector of strings containing control variable names.

fixedEffects

A string containing the name of a variable to use for fixed effects, defaults to 'NA' indicating no fixed effects desired.

Value

A vector of formula objects using every possible combination of controls.

Examples

formula_builder("dependentVariable", "independentVariable",
                c("control1", "control2"));
formula_builder("dependentVariable", "independentVariable",
                c("control1*control2"), fixedEffects="month");

speccurvieR documentation built on Oct. 10, 2024, 1:08 a.m.