visualize: Visualize Regression Variables

Description Usage Arguments Value Examples

View source: R/visualize.R

Description

Function to visually display the significance of each predictor variable in a regression. The function takes an lm() object as input and outputs a ggplot2-labeled figure.

Usage

1
visualize(model, measure = "P", signif = 0.05, sorted = TRUE)

Arguments

model

an lm() object

measure

use P-values (P) or coefficients (C) to construct plot

signif

significance level for P-values

sorted

whether the variables should be ordered by significance

Value

a ggplot2 object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
X <- runif(500,1,5)
Y <- runif(500,6,10)
Z <- runif(500,-5,0)

W <- rnorm(500,2*Y-X,5)

model <- lm(W~X+Y+Z)

visualize(model)
visualize(model, signif = 0.1)
visualize(model, measure = "C")
visualize(model, measure = "C", sorted = F)

Andy-McCarthy/RegressionImpact documentation built on May 29, 2019, 4:38 p.m.