1. Create a linear model from the “swiss” data set (in the datasets package), predicting Fertility based on Agriculture. Now build a model predicting Fertility based on Education, and finally a model using both variables. Use anova to ask if the combination of Agriculture and Education is statistically significantly better than Education alone. Finally, use the step function to quickly find an optimal model for predicting Fertility, selecting features from all the predictive variables. The easiest way to do this will be to set “object” equal to a model containing all the other variables (lm(Fertility ~ .,data=swiss)) with no other function options specified.

  2. Using the “read.csv” function, read in a data frame of data about graduate students acceptance (https://stats.idre.ucla.edu/stat/data/binary.csv). Build a logistic regression model that predicts acceptance based on the predictive variable GRE and GPA. Do these two predictive variable seem to have equal importance in the prediction? How do you know? (Adapted from the web tutorial at https://stats.idre.ucla.edu/r/dae/logit-regression/)