Lab - week 2

Data

presidents.csv

USpop.csv

Exercise 1

  1. Read in the USpop data
  2. Create a scatterplot of Year and Population from the USpop data set.
  3. Fit a linear model to USpop with Population as the response and Year as the predictor.
  4. Look at the summary of he model. Plot the model against the scatterplot.
  5. Fit a quadratic regression model.
  6. Use the model to predict what will happen in year 2030, 2040, and 2050. Is this realistic?

Exercise 2

  1. Read in the presidents data
  2. Create a scatterplot of actual and expected from the presidents data set.
  3. Fit a linear model to presidents with actual as the response and expected as the predictor.
  4. Look at the summary of he model. Plot the model against the scatterplot. How well does the model fit?