Maria Mendoza
Mon Jun 15 01:22:40 2015
The Child Height Prediction App is an application that attempts to predict the height of a child given it's gender and both it's parents' height. It uses a simple linear model to make its prediction.
Go to https://mariamendoza.shinyapps.io/ChildHeightPrediction to access the app.
The linear model used to make the prediction is based on the GaltonFamilies dataset in the HistData library in R.
The dataset contains observations of 934 children in 205 families in 1886.
library(HistData)
data(GaltonFamilies)
str(GaltonFamilies)
'data.frame': 934 obs. of 8 variables:
$ family : Factor w/ 205 levels "001","002","003",..: 1 1 1 1 2 2 2 2 3 3 ...
$ father : num 78.5 78.5 78.5 78.5 75.5 75.5 75.5 75.5 75 75 ...
$ mother : num 67 67 67 67 66.5 66.5 66.5 66.5 64 64 ...
$ midparentHeight: num 75.4 75.4 75.4 75.4 73.7 ...
$ children : int 4 4 4 4 4 4 4 4 2 2 ...
$ childNum : int 1 2 3 4 1 2 3 4 1 2 ...
$ gender : Factor w/ 2 levels "female","male": 2 1 1 1 2 2 1 1 2 1 ...
$ childHeight : num 73.2 69.2 69 69 73.5 72.5 65.5 65.5 71 68 ...
It was observed that there was a distinct clustering of heights for each gender. Because of this, 2 linear models were created and used for prediction, one for each gender of the child.
In order to make predictions in the app, we provided an input for gender and each of the parents' height (in inches). The parents' heights were then used to calculate the “midparentHeight”.
This was adopted from Galton and uses the following formula:
midparentHeight <- (father + mother*1.08)/2
The app then chooses the appropriate linear model to use depending on the gender chosen and applies the midparentHeight to derive the child height prediction.