Applied Economic Analysis

This website contains the material for the MSc course Applied Economics 1.

This website is under construction for 2022/2023

This year the course is taught by:

Python in AEA

Screencasts

For this course a series of screencasts is available. The screencasts can be found on this webpage.

Organisation of the course

Since we have recorded screencasts, we will not repeat these during the lectures. The lectures are meant for interaction (only).

we will use the following format:

  • in the python lectures we will answer questions that you ask us
  • in order to prepare these answers, it is useful if you create an issue via this link
    • using the link, create an "issue" where you explain what your question is: what did you try and why did it not work?
      • hence not a something like "I do not know the answer to: Question Calculate the total welfare that this planner can achieve. Denote this value max_welfare."
      • but "I tried to calculate total welfare in the following way … but then I get the following error …"
      • describing your question like this, helps you better understand what your problem is
      • and it helps us to answer the question in class.
  • for us to be able to prepare these answers, submit the issue on the Friday before the week in which we discuss the topic
    • hence, finish the sections in the week before they are discussed in class
    • if you can solve everything yourself, there is no need to attend the lecture (but you are, of course, welcome to do so)
    • this is one of the advantages of programming: you can see for yourself whether it works or not.

A suggested workflow to learn programming efficiently is:

  • follow the Datacamp courses and make notes of what you learn at Datacamp in a notebook on the jupyterlab server
    • in this way it is easy to refer back to useful code snippets that you see on Datacamp
  • go through the jupyter notebook for the lecture and try to answer the questions and assignments
  • if you get stuck with a problem, watch the corresponding screencast for this part. It gives hints and ways to solve the questions in the notebook
  • if you still cannot figure it out, create an issue on github to ask us
  • we will answer your questions in class

Two weeks in November will be focused on gender economics. In the lectures Mery will discuss some papers on this topic. There is a notebook where the models discussed are simulated in Python. These notebooks are then discussed at the end of the week. The notebooks will teach you something about gender economics and Python. At the same time, they show you what we expect you to do in the final assignment for this course: take an existing theory paper and solve the model in Python and simulate outcomes of the model.

We highly recommend that you read the book by Jean Tirole to get an idea how you can communicate economic models to a non-economic audience. This will be useful both for your final assignment and for writing your MSc thesis.

Remark: We have been teaching this course for a couple of years now. Every year there are a number of students who attend the lectures without preparing anything and watch the screencasts without trying to program themselves. We live in a free country and you choose how to spend your time. However, this strategy does not work well. You actually end up spending far more time on finishing the course than when you follow the planning we suggest below. The reason is as follows: learning a programming language is frustrating. You learn by making mistakes and then trying to figure out what goes wrong. When you make these mistakes during the semester, you are well covered: we are there to help you. When you make these mistakes for the first time when trying to finish your assignment before the deadline, you are in trouble. We will try to help you but not within an hour, or within a day. And because you need to finish before the deadline, you have to figure everything out by yourself under time pressure. Not a pleasant experience and one you can easily avoid. But the choice is yours.

Lecture schedule

At the moment, we believe that the all lectures will be on campus. If we would need to switch to on-line lectures, we will let you know via Canvas

day date time staff room Topic Datacamp
Tue 2022-08-30 14:45-16:30 Boone, J. CZ 114 Intro python, markdown, github, jupyterlab  
Wed 2022-09-07 16:45-18:30 Ladenstein, J CZ 7 Plenary Career Session: see Canvas for details Intro (3,4)
Mon 2022-09-12 14:45-18:30 Ladenstein, J. RTZ 202 Career workshops: see Canvas for details Intermediate (1,2)
Mon 2022-09-12 14:45-18:30 Boomaars, J. RTZ 203 Career workshops: see Canvas for details  
Tue 2022-09-13 12:45-16:30 Ladenstein, J. RTZ 103 Career workshops: see Canvas for details Intermediate (3,4,5)
Tue 2022-09-13 12:45-16:30 Boomaars, J. RTZ 501 Career workshops: see Canvas for details  
Wed 2022-09-21 12:45-14:30 CANCELLED     Pandas (1,2)
Thu 2022-09-29 12:45-14:30 Boone, J. CZ 7 The market and Asymmetric information Pandas (3,4)
Tue 2022-10-11 10:45-12:30 Boone, J. CZ 9 Financial crisis  
Tue 2022-11-08 10:45-12:30 Boone, J. CZ 9 Empirical research  
Wed 2022-11-16 10:45-12:30 Boone, J. AZ 201 Healthcare and regulation  
Mon 2022-11-21 10:45-12:30 Ferrando, M. AZ 201 Lecture gender economics  
Fri 2022-11-25 12:45-14:30 CANCELLED CZ 7    
Mon 2022-11-28 10:45-12:30 CANCELLED AZ 201    
Fri 2022-12-02 12:45-14:30 Boone, J. CZ 7 notebook gender economics  
Wed 2022-12-07 12:45-14:30 Boone, J. CZ 7 Q&A  

First Lecture

Assignment 1

Do the following three steps:

  • create a github account on github (you need this account to submit your final assignment)
    • we advise you to do this before Friday September 16, 2022
  • go to
    • jupyter lab
      • IT suggests that you use the Firefox browser to access jupyter lab
      • sometimes it helps to access jupyter lab with an incognito/private window
      • or –if all else fails– you can use google's colab
  • create a new python notebook and type the following code in the first cell:
%%bash

git clone https://github.com/janboone/applied-economics
  • then press the Shift key and Enter key at the same time
  • this creates a folder on the server `applied-economics` that contains the material for the course.
  • Note: you can only run this command once. If you run it again, you get an error since the folder already exists.

Final assignment

  • instructions for the final assignment can be found below.

Datacamp

You can get access to Datacamp via the university website.

From Datacamp, do the following courses:

These courses teach you the basic Python syntax. In the lectures and notebook for the course, we use parts of Python more specific to economics; e.g. commands to solve equations, equilibria etc. These parts of the course complement each other. It is not the case that all Python that we use, you will first see in Datacamp.

It is up to you how to combine the Datacamp courses with the Screencasts. We suggest to finish the Datacamp Intro course first. As there is no economics on Datacamp, some students prefer to start with the screencasts after the Intro. Others prefer to finish more Datacamp courses before they start on the screencasts. Just see what works for you. But make sure you follow the planning above, otherwise you might get lost if you are too far behind and the lectures will not be as useful to you.

Deadlines

  • The deadline for the final python assignment is: Monday January 9th, 2023. Your grade is determined by this final assignment (only).
  • The resit deadline for the python assignment is: Monday May 15th, 2023. Let us know by email that you have submitted your assignment for the resit.

Follow the instructions below on how to submit an assignment on github and fill in the google form etc.

Also note the rules for the resit assignment in case you submitted an assignment for the first exam opportunity (you cannot discuss/program the same paper twice for your assignment).

Questions

If you have questions/comments about this course, go to the issues page open a new issue (with the green "New issue" button) and type your question. Use a title that is informative (e.g. not "question", but "question about the second assignment"). Go to the next box ("Leave a comment") and type your question. Then click on "Submit new issue". We will answer your question as quickly as possible.

The advantages of the issue page include:

  • if you have a question, other students may have it as well; in this way we answer the questions in a way that everyone can see it. Also before asking the question, you may want to check whether it was asked/answered before on the issue page
  • we answer your question more quickly than when you email us
  • you increase your knowledge of github!

Only when you need to include privately sensitive information ("my cat has passed away"), you can send an email.

In order to post issues, you need to create a github account (which you need anyway to follow this course).

Note that if your question is related to another issue, you can react to the earlier issue and leave a comment in that "conversation".

Final Assignment

  • The python assignment you can do alone or with at max. one other student (i.e. max group size is 2).
  • for the deadline of the python assignment, see Deadlines above
  • on Canvas we will give you the link to the github repos. with the assignment_template.ipynb
  • once you have "cloned" the applied-economics repository, you can see there the assignment_template.ipynb notebook. This gives you an idea of the template for the final assignment
  • to submit your final assignment:
    • do not change the name of the assignment_template.ipynb notebook
    • fill in this google form
    • push the final notebook on the github classroom repository

what we are looking for

The idea of the assignment is that you report your findings in a transparent way that can easily be verified/reproduced by others. The intended audience is your fellow students. They should be able to understand the code you write together with the explanations that you give for this code.

The following ingredients will be important when we evaluate your assignment:

  • Start from a theory paper; e.g. one you have read for another course.
  • Briefly describe what the paper does and what the main results are.
  • Then formulate a clear and transparent question that cannot be immediately answered by the paper.
    • Extend the paper's model (a bit) using the fact that you will simulate the model and do not need to provide an analytical solution.
      • note: we do not expect a major extension of the model; just a small change and use simulations to show how results differ due to this adaptation of the model.
      • hint: choose a question/extension where you can show off your programming skills!
  • Briefly motivate why this question is interesting.
  • Give the answer that you find (as a preview).
  • Mention the main assumptions that you need to get this answer.
  • Use latex to introduce and explain the model of the paper. Describe the main equations (using latex) of the model.
  • When you use information (e.g. a literature reference), create a link to this information. The reader then only needs to click to find the relevant information.
  • Describe your (small) extension of the model.
  • Explain how you move from the analytical equations of the paper to Python code.
  • Solve for the equilibrium using Python.
  • Simulate outcomes by using different values for parameters and save the outcomes of the simulations in a pandas dataframe.
  • Explain your code, the reader –think of your fellow students– must be able to easily follow what you are doing.
  • Present graphs of your simulation results.
  • Discuss what the figures show (e.g. \(x\) is increasing in \(y\)) and explain the economic intuition for this relation (between \(x\) and \(y\)).
  • Present a clear conclusion/answer to your question.
  • Finish with a brief discussion of your results.

Remark:

  • you can copy code from the web; but
    • make sure that you explain the code that you use so that another student of the course understands it and can use it;
    • give the reference of the code that you copy.

resit of final assignment

The resit of the final assignment needs to start from a new paper compared to the one you handed in before. Simply adjusting your first submission based on our feedback will be not be enough.

Otherwise, follow the procedure above on how to submit the assignment and fill in the google form.

Python as programming language

We use Python as programming language. A fair question is: why Python? The non-scientific answer is: because we like it a lot.

Other answers, better motivated than this, include:

We will program Python using the jupyter notebook. One motivation to use the jupyter notebook is based on a paper in the AER:

Note that this is a presentation on a Python conference having nothing to do with economics. The fact that this presentation uses an AER paper to motivate using the notebook (instead of an excel file), may induce a pause in which you ponder the state of our discipline.

After this pause, take a look at some notebooks:

Links and resources for python:

Jupyter notebooks

Markdown

For the assignment it is useful to know a bit of markdown. You can either google "markdown tutorial" or use one of the following websites:

Latex

For the python assignment it is useful to familiarize yourself with latex. Note that you do not need to type a whole document in latex (so don't worry about preambles etc.), you just need to know how to type \(x^2\), \(\alpha,\beta\) or have math displayed like

\begin{equation} a^2 + b^2 = c^2 \end{equation}

Google "latex tutorial" or go to pages like:

and focus on typesetting.

Author: Jan Boone