Introduction


The Solution


Calculation of the slope and intercept

## 
## Attaching package: 'HistData'
## 
## The following object is masked _by_ '.GlobalEnv':
## 
##     GaltonFamilies
 GaltonFamilies$childHeight     <- round((GaltonFamilies$childHeight * 2.54)/100,3)
 GaltonFamilies$midparentHeight <- round((GaltonFamilies$midparentHeight * 2.54)/100,3)
 fitSon         <- lm(childHeight ~ midparentHeight, data=GaltonSon)
 round(summary(fitSon)$coef[2,1], 3) ## the slope
## [1] 0.713
 round(summary(fitSon)$coef[1,1], 3) ## the intercept
## [1] 19.913
 round(summary(fitSon)$coef[2,2]*100, 0) ## the standard error in cm
## [1] 6

The ShinyApp