Learn R Programming

speccurvieR (version 1.0.0)

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, fixed_effects = 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.

fixed_effects

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

...

Deprecated camelCase arguments (`fixedEffects`); use `fixed_effects` instead.

Examples

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

Run the code above in your browser using DataLab