Marchant calculating machine  By internet archive book images

Marchant calculating machine By internet archive book images

Data Analytics for Economists [Fall 2018]

Monday and Wednesday 4:00PM-5:15PM @ Biochemistry 1120

Teaching Assistant: Dennis McWeeny
dmcweeny@wisc.edu
Office hours: M 9:30AM-11:30AM @ Sco Sci 6470

Professor: Kim J. Ruhl
ruhl2@wisc.edu
Office hours: T&R 2:30PM-3:30PM @ Soc Sci 7444


Announcements

November 15, 2018

Exam #2 is available in our shared folder on the X:\ drive and posted under week 11 below. The exam is open book and open internet, but you should not consult with others. Work through the exam on your own. As with the coding practice, print out the notebook and bring it to class on Monday. Early versions of the website had it due at 1:00. This is not the case. It is due by the end of class on Monday, November 19.

I am not going to sugar coat this: Dennis cooked up a tough problem for question 2. The file 'map.pdf' shows you what the end product should look like. It's a hard problem but the payoff is big!

November 8, 2018

Coding practice #4 is posted to our shared folder on winstat (9_coding_practice folder). It is also posted below, under week 10. It is due Monday, November 12 at the end of class. I have also added all the 'finished' notebooks to the 999_finished folder in our shared drive on winstat.

October 25, 2018

Coding practice #3 is posted to our shared folder on winstat (9_coding_practice folder). It is also posted below, under week 8. It is due Monday, October 29 at the end of class.

October 24, 2018

We will not hold class on the day before Thanksgiving, November 21.

October 16, 2018

A reminder that, due to technical difficulties, the exam is now due on Wednesday October 16 at the end of class.

October 8, 2018

Exam #1 will be available Thursday, October 11. The exam is open book and open internet, but you should not consult with others. Work through the exam on your own. As with the coding practice, print out the notebook and bring it to class on Monday. Early versions of the website had it due at 1:00. This is not the case. It is due by the end of class on Monday, October 15.

October 3, 2018

Coding practice #2 is posted. It requires two files with data: GDPA.csv and banks_and_branches.csv. They are all posted under week 5 below. Have a good weekend.

August 14, 2018

Welcome! This page is a work in progress; more coming soon. I am looking forward to meeting all of you, but until then, here are a few things you can do before we get started to smooth your transition into class.
  1. You will need a laptop. This is a hands-on course: we will be writing and debugging code together during class periods. If you do not have access to a laptop, please contact me immediately and we can work something out.
  2. You will need to be connected to the internet during class. Make sure your UWNet login is working.
  3. This course is about using data to answer questions. Start looking at some examples of people doing exactly this. FiveThirtyEight is a nice read, as is The Economist. On Twitter, check out @nytgraphics.
  4.    

Data sets and other resources


Thematic outline

This is the big-picture. We will add a lot more detail as we progress. We will also dip in and out of topics as we go. For example, we will do some basic plotting throughout the entire course, but we will not dig into the details until later.  

In the readings, McKinney refers to the book Python for Data Analysis (Second edition) by Wes McKinney. There is a lot more in this book than we will cover, but it is a good reference.  


Reading:
McKinney, parts of chapter 2
Markdown cheatsheet

 

Introduction:
Using data to answer questions
Examples

Jupyter notebooks:
Working on Winstat
Creating, opening, and saving our work
Documenting our work

Markdown


Reading:
McKinney, parts of chapters 2 and 3

Python basics:
Syntax, assignment, calculation
Data structures, types
Functions
Packages


Reading:
Mckinney, parts of chapters 5-8

Working with data:
The pandas package
Loading and cleaning data, missing values
Merging and joining data sets
Descriptive statistics


Reading:
McKinney, parts of chapter 9

Visualizations:
The matplotlib package
Scatter, bar, and line plots
Labeling and annotating plots
Subplots


Advanced topics:
This will depend on timing, but we might cover map visualizations, time series analysis, web APIs, machine learning basics, web scraping, formal econometrics...other ideas?


Weekly schedule

This week-by-week schedule will be constantly updated. Some topics may take longer than scheduled (and others may take less) but exam, coding practice, and project due dates will not. 


Reading:
Syllabus 

Jupyter notebooks (right click, save link as):
introduction.ipynb [view on github]

Week 0: September 5
Introduction // Using data to communicate ideas

Examples
Election results // college majors // jobs
gapminder


Reading:
Installing and using winstat
Markdown cheatsheet
McKinney Ch. 2.2 parts: "Running the Jupyter Notebook," "Tab Completion," "Introspection"
McKinney Ch. 2.3 up to "Control Flow": Everything except "Duck Typing" and "Bytes and Unicode"    

Jupyter notebooks (right click, save link as):
notebooks_and_markdown.ipynb [view on github]
python_basics_1.ipynb [view on github]

Week 1: September 10 & 12
Winstat // Juypter notebooks // Markdown
Assignment // Calculation // Types // Strings
 


Reading:
McKinney Ch 3.1 (skim the stuff on tuples and sets, pay close attention to slicing)
McKinney Ch 3.2 pgs 69-74

Jupyter notebooks (right click, save link as):
python_basics_2.ipynb [view on github]
python_basics_3.ipynb [view on github]

Week 2: September 17 & 19
Lists // Tuples // Dicts // More on types
Loops // Conditionals


Reading:
McKinney Ch 5 pgs: 123-151

Jupyter notebooks (right click, save link as):
python_basics_4.ipynb [view on github]
pandas_1.ipynb [view on github]

Week 3: September 24 & 26
Slicing // Functions //
Pandas:
Series // Dataframes // Indexing
Selecting data // Calculations on dataframes

Due September 24: Coding practice #1 // Solutions
Print out and bring to class


Reading:
McKinney Ch 9.1 pgs 253-269
McKinney Ch 6.1 pgs 167-176

Jupyter notebooks (right click, save link as):
pandas_2_input.ipynb [view on github]
matplotlib_1.ipynb [view on github]

Data: gdp_components.csv // debt.xlsx
gdp_components_simple.csv

Week 4: October 1 & 3
Matplotlib:
Figures and axes // Plot types // Styles
Pandas: Reading and writing files


Reading:
McKinney Ch 11 pgs 319-328, 350, 354, 356-360
Installing packages on Winstat

Jupyter notebooks (right click, save link as):
time_series.ipynb [view on github]
api.ipynb [view on github]
matplotlib_2.ipynb [view on github]

Data: VIXCLSD.csv
osk.csv

Week 5: October 8 & 10
Time series data // APIs

Due October 8: Coding practice #2 // GDPA.csv
//
banks_and_branches.csv
//
solutions


Reading:
Project information
McKinney Ch 8.1 & 8.3 (skip 8.2)

Jupyter notebooks (right click, save link as):
pandas_3_panel.ipynb [view on github]

Data: dogs.csv // WEOOct2016all.xls

Week 6: October 15 & 17
Thinking about projects // Bar and scatter plots
MultiIndex // Stack and unstack

Due end of class, October 15: Exam #1
//
CPS_March_2016.csv // presidents.csv
//
SP500_daily.csv


Reading:
McKinney Ch 8.2


Jupyter notebooks (right click, save link as):
pandas_3B_more_reshaping.ipynb [view on github]
pandas_4_merge.ipynb [view on github]

Data: broadband.csv
Metro_MedianRentalPrice_1Bedroom.csv
Metro_MedianRentalPrice_Studio.csv

Week 7: October 22 & 24
Reshaping // Merge // Join


Reading:
McKinney Ch 7
McKinney Ch 10.1 & 10.2

Jupyter notebooks (right click, save link as):
pandas_5_transform.ipynb [view on github]
pandas_6_groupby.ipynb [view on github]

Data: Most-Recent-Cohorts-Scorecard-Elements.csv

Week 8: October 29 & 31
Cleaning data // Transforming data
Groupby

Due October 29: Coding practice #3
//
CPS_March_2016.csv
//
state_gdp.csv // state_unemp.xlsx
//
solutions


Reading:
Geopandas plot tools

Jupyter notebooks (right click, save link as):
seaborn.ipynb [view on github]
maps.ipynb [view on github]

Data: broadband_size.xlsx // wdi.csv // results.csv

Week 9: November 5 & 7
Seaborn // Maps


Reading:
McKinney Ch 13.1-13.3

Jupyter notebooks (right click, save link as):
maps_2.ipynb [view on github]
stats_models_ols.ipynb [view on github]

Data: ACS_16_5YR_B27001_with_ann.csv
//
sleep75.dta // wage1.dta

Week 10: November 12 & 14
Maps // Statsmodels // OLS

Due November 12: Coding practice #4
//
airline_products_2017.csv
//
solutions


Reading:

Jupyter notebooks (right click, save link as):
statsmodels_iv.ipynb [view on github]
statsmodels_discrete.ipynb [view on github]

Data: card.dta // apple.dta // pntsprd.dta

Week 11: November 19 & 21
No class on 11/21

Due end of class, November 19: Exam #2
//
exam_2_data.zip
//
map.pdf


Reading:

Jupyter notebooks (right click, save link as):

Week 12: November 26 & 28

Due November 26: Project proposal // project information


Reading:

Jupyter notebooks (right click, save link as):

Week 13: December 3 & 5


Reading:

Jupyter notebooks (right click, save link as):

Week 14: December 10 & 12

Due December 10: Coding practice #5
Due Midnight, December 14: Final project files