MPG Predictive Model Application

Carlos Patino
Oct 21, 2015

Simple predictive model for gas consumption

This very easy to use application allows the user to enter vehicle input and produces an estimation of gas consumption

  • Horsepower
  • Vehicle´s Weight (in lb)
  • Transmission type (Auto or Manual)

Once the user has entered these three input values, the application will generate a prediction of MPG for the given vehicle

Data

  • Motor Trend dataset mtcars included in the datasets library in R

plot of chunk eda

Model Specification and RMSE

The model used for the predictions is a simple linear regression with the following specification

\[ MPG = \beta_{0} + \beta_{1}TRANS + \beta_{2}HP + \beta_{3}WT + \beta_{4}TRANS*HP + \beta_{5}TRANS*WT \]

The model´s Root Mean Squared Error is:

[1] 1.375635

Usage

To use the application go to the following link:

Shiny App

Select the vehicle´s horsepower, weight, and type of transmission, then hit Predict!

… And the resulting prediction will be displayed in the main panel along with its location in the mpg distribution