S Ghiya
11-Apr-2016
A simple Shiny application has been built and published to generate the linear regression between two variables of the “mtcars” dataset.
In this application the user choose the predictor and outcome is always fixed as “mpg”.
The dataset was extracted from the 1974 Motor Trend US magazine, and comprises fuel consumption and 10 aspects of automobile design and performance for 32 automobiles (1973–74 models).
It is a data frame with 32 observations on 11 variables.
| Columns (1 to 6) | Columns (7 to 11) |
|---|---|
| - mpg Miles/(US) gallon | - qsec ¼ mile time |
| - cyl Number of cylinders | - vs V/S |
| - disp Displacement (cu.in.) | - am Transmission (0 = automatic, 1 = manual) |
| - hp Gross horsepower | - gear Number of forward gears |
| - drat Rear axle ratio | - carb Number of carburetors |
| - wt Weight (1000 lbs) |
This will generate a plot (on the Right) similar to the one shown for the variable selected on left side.
This tab shows the Fitment of (mpg ~ variable Selected).
On selecting this tab, one can dee the summary of the Model Fitment.
Call:
lm(formula = mpg ~ cyl, data = mtcars)
Residuals:
Min 1Q Median 3Q Max
-4.9814 -2.1185 0.2217 1.0717 7.5186
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 37.8846 2.0738 18.27 < 2e-16 ***
cyl -2.8758 0.3224 -8.92 6.11e-10 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.206 on 30 degrees of freedom
Multiple R-squared: 0.7262, Adjusted R-squared: 0.7171
F-statistic: 79.56 on 1 and 30 DF, p-value: 6.113e-10