---
title: "3.1 Freakonomics"
format:
  html:
    self-contained: TRUE
---

Before starting this assignment, make sure to complete the reading: *Freakonomics* Introduction and Chapter 1 (on Blackboard).

## Daycare Problem

![Shutterstock Images](https://media.istockphoto.com/id/1475408463/vector/kindergarten-fa%C3%B1ade.jpg?s=612x612&w=0&k=20&c=TjcX_CRdKHduNYIOK3FzQG0shrFY4Zp-NdPxy_V7rRA=)

<div style="background-color: #F7A072; border: 12px solid #F7A072;">
**Problem:**

- Day-care center policy: Children must be picked up by 4 p.m.
- Frequent late pickups by parents.
- Results: Anxious children and teachers waiting longer.

**Proposed Solution:**

- Fine tardy parents $3 per late pickup.
- After all, why should teachers have to work extra for free?

**Study:**

- [**A Fine is a Price**, Uri Gneezy (UC San Diego) and Aldo Rustichini (University of Minnesota), *The Journal of Legal Studies, January 2000*](https://www.jstor.org/stable/10.1086/468061?seq=1)
- 10 day-care centers in Haifa, Israel.
- Duration: 20 weeks.
- First 4 weeks: Tracked late pickups (baseline): 8 late pickups per week
- Week 5: Introduced $3 fine for late pickups.
- Outcome: Late pickups increased to 20 per week (more than double).

**Key Insights:**

- Fine backfired, making lateness seem acceptable as long as parents paid.
- Financial incentives can undermine intrinsic motivations (e.g., moral obligation to be on time).
- Replacing social norms with a small transactional fee can lead to unintended consequences.
</div>
</br>

<div style="background-color: #99E1D9; border: 12px solid #99E1D9;">
## Economics: the Study of Incentives

**Economists love incentives.**

- They love to dream them up and enact them, study them and tinker with them.
- Incentives can solve almost any problem. 
- But the solution might not be pretty! (coercion, exorbitant penalties, violations of civil liberties)

**You Respond to Incentives All the Time (Positive and Negative)**

- Touch a hot stove --> burn your finger
- Bring home straight A's --> get a new bike
- Pick your nose in class --> you are ridiculed
- Make the basketball team --> move up the social ladder
- Ace the SAT's --> get in to a good college
- Flunk out of law school --> have to go work at your father's insurance company
</div>

![Getty Images](https://media.istockphoto.com/id/878257154/vector/pink-bicycle-in-decorative-wrapping-ribbon-with-bow-vector.jpg?s=612x612&w=0&k=20&c=V1XFje1LlpAuImvxwEwBaOEEYUQmOgNUaRZrpA42CSY=){width=50%}

<div style="background-color: #FF9ABF; border: 12px solid #FF9ABF;">

**Incentives: tools to encourage good behavior and discourage bad behavior.**

**Three Types of Incentives:**

1. **Economic:** Give the subject something, or take something away; Financial rewards or penalties ($3 "sin tax" on cigarettes)
2. **Social:** Use peer pressure or create a social norm (banning smoking on college campuses).
3. **Moral:** Appeal to ethics or values; talk to the subject about what's "right" (government suggesting black market cigarette sales fund terrorists).

**Creating Personal Incentives:**

- To overcome procrastination and stay focused on your goals, Stanford Neuroscientist [Andrew Huberman](https://youtu.be/OLQRAMZi--c) suggests using a variable reward system (inspired by casinos):
- After completing a task, flip a coin:
   - Heads: Celebrate and reward yourself.
   - Tails: Move on without a reward.
- This keeps you engaged and motivated by creating anticipation.
</div> </br>

<div style="background-color: #FFFFF; border: 5px solid #FCEC52;">

## Exercise 1: Incentives

For each scenario below, identify one **economic incentive**, one **moral incentive**, and one **social incentive** that could help achieve the desired outcome. Then, recommend which incentive you think would work best in each case.

1. A teacher wants their students to come to class more.
2. A parent wants their kids to go to bed on time.
3. A woman wants her boyfriend to propose.
4. A doctor wants their patient to exercise.
5. A coach wants their athletes to train during the off-season.

</div>
</br>

<div style="background-color: #FFFFF; border: 5px solid #FCEC52;">
## Exercise 2: Bagel Data Project

Based on Chapter 1 of Freakonomics, which describes Paul Feldman's bagel business and his detailed payment records, I want to help you analyze a simulated dataset that mirrors his observations.

To begin, attach the tidyverse to your current session and read in the bagel data set.

```{r, message = F}
library(tidyverse)
bagel <- read_csv("https://media.githubusercontent.com/media/cobriant/320data/refs/heads/master/bagel.csv")
```

### a) Payment Rates and Office Size

Write a query using `group_by` and `summarize` that shows smaller offices (only a few dozen employees) consistently paid for their bagels 3-5% more than large offices (with a few hundred employees). Freakonomics suggests smaller offices experience less theft due to stronger social and shame-based incentives.

```{r}
# bagel %>%
#   group_by(_____) %>%
#   summarize(_____)
```

### b) The 9/11 Effect

Following the events of September 11, 2001, write a query using `lm()` to show the payment rate increased by 2%, rising from 87% to 89%. This higher payment level persisted after the initial spike. According to Freakonomics, this sustained increase can be attributed to a rise in empathy among people during that time.

```{r}
# lm(_____ ~ I(date >= "2001-09-11"), data = _____)
```

### c) Weather Effects

Write a query showing that unseasonably pleasant weather leads to higher payment rates. Cold weather leads to more cheating, and heavy rain and wind also leads to more cheating.

```{r}
# bagel %>%
#   group_by(_____) %>%
#   summarize(_____)
```

### d) Holiday Effects

Write a query to analyze theft rates during different types of holidays. Specifically, compare holidays associated with high stress and expectations (e.g., major holidays like Christmas or Thanksgiving) to simple long-weekend holidays (e.g., Labor Day or Presidents' Day). The goal is to demonstrate that theft rates tend to increase during high-stress holidays but decrease during relaxed, long-weekend holidays.

```{r}
# lm(_____ ~ _____, data = _____)
```
</div>
