May 10, 2020

Introduction

The application allows the users to select 2 to 3 variables (name as Y, X and Z below) and fit them to the Fitting Linear Models and make prediction with the values the user put in.

The web application can be accessed here: https://sruan.shinyapps.io/C9W4/. There are 6 plots on the mail panel. It may take a while for to load.

The data used is the state.x77 in the R Datasets Package named datasets.

Use the WebApp

Prefer to select LifeExp as the Y variable, as the last plot was base on LifeExp being the Y variale.

Users can:

  1. Change the line size in the first plot.
  2. Select X or/and Z variable to see the linear model.
  3. Input a value for the selecte variable X or/and Z and make a prediction.
  4. Select another varible other than the X variable to display on the scatter plot.
  5. Change the color of the circle of the dots on the selected varible on the last plot.

Data Exploration

The points of each varialble overlap each other and are hard to see.

Data Formating

  • Turn Illiteracy, Murder and HS Grad into number of people.
  • Turn the Area into Population Density.
  • Refer the min-max-mean data in the table below to input X and Z value.
     Population Income Illiteracy Life Exp Murder  HS Grad  Frost    Area
Min      365.00 3098.0       3.00  67.9600   1.00   237.00   0.00    1.03
Max    21198.00 6315.0     270.00  73.6000 219.00 13270.00 188.00 1551.87
Mean    4246.42 4435.8      53.06  70.8786  37.46  2220.78 104.46   66.10

Plotly After Formating

The points of each varialble have less overlap and easier to see. We can better see the relationship between each variable and the life expectancy.