The economist’s data analysis skillset.
Tracking a numerical variable over time
> Time series data: one entity, many points in time
> Numerical variable: values that change over time (price, GDP, temperature)
> Key question: What are the trends and patterns over time?
What price should we expect in January 2026?
| date | price |
|---|---|
| 2000-01-03 | 1.0545 |
| 2000-01-04 | 1.0300 |
| 2000-01-05 | 1.0550 |
| 2000-01-06 | 1.0225 |
| 2000-01-07 | 1.0250 |
| … | … |
> how might we use this data to predict the price in January 2026?
What price should we expect in January 2026?
> it’s difficult to know… do we choose the mode?
> lets just organize prices by their ordered index, time
What price should we expect in January 2026?
> lets indicate with a line that these points are in squence
What price should we expect in January 2026?
Do you notice a trend in price?
> there was a positive trend in 2021
> we can zoom out to get a bigger picture
Do you notice a trend in price?
> how have prices changed since 2000?
> prices have increased somewhat, with many periods of decrease
What price should we expect in January 2026?
> with background shading its easier to see periods with a negative trend in price
Lets use a linegraph to examine the trends in coffee prices.
Coffee_Prices.csv
What we just did
| Step | Action |
|---|---|
| SELECT | Coffee prices 2015-2025 |
| TRANSFORM | Order by date |
| ENCODE | Date → x-position; Price → y-position; Sequence → connected line |
> ENCODE uses position for both time and value — the line shows sequence
Are prices over long periods comparable?
> was coffee about as expensive in 1980 as it is today?
A dollar in 1980 ≠ a dollar in 2025
> no! a dollar today is worth much less than in 1980
> we need to adjust for inflation to compare across time
Adjusting for inflation changes the picture
> prices have actually dropped since 1980 and stabilized since 2000
Is there a trend in the real price of coffee?
Lets transform coffee prices from nominal dollars to real dollars.
Coffee_Prices_CPI.csvIs there a trend in the real price of coffee?

What we just did
| Step | Action |
|---|---|
| SELECT | Coffee prices 1980-2025 with CPI data |
| TRANSFORM | Divide nominal price by CPI adjustment factor |
| ENCODE | Date → x-position; Real price → y-position; Sequence → connected line |
> TRANSFORM converts nominal dollars to real (inflation-adjusted) dollars
What price should we expect in January 2026?
> timeseries lineplots show us about the trends but is there something specific in January?
What price should we expect in January 2026?
> a boxplot gives us a picture of the prices just in January
> lets compare this to other months
In addition to the overall trend, are there monthly patterns?
> lets be more specific…
In which month was the record highest price set?
In which month was the record highest price set?
> look at the maximums
In which month was the record highest price set?
In which season are prices most spread out?
In which season are prices most spread out?
> look at the ranges
In which season are prices most spread out?
What is the trend in median price?
> look at the medians…
What is the trend in median price?
What is the difference between the largest and the smallest median price per pound?
> something like $1.30 - $1.21 = $0.09
Linegraphs show trends; multi-boxplots show between-period patterns.
Lets use a multi-boxplot to examine the seasonal patterns of coffee prices.
Coffee_Prices.csv
What we just did
| Step | Action |
|---|---|
| SELECT | Coffee prices 2000-2025 |
| TRANSFORM | Group by month; calculate quartiles within each group |
| ENCODE | Month → y-position; Price quartiles → box elements |
> TRANSFORM groups by time period, then summarizes within each group
What this unit adds to your toolkit
| Block | Part 1.3 |
|---|---|
| Variables | Numerical |
| Structures | Timeseries |
| Operations | Real price transformation; group by period |
| Visualizations | Line plot; Multi-boxplot |
> Next: Panel Data with both entity and time indexes!