Assignment - Simple Simulation and Leverage
Building a simulation to explore and understand leverage.
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.
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
- Build a simple simulation, as we did in the OVB example with two variables ( and ). Add one point to your data set and explore how it affects your estimate of interest (the coefficient for in the regression of on ), depending on where this point is located on the plane. What is leverage and how does it work? What are its drivers? Describe this in words and with graphs.
You can compute the leverage using the stats::influence
function.
Quickly explore other influence functions. How do they work and how do they differ from the leverage?
Add a third variable and produce graphs and analyses to revisit question 1.
Bonus questions. Go back to the OVB example and answer the questions at the end of the document.