Buying a car involves understanding fuel efficiency. This application helps users predict Miles Per Gallon (MPG) based on two key factors:
Gross Horsepower: How much power the engine produces.
Weight: How heavy the car is (in thousands of lbs).
January 31, 2026
Buying a car involves understanding fuel efficiency. This application helps users predict Miles Per Gallon (MPG) based on two key factors:
Gross Horsepower: How much power the engine produces.
Weight: How heavy the car is (in thousands of lbs).
The application features a user-friendly sidebar with:
Slider Inputs: Precisely select Horsepower and Weight.
Reactive Plot: A real-time visualization showing where your input falls compared to the mtcars dataset.
Instant Calculation: The prediction updates the moment you move a slider—no “Submit” button required!
summary(mtcars$mpg)
## Min. 1st Qu. Median Mean 3rd Qu. Max. ## 10.40 15.43 19.20 20.09 22.80 33.90
The app uses a multivariate linear regression. You can see the relationship between weight and MPG here:
## `geom_smooth()` using formula = 'y ~ x'
This is my shinyapps.io link: https://vivpro.shinyapps.io/mpg_reproducible_pitch/