README.md

title: "model.plot" author: "Hayley Arader" output: html_document

Welcome!

Welcome to model.plot! model.plot is an R package designed to make it easier to plot, interact with, and interpret your basic model results.

Installation

devtools::install_github("harader/model.plot")
libary(model.plot)

Usage

Let's load some data from the ISLR package and play around

library(ISLR)
summary(College)

This looks like an interesting data set about colleges! Let's subset to only private colleges, and run a regression on out of state tuition:

my_model <- lm(Outstate ~ perc.alumni + Grad.Rate + Top10perc + PhD + Terminal, data = College[College$Private == "Yes", ])

# Standard plot
plot(my_model)

plot of chunk unnamed-chunk-3

Cool! Now let's say we want to see all variables, not just where p < .05

plot(my_model, p = 1)

plot of chunk unnamed-chunk-4

And now a bar plot...

bar_plot(my_model)

plot of chunk unnamed-chunk-5

And a table...

stat_table(my_model)

plot of chunk unnamed-chunk-6

And a histogram of residuals...

plot_residuals(my_model)

plot of chunk unnamed-chunk-7

Woohoo! Happy Plotting!



harader/model.plot documentation built on May 12, 2019, 5:40 a.m.