Katherine Vance
July 3, 2020
The app is user-friendly and takes simple inputs:
With these inputs, the app displays a graph and gives an easy-to-understand sentence predicting the child's height.
If the user inputs a mother's height of 65 inches and a father's height of 70 inches, the following graph will be displayed:
library(tidyverse)
library(UsingR)
data(galton)
# Build the model to predict child's height from parent height
fit <- lm(child ~ parent, galton)
# Process the inputs and predict the child's height
parentAvg <- (1.08*input$mother + input$father)/2
childPred <- predict(fit, newdata = data.frame(parent = parentAvg))