fmreg_: Advanced Fama-MacBeth regression.

Description Usage Arguments Value

Description

fmreg_ estimates Fama-MacBeth regressions on many specifications "in parallel".

Usage

1
2
3
fmreg_(.data, models, dates, date_var, load_data = NULL,
  prepare_data = NULL, estimate = NULL, aggregate = NULL,
  progress = FALSE)

Arguments

.data

"Data frame - like" structure. .data can be a data frame, a data table, or a tibble, including a "connection" to a out-of-memory database.

models

A list of models. Each model specifies the model to be estimated.

dates

A vector of dates that are included in the estimation of the regression.

date_var

Name of the date variable (should be a colname in .data).

load_data

Function of the form function(.data, .date, date_var) that returns a data frame. This function is used to get the "slice" of .data for .date. If NULL, the internal function is used.

prepare_data

Function of the form function(.data, .date) that returns a data frame. This function modifies the "slice" of data loaded with load_data before the first stage regression is done on this "slice" of data. If NULL, this step is skipped.

estimate

Function of the form function(model, .data, .date) that returns a list of the first-stage estimates for .date. This function should produce results that aggregate will be able to use for the second stage. If NULL, the internal function is used.

aggregate

Function of the form function(model, l_fit) that returns an fmreg object. This function takes a model and a list of the first stage estimates for the model and does the second stage of the Fama-MacBeth regression. If NULL, the internal function is used.

progress

Logical: If TRUE, the progress of the estimation is printed to the standard output.

Value

A list with of fmreg objects. Each object corresponds to the model from the models argument.


max-sokolov/fmreg documentation built on May 21, 2019, 1:38 p.m.