comb_regr: Estimate OLS from Data Frame

View source: R/dynadj.R

comb_regrR Documentation

Estimate OLS from Data Frame

Description

This function is just a convenient way to estimate an OLS model from a data frame where the first variable is the dependent one of the model and the remaining are the regressors. This function is used internally by other functions.

Usage

comb_regr(df)

Arguments

df

A data frame or a tibble. First column of the data frame must be the y variable in a regression of the type y_i = \beta_0 + \beta_1x_{i1} + \beta_2x_{i2} + ... + \beta_nx_{in} + \epsilon_i, for example.

Value

An object of class lm.

Examples

coreinf_br %>%
dplyr::select(ipca, ipcams) %>%
comb_regr()

coreinf_br %>%
 dplyr::select(ipca, ipcadp) %>%
 dplyr::mutate(`ipca(-1)` = dplyr::lag(ipca)) %>%
 comb_regr()

nelson16silva/wavcoreinf documentation built on Feb. 17, 2025, 7:10 p.m.