Homework

Homework assignments are posted one week before they are due. Check the syllabus for the submission deadlines.

Objective

  • The goal of homework assignments is for you to apply what we have seen in class.

  • We will review all the content you need to complete the assignments successfully, but you will need to adapt some of the material to a set of different problems.

  • All homework assignments include a substantial part of coding, though this is only used as a mean to analyze data. If you are stuck in a specific code for too long, make sure to reach out to the instruction team!

Instructions

  • Homework assignments are posted on Canvas, so make sure you check the instructions and deadlines in the platform.

  • For homework assignments, most questions will be answered directly on Canvas, but you will have to submit a PDF write-up for others questions (e.g. plots, regression output).

  • In some questions, we will also ask for you to submit a specific line of code. All these instructions will be included in the individual assignments, so make sure you review them carefully.

  • In addition to your PDF write-up, you will need to submit your R script (.R extension). This script has to contain all the code you used to complete the homework assignment in a coherent way. Review the tips below to make sure your code complies with the requirements.

What should my R Script look like?

  • Use the template provided in each homework assignment to make it easier.

  • Check that you are not loading any data locally (i.e. from your own computer). All data provided is hosted online and should be accessed that way. Any changes that you make to the data have to be contained on the R script.

  • Make sure you are loading all required packages, and load them at the beginning of the script.

  • Is my script reproducible? To make sure of this, before submission, close RStudio, re-open it, and run your entire script once. Does it run without errors? Good. If it doesn’t:

    i) Check whether you loaded all necessary packages ii) You are running everything in order iii) You don’t have any errors in your code

  • Make sure all the code is there. If there is a question for which you needed code and the chunk of code is not there, that question will not be reviewed.

Templates for Homework Assignments

Template HW1

Answer Keys

HW1 Answer Key

HW2 Answer Key

HW3 Answer Key

HW4 Answer Key

HW5 Answer Key

HW6 Answer Key

HW7 Answer Key






© Magdalena Bennett - licensed under Creative Commons.