rwa {rwa}R Documentation

Create a Relative Weights Analysis (RWA)

Description

This function creates a Relative Weights Analysis (RWA) and returns a list of outputs. RWA provides a heuristic method for estimating the relative weight of predictor variables in multiple regression, which involves creating a multiple regression with on a set of transformed predictors which are orthogonal to each other but maximally related to the original set of predictors. rwa() is optimised for dplyr pipes and shows positive / negative signs for weights.

Usage

rwa(df, outcome, predictors, applysigns = FALSE, plot = TRUE)

Arguments

df

Data frame or tibble to be passed through.

outcome

Outcome variable, to be specified as a string or bare input. Must be a numeric variable.

predictors

Predictor variable(s), to be specified as a vector of string(s) or bare input(s). All variables must be numeric.

applysigns

Logical value specifying whether to show an estimate that applies the sign. Defaults to FALSE.

plot

Logical value specifying whether to plot the rescaled importance metrics.

Details

rwa() produces raw relative weight values (epsilons) as well as rescaled weights (scaled as a percentage of predictable variance) for every predictor in the model. Signs are added to the weights when the applysigns argument is set to TRUE. See https://relativeimportance.davidson.edu/multipleregression.html for the original implementation that inspired this package.

Value

rwa() returns a list of outputs, as follows:

Examples

library(ggplot2)
rwa(diamonds,"price",c("depth","carat"))


[Package rwa version 0.0.3 Index]