standardizeCoefficients: Standardized coefficients

Description Usage Arguments Value Examples

View source: R/extract.R

Description

Computes standardized coefficient for a regression or time series. Three scores are returned:

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
standardizeCoefficients(model, hide = NULL)

## S3 method for class 'lm'
standardizeCoefficients(model, hide = NULL)

## S3 method for class 'rq'
standardizeCoefficients(model, hide = NULL)

## S3 method for class 'varest'
standardizeCoefficients(model, hide = NULL)

## S3 method for class 'svarest'
standardizeCoefficients(model, hide = NULL)

Arguments

model

Model. Supported types are linear models (lm), quantile regressions (rq from the quantreg package) or time series (varest or svarest from the vars package).

hide

A string. All variables starting with that name are excluded.

Value

Coefficients (with transformations) for model variables. In case of multivariate models, it returns a list with an element for each dependent variable.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
library(dplyr)
library(vars)
data(Canada)

prod <- differences(as.numeric(Canada[, 2]))
production <- data.frame(Prod = prod, Lag1 = dplyr::lag(prod), Lag2 = dplyr::lag(prod, 2))

m <- lm(Prod ~ Lag1, data = production)
standardizeCoefficients(m)

m <- lm(Prod ~ Lag1 + Lag2, data = production)
standardizeCoefficients(m)

var.2c <- VAR(Canada, p = 2, type = "none")
standardizeCoefficients(var.2c$varresult$e)
std <- standardizeCoefficients(var.2c)
std$e

library(quantreg)
data(stackloss)

qr <- rq(stack.loss ~ stack.x, 0.25)
standardizeCoefficients(qr)

sfeuerriegel/ResearchGroupTools documentation built on May 29, 2019, 8:01 p.m.