George Fandeev
19-07-2016
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:
And output: Fertility. Which is "common standardized fertility measure”.
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.
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