October 4, 2018

Introduction to Shiny App

This presentation will attempt to show the viewer the benefits of using my regression shiny app. I created an interactive shiny app that performs various multilinear and linear regression functions on a dataset of the weights of chicks after treatment over time with various diets. These models can be compared with each other and a decision can be made to move to the next step of the modeling process after this initial exploratory analysis. The application provides various analysis that one can navigate to on different tabs such as information about the chick weight dataset, summary information on the fitted regression models, the percent error of the model on the test set and residual plots to give inside into how further models can be determined.

First Tab

The first tab provides information about the dataset, such as the summary below.

##      weight           Time           Chick     Diet   
##  Min.   : 35.0   Min.   : 0.00   13     : 12   1:220  
##  1st Qu.: 63.0   1st Qu.: 4.00   9      : 12   2:120  
##  Median :103.0   Median :10.00   20     : 12   3:120  
##  Mean   :121.8   Mean   :10.72   10     : 12   4:118  
##  3rd Qu.:163.8   3rd Qu.:16.00   17     : 12          
##  Max.   :373.0   Max.   :21.00   19     : 12          
##                                  (Other):506

Second and Third Tabs

The second and third tabs provide information about the regression model, including summary information for the model and percent error of the model on the test set. An example is below:

## 
## Call:
## lm(formula = weight ~ Time + Diet, data = train)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -133.803  -16.218   -2.571   15.071  153.558 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   2.6506     4.5977   0.576    0.565    
## Time          8.6607     0.2547  34.000  < 2e-16 ***
## Diet         11.6390     1.4948   7.787  5.2e-14 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 36.42 on 430 degrees of freedom
## Multiple R-squared:  0.7416, Adjusted R-squared:  0.7404 
## F-statistic:   617 on 2 and 430 DF,  p-value: < 2.2e-16
## [1] 36.59624

Fourth Tab

The fourth tab provides residual plots that show wether the fitted model is a good fit for determining the weight by various variables. Based on these plots a decision can be made to alter the models or not. An example residual plot output is below:

Summary

The shiny app allows users to determine what the data is, how it can be used best to determine the chick weights by various attributes and help decide how to improve the model. All of this is done reactively with automation giving the user immediate results. A support vector machine algorithm is also included to compare how another model may fit the data.