Assignment - Simple Simulation and Leverage

Building a simulation to explore and understand leverage.

Instructions

Due date: Tuesday September 22th, 9:00am

Submission: https://forms.gle/WnmFBukDpbCadsgb7

Submission type: please submit your .html document (not a .qmd document), generated with Quarto, implementing the analysis required and answering the questions below.

Warning

Make sure to include the following lines as an option to your document (at the very top of your .qmd document, between the two series of ---. Don’t forget to remove the pre-existing format: html line, if there is one). It will produce a self-contained html, ie, a nicely rendered html that stands alone:

format:
  html:
    embed-resources: true

You can find a quick crash-course on Quarto in the R for Data Science online book. You can also find more information directly on the Quarto website.

Questions

  1. Build a simple simulation, as we did in the OVB example with two variables (xx and yy). Add one point to your data set and explore how it affects your estimate of interest (the coefficient for xx in the regression of yy on xx), depending on where this point is located on the xyx-y plane. What is leverage and how does it work? What are its drivers? Describe this in words and with graphs.
Note

You can compute the leverage using the stats::influence function.

  1. Quickly explore other influence functions. How do they work and how do they differ from the leverage?

  2. Add a third variable and produce graphs and analyses to revisit question 1.

  3. Bonus questions. Go back to the OVB example and answer the questions at the end of the document.