7/31/2019

Description of app

  • This app, created with Shiny, allows the user to input a numeric speed in miles per hour.
  • The linear regression model will calculate the predicted stopping distance needed in feet.
  • The user can change the input of speed and see where on the graph their chosen point lies.
  • The data being used for this model is the ‘cars’ dataset in R.

Linear Regression

In this app, the linear regression is applied to the dataset with speed as the predictor for stopping distance (dist).

model<-lm(dist~speed,data=cars)
print(model)
## 
## Call:
## lm(formula = dist ~ speed, data = cars)
## 
## Coefficients:
## (Intercept)        speed  
##     -17.579        3.932

Plot

Links