Jill Beck
April 9 2016
The analysis will explore the relationship between a set of variables on Miles Per Gallon (MPG). The analysis will focus on the following questions:
From the plot, we can see some higher correlations between variables such as:
The regression model will predict MPG based on transmission type, weight and horsepower.
Linear regression model:
fit <- lm(mpg ~ am + wt + hp, data = mtcars)
Coefficient:
| Estimate | Std. Error | t value | Pr(>|t|) | |
|---|---|---|---|---|
| (Intercept) | 34.0028751 | 2.6426593 | 12.866916 | 0.0000000 |
| amManual | 2.0837101 | 1.3764202 | 1.513862 | 0.1412682 |
| wt | -2.8785754 | 0.9049705 | -3.180850 | 0.0035740 |
| hp | -0.0374787 | 0.0096054 | -3.901830 | 0.0005464 |
Shiny App Screenshot