February 28, 2018

Introduction

In our "ShinyCar" app, we have used mtcars dataset to dynamically demonstrate the relationship between gas mileage (miles per gallon) and all other predictors within the dataset.

  • Summary of the cleaned version of mtcars dataset, denoted as mtcarsClean
  • An example of interactive plot for a categorical variable, transmission
  • An example of interactive plot with prediction for a continuous variable disp

Summary of variables

Within this cleaned dataset are 5 categorical variables and 5 continuous variables, listed below

head(mtcarsClean, n = 5)
##                    mpg        cyl disp  hp drat    wt  qsec       vs gear
## Mazda RX4         21.0 6 Cylinder  160 110 3.90 2.620 16.46 s-shaped    4
## Mazda RX4 Wag     21.0 6 Cylinder  160 110 3.90 2.875 17.02 s-shaped    4
## Datsun 710        22.8 4 Cylinder  108  93 3.85 2.320 18.61 v-shaped    4
## Hornet 4 Drive    21.4 6 Cylinder  258 110 3.08 3.215 19.44 v-shaped    3
## Hornet Sportabout 18.7 8 Cylinder  360 175 3.15 3.440 17.02 s-shaped    3
##                   carb transmission
## Mazda RX4            4       manual
## Mazda RX4 Wag        4       manual
## Datsun 710           1       manual
## Hornet 4 Drive       1    automatic
## Hornet Sportabout    2    automatic

A categorical variable example

Illustrated below is an example of an interactive data visualizatino for a category variable transmission in ShinyCar.

A continuous variable example

Illustrated below is an example of an interactive data visualizatino for a continuous variable disp by cyl in ShinyCar, with three interactive linear prediction lines as well as their corresponding 90% confidence intervals upon clicking.