- Many parents want to know the gender of their child before birth.
- A natural extension...predict your child's height!
- Envision how tall your child will be.
Ferdinand David
\[\frac{father height + (1.08 * mother height)} {2}\]
Using the two sliders in the model makes for an easy calculation of the midparent height
The ease of use will enable adoption
library(UsingR)
data(galton)
lmgalton <- lm(galton$child~., data = galton)
heightpredict <- function(height,height2)
predict(lmgalton, data.frame(parent=(height+(1.08*height2))/2), interval = "predict")
shinyServer(
function(input, output) {
output$inputValue <- renderPrint({input$height})
output$inputValue2 <- renderPrint({input$height2})
output$prediction <- renderPrint({heightpredict(input$height,input$height2)})
}
)