Assignment - Simple Simulation and Leverage

Building a simulation to explore and understand leverage.

Instructions

Due date: Tuesday September 16th, 8:30am

Submission: https://forms.gle/Atne4vcTA48ht3vKA

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

This assignment is not graded but I kindly ask you to do it as we are going to discuss your results in class. I will show some of the analyses and graphs you will produce in class.

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

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.