Exam 2 (Nov 11): review and practice materials

Format

Similar format to Exam 1. Two parts: the first being pen-and-paper, and the second being open-computer.

  • Part 1:
    • Closed computer and closed notes
    • Handwritten answers
  • Part 2:
    • Open computer. Any online resource that is “not alive” may be used (i.e. you may freely use online resources, but you may not communicate with any other person).
    • Electronic submission on Moodle: you will fill in a Quarto script with R code and written answers

Once you turn in Part 1, you may open your computer and download the blank Quarto script for Part 2. You may not return to Part 1 after turning it in and beginning the open-computer portion.

Topics

Based on material from Weeks 8-11, the TMDB case study, and Homework 3, the exam will cover:

  • Linear Regression Fundamentals
    • Simple linear regression: fitting, interpreting, predicting
    • The lm() function and formula syntax
    • Regression equation: \(Y = \beta_0 + \beta_1 X + \varepsilon\)
    • Interpreting coefficients (intercept and slope)
    • Understanding residuals
  • Regression Inference
    • Hypothesis tests for regression coefficients
    • P-values and statistical significance
    • Confidence intervals for coefficients: confint()
    • R-squared and adjusted R-squared
  • Making Predictions
    • Using predict() with new data
    • Confidence intervals for mean response (interval = "confidence")
    • Prediction intervals for individual observations (interval = "prediction")
    • Difference between confidence and prediction intervals
    • Dangers of extrapolation
  • Multiple Linear Regression
    • Including multiple predictors: lm(y ~ x1 + x2 + x3)
    • Interpreting coefficients when holding other variables constant
    • Comparing models with different predictors
    • Using anova() for model comparison (F-tests)
    • Understanding when adding predictors improves fit
  • Functions and Function-Oriented Programming
    • Writing functions in R: syntax and structure
    • Function arguments and default values
    • Return values (implicit and explicit)

Review materials

Practice exam for Part 1

For Part 1 (on paper, closed computer), I have created a practice exam to give you a sense of the format and topics: part_1_practice.pdf.

The solution is here: part_1_practice_solution.pdf.

Key lectures

Key assignments

  • Homework 3 - Comprehensive regression practice
  • Quiz 3 - In-class quiz covering Homework 3
  • Lab 5 - Function-oriented programming
  • TMDB Case Study - Real data analysis with inference and prediction