Fertility prediction

George Fandeev
19-07-2016

Main Idea

Disclaimer. This presentation is homework devoted to R presentations (not to linear models and prediction). Please remember it. So there can be some assumptions in model fitting. And model itself can be not the best model for this dataset.

Fertility prediction service is based on swiss dataset included in R “datasets” package. There are 5 predictors:

  • Agriculture : % of males involved in agriculture as occupation
  • Examination : % draftees receiving highest mark on army examination
  • Education : % education beyond primary school for draftees.
  • Catholic : % “catholic” (as opposed to “protestant”“).
  • Infant.Mortality : % live births who live less than 1 year.

And output: Fertility. Which is "common standardized fertility measure”.

Predictors

We can see that the Examination and Education, Agriculture and Examination variables are hihgly correlated. So we can exclude one of them from our linear model.

plot of chunk unnamed-chunk-1

Linear model

Our prediction will be performed with 3 variables:

lm(formula = Fertility ~ ., data = swiss[, -c(2, 3)])
                    Estimate Std. Error   t value     Pr(>|t|)
(Intercept)      48.67707330 7.91908348  6.146806 2.235983e-07
Education        -0.75924577 0.11679763 -6.500524 6.833658e-08
Catholic          0.09606607 0.02721795  3.529511 1.006201e-03
Infant.Mortality  1.29614813 0.38698777  3.349326 1.693753e-03

Shiny application

fertility prediction aplication is very simple to use!

You can find my application HERE!