1 of 59

Outline

Lecture 1.1, Econ 148, Spring 2024

  • Intro / Overview
  • What will you learn in this class?
  • Course overview
    • Introductions
    • Logistics
  • Background on this class

1

Econ 148 - UC Berkeley

2 of 59

Background

2

Data 88E

Econ 140

Data 100

Lower Division Seminar - Econ 1/100 topics illustrated in Python, samples of upper division classes in Python

Classic Econometrics Class - Start with clean, square dataset and cover multivariate regression and extensions

Econ students might not have 61A, Math 54 as background, but there are lots of great tools to be learned

Our starting point - how we got here

What don’t you learn in 140?

What from this class should econ students learn?

Econ 148 - UC Berkeley

3 of 59

Tentative List of Topics to be Covered in Econ 148

  • Pandas
  • Query an API
  • Elements of SQL
  • Exploratory Data Analysis
  • Cleaning/Wrangling Data
  • Visualization
    • Matplotlib / Seaborn / Plotly
    • Geopandas
  • Time Series
  • Survival Analysis
  • Classification

  • Data Science Lifecycle

  • Open Science / Reproducible Science
  • Coding Practices
  • Data Communication
  • Secondary Sources of Data

3

Econ 148 - UC Berkeley

4 of 59

Prerequisites

Official prerequisites for this course:

  • Completion of Data 8 / Stat 20 and knowledge of Python

We will not be teaching:

  • How to use Python
  • How to use Jupyter notebooks
  • Inference from Data 8

Lab 0 will help calibrate your background.

If its hard - that’s OK

It it seems foreign - Not OK

4

Econ 148 - UC Berkeley

5 of 59

Data 100

If you have taken Data 100 you should probably not be here.

This class might be wasting your time and be redundant.

There will be new applications and datasets, but you probably already know much of the material.

We will try to make extra material available

We will expect you to help other people in the class

5

Econ 148 - UC Berkeley

6 of 59

A Caveat / Warning

This is a new class that is only in its second iteration

And there is constantly new material being generated

It might be bumpy

There are a lot of moving parts to launching a class this complicated (autograder, etc.)

We have generated a lot of new material! And we are still generating it....

We hope the topics and application are of interest to you

I am not an expert in Data Science, but I am passionate about it

I won’t be mathematically deriving ML models

We have two awesome UGSIs, and a bunch of other supports

Bear with us

Help us improve it! - Fill out the form on ED - pre-semester survey

6

Econ 148 - UC Berkeley

7 of 59

Course Logistics

Lecture 01, Econ 148 Spring 2023

Staff

Logistics

7

Econ 148 - UC Berkeley

8 of 59

Eric Van Dusen

UC Berkeley

PhD UC Davis 2000 - Ag and Resource Economics

Postdoc / Research / Lecturer / Staff

Lecturer for Data Science / Economics

Staff for Data Science Undergrad Studies

OH - Tuesday 4-6 - 529 Evans

8

Econ 148 - UC Berkeley

9 of 59

UGSIs

Rohan Jha

Peter Flo Grinde-Hollevik

9

Economics + Data Science Major

International Student from Dubai

Sections: 102, 103, & 104

OHs: �Wednesdays 10-11 and 12-1, Evans 636 (starting Jan 24)�

EEP + Data Science Major

International Student from Norway

Sections: 101, 105, & 106

OHs:�Monday 10-11am, Evans 640 (starting Jan 22) + Wednesday 3-4pm bookable (online)

Econ 148 - UC Berkeley

10 of 59

Course Website / Platforms

10

Econ 148 - UC Berkeley

11 of 59

Online platforms

Course website (https://www.econ148.org/sp24/)

  • Where all lectures, assignments, and discussions are posted.

Course textbook (https://www.econ148.org/textbook/)

  • Course textbook WIP

DataHub (data100.datahub.berkeley.edu)

  • Where you will work on all assignments (links on the course website automatically take you here).

Ed (https://edstem.org/us/courses/53352)

  • A place to ask and answer questions about assignments and concepts.
  • Where all announcements are posted (exam logistics, new assignment released, etc).

Gradescope (gradescope.com, added via roster)

  • Where all assignments are submitted, and where all of your grades in this course will live.

Kaltura (https://kaltura.berkeley.edu/my-channels)

  • Video recording of Lectures

PollEV (PollEv.com/ericvandusen)

  • In class Polling and Attendance Check. These all have to sync / LTI so be patient

11

Econ 148 - UC Berkeley

12 of 59

PollEV

Insert PollEV here

Have you taken

  • Data 8
  • Data 100
  • Econ 140/141
  • Math 54

12

Econ 148 - UC Berkeley

13 of 59

13

Econ 148 - UC Berkeley

14 of 59

14

Econ 148 - UC Berkeley

15 of 59

15

Econ 148 - UC Berkeley

16 of 59

Programming Environment for our Course: JupyterLab -( Not Notebook )

16

Econ 148 - UC Berkeley

17 of 59

How is this different than simple Notebook Interface?

JupyterLab offers more of an IDE

  • You see files in a file panel
    • Upload Data
    • Download Notebook
  • More than one tab open
  • Inspect Data

Fancier JupyterLab functionality:

  • JL has plugins
  • JL headed towards accessibility

17

Econ 148 - UC Berkeley

18 of 59

Learning Advanced JupyterLab

JupyterLab offers notebooks and more tools for data science.

We’ll be accessing JupyterLab using DataHub

  • Next lecture - how to use JupyterLab locally on your own machine.

Resources for learning fancier JupyterLab functionality:

  • A quickest intro is this great 2-minute overview by Serena Bonaretti.
    • Note: Unlike Serena’s example, in our course we’re using JupyterLab notebooks hosted on the internet, not on your own local computer.
  • The interface overview from the official docs has more details and short, embedded videos.
  • A more detailed discussion from a bio/data angle: ~45 minute video.
  • Full ~3h in-depth tutorial is available from the core team.

18

Econ 148 - UC Berkeley

19 of 59

Weekly Flow

19

Lectures - TuThur 2-3:30

Lectures will be recorded and posted on Kaltura

Lots of links in Lecture Slides

Hoping to line up interesting guest speakers for Thursdays

Sections

Cover main topics from class

Cover Lab / Project

Start lab - but you need to finish it!

Midterm will be based on discussion material

Attendance is part of Participation Grade

PollEV responses will track attendance

Both section and lecture

We expect this to be an in person class - Lecture and Section

Econ 148 - UC Berkeley

20 of 59

Participation

This class is planned being taught in person.

I think you will get so much more out of this if you come in person

And participate

And do the Lecture Notebooks / Guest notebooks

DO NOT COME if you are sick

Make an Ed Post if you are sick

20

Econ 148 - UC Berkeley

21 of 59

Guest Speakers!

Last Year!

  • Goldman Sachs
  • Tiktok
  • Boston Consulting
  • UC Investment Fund
  • UCB Econ department
  • Citibank

21

Econ 148 - UC Berkeley

22 of 59

Labs and Projects

22

10 Labs and 3 Projects

Labs Released on Tuesday - due 1 week later Wednesday 11:59 pm on Gradescope

Autograding is a part of Labs & Projects

Autograding is a mix of Sanity Checks ( ok to proceed)

But hidden tests can be used for assessment

Labs/Projects can also include short answer / free response / written questions

One Free Response Question will be randomly selected for manual grading

Projects are longer/ take 2 weeks / more in depth / will be graded

Project 3 will be a group project with a rubric and preliminary checkins

We encourage you to come to office hours and post on Ed for help!

Ed Mega Threads for each project

Econ 148 - UC Berkeley

23 of 59

Late Policy

YOU need to notify us before the deadline for extensions

For DSP or other circumstances

Private Ed post is the best, most reliable way!

Students are allowed to submit labs and projects late for a 50% penalty within 48 hours after they are due, after which they will receive no credit

23

Econ 148 - UC Berkeley

24 of 59

Academic Honesty

Please do not plagiarize. This is against the code of conduct.

We encourage working and studying with fellow classmates, but all work you turn in must be you own. ( except group project- which will have a rubric)

24

Econ 148 - UC Berkeley

25 of 59

AI and homework?

AI / LLM (Chat GPT) - is undermining assessment at the University

  • Can be detected
  • Isn’t going to help you in midterm
  • Can be obvious on Labs when it has an alternative approach to coding challenges
  • Doesn’t necessary help with inference and documentation and reproducibility
  • Using AI without knowledge of the fundamentals can lead to bad and buggy code

Ryan Edwards:

  1. It writes B-minus papers for you
  2. If you have time to use ChatGPT, you have time to write your own B-minus paper
  3. Turning in its output ~ another human writing a paper for you. It’s dishonest
  4. Using it as a tool, like you would use Google or Wikipedia, is acceptable. You should cite your use of it

25

Econ 148 - UC Berkeley

26 of 59

Midterm and Final

26

In Class written Midterm

We will have an in-class midterm on March 21st that covers the first half of the course materials. The midterm is worth 25% of your total grade.

Econ 148 - UC Berkeley

27 of 59

Grading overview

Participation - 15%

Labs - 25 %

Projects 1 and 2 - 20%

Midterm - 25%

Final Project 3 - 15%

27

Econ 148 - UC Berkeley

28 of 59

Office hours

Office hours are listed on the Ed and will be held both virtually and in person.

  • These are led by GSIs, and other staff.
  • Come to get help on assignments – labs, homeworks, and projects – and concepts.
  • In person office hours will be held in various locations specified on the Ed

Eric will also be hosting office hours Tuesday 4-6 pm.

  • Primary focus will be on non-project, non-lab questions,
  • I will do my best to help with Projects & Labs as well
  • Come meet me!

28

Econ 148 - UC Berkeley

29 of 59

Data Science Lifecycle

  • From Data 100

29

Econ 148 - UC Berkeley

30 of 59

The “data science lifecycle” you will see out in the wild may be slightly different than�the one we teach you, but the core ideas are all the same.

30

Econ 148 - UC Berkeley

31 of 59

Data science lifecycle

The data science lifecycle is a high-level description of the data science workflow.

Note the two distinct entry points!

31

Ask a Question

Obtain Data

Understand the Data

Understand the World

Reports, Decisions, and Solutions

Econ 148 - UC Berkeley

32 of 59

1. Question/Problem Formulation

  • What do we want to know?
  • What problems are we trying to solve?
  • What are the hypotheses we want to test?
  • What are our metrics for success?

32

Ask a Question

Obtain Data

Understand the Data

Understand the World

Reports, Decisions, and Solutions

Econ 148 - UC Berkeley

33 of 59

Wastewater based epidemiology ( https://www.cdph.ca.gov/Programs/CID/DCDC/Pages/COVID-19/CalSuWers-Dashboard.aspx)

33

Econ 148 - UC Berkeley

34 of 59

Open Data Portal / Dashboard / Visualization / Explanation

34

Econ 148 - UC Berkeley

35 of 59

35

Econ 148 - UC Berkeley

36 of 59

Econ 148

  • One focus will be on secondary sources of Data
  • Traditional Data = FED Data
  • New forms of Data - Google Mobility, Zillow, Twitter, Facebook, Spotify, Youtube

36

Econ 148 - UC Berkeley

37 of 59

2. Data Acquisition and Cleaning

  • What data do we have and what data do we need?
  • How will we sample more data?
  • Is our data representative of the population we want to study?

37

Ask a Question

Obtain Data

Understand the Data

Understand the World

Reports, Decisions, and Solutions

Econ 148 - UC Berkeley

38 of 59

Econ 148 - Sourcing Data

  • Use sqlite within Jupyter
  • Sample SQLite databases
  • Learn a few commands, and a workflow
  • Query a website
  • Build a JSON
  • Import public data

38

Econ 148 - UC Berkeley

39 of 59

3. Exploratory Data Analysis & Visualization

  • How is our data organized and what does it contain?
  • Do we already have relevant data?
  • What are the biases, anomalies, or other issues with the data?
  • How do we transform the data to enable effective analysis?

39

Ask a Question

Obtain Data

Understand the Data

Understand the World

Reports, Decisions, and Solutions

Econ 148 - UC Berkeley

40 of 59

Python, Pandas, Jupyter

40

Econ 148 - UC Berkeley

41 of 59

4. Prediction and Inference

  • What does the data say about the world?
  • Does it answer our questions or accurately solve the problem?
  • How robust are our conclusions and can we trust the predictions?

41

Ask a Question

Obtain Data

Understand the Data

Understand the World

Reports, Decisions, and Solutions

Econ 148 - UC Berkeley

42 of 59

Zillow’s economist providing analysis - Years to save for buying a home

42

https://www.zillow.com/research/understanding-affordability-32538/

Econ 148 - UC Berkeley

43 of 59

Data Science and Economics - undergraduate curriculum

43

LECTURE 1

Econ 148 - UC Berkeley

44 of 59

Economics and Data Science

44

“If Economics continues to be the major it is now, and Data Science emerges as an alternative, a good chunk of people who are currently going into economics will realize that it makes much more sense to become a Data Science major, with a minor in economics - and I would say they’re making the right choice!” - Steven Levitt

“The Data Science tools may well turn out to be in the first half of the 2000s the equivalent of a fine chancery hand was in Oxford or Cambridge in the 1400s, just as a facility with the document formats and commands of the Microsoft office at the end of the 1900s: practical, general skills that make you of immense value to most if not nearly all organizations.” - Brad DeLong

“I think Econometrics could use a lot of the techniques that are common in Data Science, such as bootstrapping…techniques for data-driven procedures and there’s a lot of really creative ideas in terms of presenting data …” - David Card

“I write Jupyter Notebooks, I write Python, try my models out in Python, and it’s very empowering…I think the students at Berkeley are lucky.. The things you have now! ” - Thomas Sargent

Econ 148 - UC Berkeley

45 of 59

Federal Reserve Governor Lisa Cook - May 2023 Economics Graduation

45

“During the pandemic, you could track comfort with social interactions using Open Table reservations. I don't have to tell you all how closely you can track rents in pricey Bay Area neighborhoods using tools like Zillow, Apartments.com, and Apartment List. These types of housing data inform the Federal Reserve's understanding of inflation. I am confident your generation will transform our capability to use high-frequency, real-time data, applying your unique perspectives to deepen our understanding of how our economy is evolving.” - Lisa Cook

Econ 148 - UC Berkeley

46 of 59

Top Undergraduate Majors at UC Berkeley 2023

46

Comp Sci 997

Econ 912

Data Sci 740

Mol & Cel Bio 609

EECS 480

Bus Adm 428

21-22

20-21

19-20

18-19

22-23

Pol Sci 418

https://pages.github.berkeley.edu/OPA/our-berkeley/degree-recipients-by-major.html

Econ 148 - UC Berkeley

47 of 59

Top 5 Domain Emphases within Data Science Major UC Berkeley 2023 ( n = 1652)

47

Domain Emphasis

Number

Percentage

Business/Industrial Analytics

416

25%

Economics

357

22%

Cognition

182

11%

Applied Mathematics & Modeling

163

10%

Computational Methods in Biology

45

72%

Econ 148 - UC Berkeley

48 of 59

Most Common Second Majors - Within Spring 2023 Data Science Double Majors (648)

48

Other major

Number

Economics BA

177 (27%)

Computer Science BA

137

Business Administration BS

62

Cognitive Science BA

59

Applied Mathematics BA

36

Total Majors for comparison: English - 240 Statistics - 127 History - 105 Political Econ - 189

Econ 148 - UC Berkeley

49 of 59

Most Common Second Majors - Within Spring 2023 Economics Double Majors (560)

49

Other major

Number

Data Science BA

177 (31%)

Computer Science BA

94

Business Administration BS

38

Political Science

27

Statistics

26

Econ 148 - UC Berkeley

50 of 59

Econometrics

50

Econ 140

Core required methods class ~ 450

  • 6th semester post Stata!
  • 2 semesters R, 4 semesters Jupyter Python
  • Building more in R in coming semesters
  • Python Notebooks built by undergrad GSI double major
  • R notebooks in Jupyter

EEP 118

Core required methods class ~ 150

  • 8th semester post Stata!
  • Jupyter R
  • Smooth handoff across instructors
  • Notebooks built by Grad Student teaching over the summer

Econ 148 - UC Berkeley

51 of 59

Economics Classes

Wide range of implementations

Not coordinated

Little by little

Econ 148 - UC Berkeley

52 of 59

Data 88E - Data 8 Connector Course - 8th semester / 100 students

52

Econ 148 - UC Berkeley

53 of 59

Who is doing this well ? ( Shout out to some favorites !)

53

Raj Chetty - Harvard Big Data

Sargent and Stachursky - QuantEcon

Econ 148 - UC Berkeley

54 of 59

Kobe University, Japan

National University of Singapore

Meanwhile, across the Pacific - NUS singapore, University of Kobe

Econ 148 - UC Berkeley

55 of 59

Econ 148

Universities don’t teach job skills they teach you how to think, learn, inquire, research

Economics departments teach theory, application, more than methods

Mathematical approaches to modeling human behavior

Overlap between “how to be a good RA” and “how to be an analyst?”

Economics applications vs learning Pandas skills

What if Python is the new Math

Econ 148 - UC Berkeley

56 of 59

Who needs to know what (critical thinking, applications, skills?)

Does an economics grad need to know software engineering?

Programming languages

Generalizable skills

Data Science approach to ML

Does a data science grad need to know economic fundamentals or just applications?

Economic forces

Human behavior and choices

Econ approach to ML

Econ 148 - UC Berkeley

57 of 59

Metacognition ~ Hypothesis ~ Praxis

  • Tools built for reproducibility are powerful for pedagogy
  • Data Science curriculum built on Open Source tools
    • Explicit and Implicit Learning
    • First year students learn Jupyter/ Numpy ~ scaffold to more
    • Teaching staff learn Github / open publishing
  • Simultaneously teach Computational Thinking & Inferential Thinking
    • Social Science students need Data Science skills / methods
    • CS/ML students need inference & domain applications
  • “Notebook based instruction” - is it an evolution in how we teach?

Econ 148 - UC Berkeley

58 of 59

What is the Berkeley Data Science Teaching Stack?

  • Jupyterhub - cloud server approach to teaching -
  • Free textbook, open-source software stack and open-source curriculum, open infrastructure
    • the server, the textbook, the packages, the grader, the homeworks… in public Github repos
  • Set of Open Source tools developed around Fundamentals Class - Data 8
    • Inclusion & Accessibility
    • Any machine can run - no software licence
  • Built to be scalable, Deployed in 1500 person class
    • Tools can be used for any type of class” - “guardrails not gates”
    • Zero to Jupyterhub, Juptyerbook, Otter-Grader

58

Econ 148 - UC Berkeley

59 of 59

Let’s have an awesome semester

We are building an awesome new class

And you’re helping us do it!

59

Econ 148 - UC Berkeley