Deadline May 4, 2026 at 11:59 PM.

<aside> πŸ’‘

What is a Lorenz curve?

Deciles break the population into ten equally sized slices, letting you see who is at the bottom, middle, or top. The Lorenz curve then turns these slices into a visual story: by sorting people from poorest to richest and plotting how much of total income the cumulative population holds, you can literally see inequalityβ€”if everyone had the same income, the curve would be a straight 45Β° line.

</aside>

<aside> πŸ“Œ

Read carefully

You will complete this assignment as an R Markdown file. The goal is not just to get results, but to clearly show and explain your workflow.

Transparency of Code

Explain What You Are Doing

Interpret Results

Structure Matters

Your PDF document should be clearly organized using section headers:

  1. Data Preparation
  2. Lorenz Curve Calculations
  3. Visualization
  4. Interpretation </aside>

Datasets Provided

inequality_raw.xlsx


Before you begin:

You must create a single self-contained folder that includes:

You must create one folder that someone else can run without touching anything.

Your folder structure must look exactly like this:

pset2_name_surname/
β”‚
β”œβ”€β”€ pset2.Rproj
β”œβ”€β”€ analysis.R
β”œβ”€β”€ anaylsis.pdf (complied when you Knit to pdf using RMarkdown)
β”‚
β”œβ”€β”€ input_data/
β”‚   └── coreecon_ineq.xlsx
β”‚
└── outputs/
    └── (your figures will be saved here automatically)

R Markdown Structure

Your .Rmd must follow this structure exactly:


YAML Header

---
title:"Problem Set 2: Income Inequality"
author:"Your Name"
output: pdf_document
---

```{rsetup,include=FALSE}
knitr::opts_chunk$set(echo=TRUE,warning=FALSE,message=FALSE)

# Load libraries
library(readxl)
library(tidyverse)
library(janitor)


```php

# **SECTION 1 β€” Data Preparation**

## **1.1 Load Data**

....