# Master's and bachelor's earnings

Lecture 11 loads the prepared `masters_earnings.csv` table. PS6 walks students
through its construction from `masters_acs.csv`, a 335,109-row extract of the
national ACS computer/math occupation family (SOCP starts with `15`). File preparation
keeps the original columns listed below and adds the survey year. All ages,
degrees, employment statuses, work schedules, and wage values in that occupation
family are retained. Integer-valued Census fields are saved as integers to keep
the download compact. There is no sampling or recoding of the source values.

```text
Column   Meaning
year     Survey year, added from the source filename
AGEP     Age in years
SCHL     Education code: 21 bachelor's; 22 master's
ESR      Employment status: 1–2 employed civilians
COW      Worker type: 1–5 civilian wage/salary workers
WKHP     Usual weekly hours worked
WKWN     Weeks worked in the previous year
WAGP     Wage and salary income in dollars
ADJINC   Census income-adjustment factor, with six implied decimal places
PWGTP    Person survey weight
```

On PS6, students inspect the codes and construct `eligible` and `earnings`
with R pipelines. `masters_cpi.csv` contains
the five survey years' annual CPI-U values from the existing price-index file.
The homework joins it by year, labels the degree, converts annual pay to
thousands of 2024 dollars, and selects the final columns. The lecture loads
the prepared CSV and preloads completed analysis objects so later cells
work independently.

`masters_earnings.csv` contains 123,495 eligible person records from the national
2019, 2021, 2022, 2023, and 2024 American Community Survey one-year public-use
files. Each year is a separate survey. All eligible records and their released
wage values are retained.

```text
Column   Meaning
year     Survey year
degree   Bachelor's (SCHL 21) or Master's (SCHL 22)
age      Age in years
pay      Annual wage and salary income, in thousands of 2024 dollars
weight   ACS person survey weight (PWGTP)
```

`WAGP` measures wage and salary income over the previous 12 months. The sample
contains currently employed civilian wage/salary workers (ESR 1-2, COW 1-5),
ages 25-50, in computer and mathematical occupations (SOCP begins with `15`),
with a bachelor's or master's degree. Workers report at least 35 usual weekly
hours (WKHP) and at least 50 weeks worked (WKWN); wages and person weights must
be positive. All five source files supply actual weeks worked in WKWN.

The income calculation is:

```text
pay = WAGP * ADJINC / 1000000 * CPI[2024] / CPI[year] / 1000
```

ADJINC converts reported income to its survey year's dollars. Annual CPI-U
means (BLS series CUUR0000SA0) then convert every year to 2024 purchasing power.
The input is [cpi_annual.csv](../../../course_design/skill_returns/acs/cpi_annual.csv).
Its SHA256 is
`9271b90302db38bad1fb189b313742ccbc1f9095eaf596c5a6ec6e99e6eeca76`.

The lecture's time-trend models use all 123,495 individual earnings records,
giving each respondent equal weight and defining `time = year - 2022`.
Annual averages are used for plotting and the observed pay-gap analysis.
The retained survey weights support a separate instructor check.

```text
Year    BA sample  MA sample  BA mean  MA mean  Equal-weight gap%  Survey-weighted gap%
2019       14,125      6,947  126.682  153.060              20.82                 19.73
2021       15,568      7,763  132.480  161.193              21.67                 21.11
2022       16,979      8,544  129.924  157.447              21.18                 19.87
2023       17,707      8,834  129.094  158.843              23.04                 22.59
2024       17,903      9,125  131.524  162.043              23.20                 21.46
```

Means are thousands of 2024 dollars. The gap is
`100 * (master's mean / bachelor's mean - 1)`.
Both summaries show a modestly larger mean-income gap in 2024 than in 2019.
These records describe earnings among the sampled workers. They cannot
establish the earnings gain caused by earning a master's degree or a change
caused by AI. The previous-12-month income measure also spans calendar years.

## Lecture calculations

Q1 fits a line to each degree group's individual earnings records, then
uses those separate models to forecast earnings for 2026–2046. For 2028, the bachelor's forecast is
$133,692.69 and the master's is $167,114.07. In the 2026 career scenario, the master's pays
two resident annual fees of $28,886.38 and starts earning in 2029.
The lecture sums these annual amounts; the first year-end when the master's
cumulative total exceeds the bachelor's is 2037. This is a scenario based
on continuing group earnings trends, not an estimate of an individual
graduate's career progression.

The two-slide PhD extension reads doctoral-degree records (`SCHL = 24`)
from `masters_acs.csv`, using the same age and employment filters and CPI
adjustment. It retains 4,427 records, including 1,063 in 2024, and fits
`pay ~ time` to individual records. The scenario starts directly after the
bachelor's in 2026, receives an assumed $40,000 annual stipend in 2024
dollars for five years with waived tuition, then earns forecast pay from
2032. Its cumulative earnings first reach the bachelor's total in 2038,
seven years after completing the PhD. The existing bachelor's and master's
paths are unchanged. The five-year duration and funding arrangement come
from the [U-M Statistics PhD FAQ](https://lsa.umich.edu/stats/phd-students/ProspectiveGraduateStudents/prospective-phd-student-FAQs.html);
the stipend amount is an example assumption. The plot is calculated in
native R during the lecture build; the raw extract stays out of the bundle.

Q2 tracks the observed annual degree pay gap around ChatGPT's November
2022 release, then tests whether the gap is growing across 2019–2024.
The gap grows from $27,523 in 2022 to $30,519 in 2024. Combining the two
lines with a degree indicator and its interaction with time expresses the
slope difference as one coefficient. The interaction estimate is
$782.25/year; the usual two-sided coefficient test gives p=.030674.
The null is equal slopes. The positive estimate and p-value support
a growing gap under this model. The test covers all five survey years.
The fixed-pay calculations documented below remain a reference for PS6.

The preparation script prints mean and median incomes, survey-weighted checks,
and these ordinary least-squares fits:

```text
2024 individual records: pay ~ masters
  Intercept       131.523604505
  masters          30.519185191

Individual records: pay ~ time * masters
  Intercept       130.053128984
  time              0.606593006
  masters          28.727902311
  time:masters      0.782247059

Separate fitted lines:
  Bachelor's: fitted pay = 130.053128984 + 0.606593006 * time
  Master's:   fitted pay = 158.781031296 + 1.388840064 * time
```

`masters` is 1 for a master's degree and 0 for a bachelor's degree. The fitted
degree gap grows by about $782 per year over these five observed years.

### Break-even scenario

Lecture 11 budgets a two-year full-time master's using published U-M
LSA/Rackham tuition and required fees. The residential data science master's
uses this fee schedule. The [tuition table](masters_tuition.csv) supplies
each academic year's annual fee for Michigan residents and nonresidents;
its [source notes](masters_tuition_README.md) document the rates and calculation.
The main example uses Michigan resident fees. All costs and earnings are
in 2024 dollars.

The budget is twice the annual full-time fee for the selected year,
representing four terms at that year's rate. This is a price-based estimate;
it does not sum two consecutive academic years' bills. Tuition accumulates
over the study years, with no wage earnings during school.
Annual salaries are held at each degree group's observed mean.
Actual credit loads and aid vary.

Using pay in thousands of 2024 dollars:

```text
tuition = 2 * annual_fee
investment_cost = tuition + 2 * bachelor_pay
earnings_gap = master_pay - bachelor_pay
years_after_masters = investment_cost / earnings_gap
years_since_bachelors = 2 + years_after_masters
```

The 2024 Michigan resident budget is $57,772.76. Including forgone earnings
gives an investment of $320,820, an annual gap of $30,519, and 10.512 years
after master's graduation to catch up (12.512 years after the bachelor's).
The nonresident tuition budget is $115,552.76, giving 12.405 years after
the master's. One study year at the same annual fee halves both tuition
and forgone earnings, giving 5.256 years for a Michigan resident.

```text
Year    Tuition budget ($1,000s)   Years after master's
2019                      59.431                11.858
2021                      58.416                11.263
2022                      56.223                11.484
2023                      56.672                10.584
2024                      57.773                10.512
```

Each row joins that survey year's observed degree means to the annual fee
for the academic year starting in the same calendar year. Year-specific
fees are converted to 2024 dollars with the same CPI-U series as earnings.
The budget holds each year's rate constant for two study years. Fees
increased 19.27% in nominal dollars from 2019 to 2024, while CPI rose 22.70%,
so resident fees declined 2.79% in real terms. Between 2022 and 2024, fees
rose in real terms, but the larger earnings gap reduced break-even time.

The scenario uses pretax wages and excludes discounting, financing, tax
differences, and wage growth. Living costs are assumed equal for the two
paths. It describes
a hypothetical calculation using observed group means, not an estimated
causal return to earning a degree. Keep these details in the source notes
and oral discussion, as requested by the instructor.

## Sources and reproduction

Prepared October 5, 2026 from existing local Census extracts. The source
project verified 2024 as the latest downloadable one-year release on
October 1, 2026. Its [README](../../../course_design/skill_returns/acs/README.md)
documents the downloads and official definitions. Official resources:
[ACS microdata access](https://www.census.gov/programs-surveys/acs/microdata/access.html)
and [2024 PUMS documentation](https://www.census.gov/programs-surveys/acs/microdata/documentation/2024.html).

The local inputs are `course_design/skill_returns/acs/data/acs_YEAR.parquet`.
Each adjacent `acs_YEAR.json` stores the exact download URL, archive SHA256,
archive members, person-record count, and retained fields. The downloaded
national source-archive hashes are:

```text
Year  Archive SHA256
2019  18e4ece4cc24781c01e8046c2d5afbabeb1f15452ddec43f60fdf3b1f6e67b92
2021  e1e64f81718e7d478cf2bf4ad8d1ae1fa03c690f6c86afa3984d1a6bd38dc8f2
2022  687a97773d0fdfec6c624ea6bf48466f12059d3ee80283a2ad8604ea7a66231e
2023  98b6ecb14b4830d1f2b54c265a5bd997828415c2dab14e17369c40e98b78d9d4
2024  afdc6d90c6e2f0bab365ed32d95ba4c4d8ac651162f46ac7861295b2dc469894
```

From `f26`, regenerate the CSV and print the analysis using the existing ACS
project environment:

```sh
uv run --project course_design/skill_returns/acs python course_design/prepare_masters.py
```

The script reads the existing extracts and CPI table, and writes the source
extract, the five-row price table, and the completed earnings reference. The
PS6 checks compare the homework-built table to this reference row by row.
The completed earnings CSV has
123,495 records, 4,364,786 bytes, and SHA256
`c07674b9393d172b15dee035ef92c136b863575c764e2c4af33cf84ee59ef9d1`.
Pay values are saved to nine decimal places in thousands of dollars.
