lm_loop: Linear model loop function

Description Usage Arguments Value

Description

A function to run linear model by cross section

Usage

1
2
lm_loop(dep, ind, date.start, date.end, date.var, actual, w, data, group,
  is.multithread = F, spec = NULL, wols = F, is.int = T)

Arguments

dep

a character of dependent variable name.

ind

a character vector containing independent variables.

date.start

a character of modeling start date in "MM-DD-YYYY".

date.end

a character of modeling start date in "MM-DD-YYYY".

date.var

a character of date variable name.

actual

a character of actual variable name.

w

a character of weight variable name.

data

a data.table class dataset for modeling.

group

a character of cross section variable name.

is.multithread

TRUE turns on parallel computation. Suggest to use it when data is large.

spec

a character vector specifying the cluster spec for parallel computation. For example, spec=rep("localhost",4). Need is.multithread to be TRUE.

wols

a boolean for weighted OLS

is.int

a boolean for intercept. Default value is True.

Value

a list of modeling result. It contains the following components: coef: a matrix with coefficients and statistics. fit: a list containing modeling result of each cross section. group: a character of cross section name.


xinzhou1023/shrinkest documentation built on May 4, 2019, 1:07 p.m.