reg_aux: Auxiliary regression of all covariates on one (or more)...

Description Usage Arguments Details Value Methods (by class) Examples

View source: R/reg_aux.R

Description

Given a regression of y on x and covariates, estimate the correlation between all covariates and the variable x

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
reg_aux(object, ...)

## Default S3 method:
reg_aux(object, var_main, var_controls = NULL, ...)

## S3 method for class 'lm'
reg_aux(object, var_main, var_controls = NULL,
  method = c("update", "update_lmfit", "sweep"), add_vcov = FALSE, ...)

## S3 method for class 'felm'
reg_aux(object, var_main, var_controls = NULL,
  method = c("update", "sweep"), add_vcov = FALSE, ...)

## S3 method for class 'reg_aux_lm'
vcov(object, ...)

Arguments

object

output from regression

...

unused

var_main

a character, name of the variable of interest

var_controls

a character, name of the covariates

method

whether to use the standard update() funciton, or a faster sweep one

add_vcov

for method with sweep, wether to compute also the vcov

Details

This is a generic function: methods can be defined for it directly or via the Summary group generic. For this to work properly, the arguments ... should be unnamed, and dispatch is on the first argument.

Value

An object of the same type

Methods (by class)

Examples

1
2
  model_lm <- lm(y ~ lag.quarterly.revenue + price.index + income.level + market.potential, data=freeny)
  res_lm <- reg_aux(object=model_lm, var_main = "lag.quarterly.revenue")

MatthieuStigler/misconometrics_pkg documentation built on May 6, 2019, 9:07 a.m.