Monalisa H V
1/8/2026
Fuel efficiency is an important factor in the automotive industry.
Miles Per Gallon (MPG) measures how efficiently a vehicle uses fuel.
This project demonstrates how an interactive Shiny application can be used to: - Predict MPG - Visualize relationships between vehicle attributes - Support data-driven decision making
Choosing a fuel-efficient vehicle is challenging because: - MPG depends on multiple factors - Manual calculations are difficult - Static models lack interactivity
Objective:
To build an interactive application that predicts MPG based on: - Car weight
- Horsepower
The Shiny application allows users to: - Select car weight using a slider - Select horsepower using a slider - Predict MPG dynamically - View a regression plot of MPG vs weight
The app uses a linear regression model trained on automobile data.
Example input values: - Car weight = 3 (1000 lbs) - Horsepower = 110
The model calculates and displays the predicted MPG based on these inputs.
Users can modify the inputs to observe how MPG varies.
##
## Call:
## lm(formula = mpg ~ wt + hp, data = mtcars)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.941 -1.600 -0.182 1.050 5.854
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 37.22727 1.59879 23.285 < 2e-16 ***
## wt -3.87783 0.63273 -6.129 1.12e-06 ***
## hp -0.03177 0.00903 -3.519 0.00145 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.593 on 29 degrees of freedom
## Multiple R-squared: 0.8268, Adjusted R-squared: 0.8148
## F-statistic: 69.21 on 2 and 29 DF, p-value: 9.109e-12
This project demonstrates: - Use of Shiny for interactive analytics - MPG prediction using linear regression - Real-time visualization and user input handling
The application helps users understand how vehicle characteristics affect fuel efficiency.
Thank you for reviewing this project.