Learn R Programming

crimeutils (version 0.5.1)

make_regression_graph: Make a graph of coefficient values and 95 percent confidence interval for regression.

Description

Make a graph of coefficient values and 95 percent confidence interval for regression.

Usage

make_regression_graph(model, coefficients = NULL)

Value

Outputs a `ggplot2` graph

Arguments

model

A `lm` object made from making a model using `lm()`.

coefficients

A string or vector of strings with the coefficient names. Will then make the graph only with those coefficients.

Examples

Run this code
make_regression_graph(model = lm(mpg ~ cyl + disp + hp + drat, data = mtcars))
make_regression_graph(model = lm(mpg ~ cyl + disp + hp + drat, data = mtcars),
coefficients = c("cyl", "disp"))
make_regression_graph(model = lm(mpg ~ cyl + disp, data = mtcars))

Run the code above in your browser using DataLab