Learn R Programming

speccurvieR (version 0.4.2)

formula_builder: 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)

Value

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

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.

Examples

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

Run the code above in your browser using DataLab