STAT 200 · Statistics for Economics
Data and Variables: What Economists Measure
Learn what data and variables are, the main types and shapes of economic data, and how to question a number before you trust it.
Key takeaways
- A variable is a characteristic that can differ from one case to the next, and data are the recorded values of variables.
- Quantitative variables measure amounts, while categorical variables sort cases into groups, and each type allows different calculations.
- Economic data come as cross sections, time series, or panels, depending on whether you compare cases, dates, or both.
- Stocks are measured at a moment, flows are measured over a stretch of time, and mixing them up leads to nonsense.
- Every number rests on a definition and a measurement method, so ask about both before drawing conclusions.
The mayor of a small town stands up at a meeting and says, "Our economy is booming." A woman in the back row, who just watched two shops on her street close, mutters, "Whose economy?" Who is right?
Neither of them can settle it by talking louder. They need to agree on what to measure, how to measure it, and when. That is the job of this course. Statistics is the set of tools for collecting numbers, describing them, and judging how much they can tell you. Before any of those tools, you need to know what a number is a number of.
Meet Priya, who runs a bike repair shop in the invented town of Elmford. The town council has asked her to help build a picture of how local businesses are doing. She has a clipboard, a free weekend, and no idea where to start.
Cases, variables and values
Priya's first move is to decide who or what she is collecting information about. Each of these is a case (also called an observation or a unit). Her cases are businesses on Elmford's three main streets.
Next she decides what to write down about each one. A variable is a characteristic that can differ across cases: number of workers, monthly sales, type of business, whether it is open on Sundays. The particular entry for one case, such as "4 workers," is a value. The full collection of recorded values is the data. (One piece is technically a "datum," but you will rarely hear anyone say it.)
The neatest way to organize all this is a table with one row per case and one column per variable. Here is a slice of Priya's clipboard.
| Business | Type | Workers | Sales last month ($) | Owner's mood |
|---|---|---|---|---|
| Spoke & Wrench | Repair | 3 | 18,000 | Good |
| Crumb Corner | Bakery | 6 | 42,000 | Okay |
| Page Turner | Books | 2 | 11,000 | Poor |
| Noodle Barn | Restaurant | 9 | 61,000 | Good |
| Stitch Up | Tailor | 1 | 5,000 | Okay |
Five cases, four variables, and the business name as a label that identifies each row. Almost every data set you will ever meet has this shape, even if it has millions of rows.
Types of variables, and why they matter
Not all columns behave the same way. You can add up the workers column and get something meaningful: 3 + 6 + 2 + 9 + 1 = 21 jobs. Try adding up the "Type" column. Bakery plus Books equals what, exactly? A very sticky novel?
A quantitative variable is a number that measures or counts an amount, so arithmetic makes sense. A categorical variable places each case into a group. Each of these splits again.
A nominal variable has categories with no natural order, such as business type or neighborhood. An ordinal variable has categories you can rank, such as "poor, okay, good." The catch is that you do not know the size of the gaps. Is the jump from poor to okay as big as the jump from okay to good? Nobody can say.
A discrete variable takes separate, countable values: you can have 3 workers or 4, but not 3.6 people standing in a shop. A continuous variable can take any value in a range, such as the time a repair takes. Money is technically counted in cents, but the steps are so tiny that economists usually treat it as continuous.
Why care? Because the type decides which tools are fair to use. For categories, you count how many cases fall in each group and report shares. For amounts, you can also compute averages, spreads, and relationships, which the next several lessons cover.
Three shapes of economic data
Priya's weekend survey is a snapshot. She looked at many businesses at about the same time. That is cross-sectional data: many cases, one period. It answers questions like "How do bakeries compare with bookstores right now?"
Now suppose she only records her own shop's sales every month for three years. That is a time series: one case, many periods, kept in date order. It answers "Is my shop growing, and does it slump every January?"
If she follows the same set of businesses month after month, she has panel data (also called longitudinal data): many cases, many periods. Panels are gold for economists, because you can watch how each business changes and compare those changes across businesses.
One warning about time series. If Priya surveys 40 shops this June and a different 40 next June, she does not have a panel. A change in the average might come from real change, or just from picking different shops.
Stocks, flows, rates and shares
Economists lean on one more distinction that saves a lot of confusion.
A stock is an amount measured at a single moment. Priya has 25 inner tubes on the shelf at closing time on Friday. A flow is an amount measured over a stretch of time. She sold 60 inner tubes during May. Your bank balance is a stock. Your paycheck per month is a flow. A bathtub holds a stock of water, and the faucet supplies a flow.
Flows need a time label to mean anything. "Sales of $18,000" could be superb per day or grim per year. The same idea sits behind national output, which is a flow, as you can see in the lesson on gross domestic product.
Raw totals can also mislead when groups differ in size. So economists use rates and shares. A share is a part divided by the whole. A rate often expresses something per some number of people or per unit of time. If 2 of Priya's 5 businesses report a good mood, the share is 2 ÷ 5 = 0.40, or 40%.
Changes need care too. If a share rises from 40% to 50%, it rose by 10 percentage points, which is the simple difference between two percentages. But the percent change is (50 − 40) ÷ 40 × 100 = 25%. Both statements are true. They answer different questions, and sneaky speakers pick whichever sounds better.
A worked example: Elmford's year
The council surveys the same five businesses one year later. Total workers have gone from 21 to 24. Total monthly sales have gone from $137,000 to $145,220. Prices in town, suppose, rose 4% over the year. (That rate is made up for the example.)
First, check last year's sales total from the table:
18,000 + 42,000 + 11,000 + 61,000 + 5,000 = 137,000 Percent change in workers:
(24 − 21) ÷ 21 × 100 = 3 ÷ 21 × 100 ≈ 14.3% Percent change in sales:
(145,220 − 137,000) ÷ 137,000 × 100 = 8,220 ÷ 137,000 × 100 = 6.0% Sales are up 6% in dollars. But part of that is just higher price tags. Adjusting for the 4% price rise gives sales in last year's prices:
145,220 ÷ 1.04 ≈ 139,635
(139,635 − 137,000) ÷ 137,000 × 100 ≈ 1.9% So the volume of stuff sold grew by only about 1.9%. That gap between dollar figures and price-adjusted figures is covered fully in real versus nominal values.
Finally, sales per worker, in dollar terms:
Last year: 137,000 ÷ 21 ≈ 6,524
This year: 145,220 ÷ 24 ≈ 6,051 Sales per worker fell. The mayor can honestly say jobs and sales rose. A skeptic can honestly say each worker now brings in less. Same data, different variables.
All three come from the same two surveys of the same five invented businesses. Hypothetical example: the numbers are made up to show the method, not a quote or an average.
Where the numbers come from, and what can go wrong
Priya's data came from asking people. National data come from similar efforts on a much larger scale. In the United States, the Census Bureau surveys households and businesses, the Bureau of Labor Statistics (BLS) reports on jobs and prices, the Bureau of Economic Analysis (BEA) reports on output and income, and the Federal Reserve publishes data on money and credit. Their websites explain current definitions, which do get revised.
Some data come from surveys, some from records that already exist, such as tax filings or store scanners. Most economic data are observational: researchers record what happens without controlling it. Experimental data come from a study where researchers deliberately assign a treatment, often at random. Observational data make it harder to say what caused what.
Three questions will protect you from many bad numbers.
- What exactly counts? Is a part-time student a "worker"? Does the owner count? Official labor statistics need precise rules, as counting jobs and unemployment shows.
- How was it measured? People round, forget, and shade the truth. The gap between the recorded value and the true value is measurement error.
- Is it a stand-in? A proxy is a variable used in place of something hard to measure. Electricity use might be a proxy for business activity. It can be useful, but a new set of efficient freezers would cut power use without cutting sales.
A common mistake: doing math on labels
Priya types her mood column into a spreadsheet as 1 for poor, 2 for okay, and 3 for good. The five moods become 3, 2, 1, 3, 2. The spreadsheet cheerfully reports an average of 11 ÷ 5 = 2.2. Priya announces that Elmford's mood is "2.2."
2.2 what? The codes only show order. If she had used 1, 2, and 10, the order would be identical, but the average would be 10 + 2 + 1 + 10 + 2 = 25, divided by 5, or 5. The result depends on numbers she invented.
The safe report is a count or a share: 2 good, 2 okay, 1 poor. The same trap is worse with nominal codes. Averaging ZIP codes or jersey numbers produces a number and zero information. Software will happily compute anything you ask, so the judgment has to come from you.
From clipboard to question
Good data work starts with a clear question. "How is the economy?" is too fuzzy. "Did the number of paid workers at businesses on these three streets rise between this June and next June?" names the cases, the variable, and the period. Once Priya can say that, she knows what to collect.
In the next lesson you will turn columns of numbers into pictures with histograms, bar charts and scatter plots, which often reveal in seconds what a table hides.
Words to know
Variable a characteristic that can take different values for different cases.
Categorical variable a variable that sorts cases into groups, with or without a natural order.
Quantitative variable a variable whose values are counts or measured amounts.
Cross-sectional data information on many cases at roughly one point in time.
Time series information on one case recorded at many points in time, in order.
Panel data information on the same set of cases tracked over several periods.
Stock and flow a stock is measured at a moment, while a flow is measured over a period.
Proxy a measurable variable used to stand in for one that is hard to observe.
Check yourself
- In a survey of apartments, you record monthly rent, neighborhood, and number of bedrooms. Which variables are categorical and which are quantitative?
- Is the money in your savings account on March 1 a stock or a flow, and what about the interest you earn during March?
- A town records unemployment for 30 neighborhoods every year for ten years. What shape of data is this?
- The share of shops open on Sunday rises from 20% to 30%. What is the change in percentage points, and what is the percent change?
- A shop's sales rise from $50,000 to $53,000 while prices rise 8%. Did the volume of sales rise or fall?
- Explain why averaging the codes for an ordinal variable can be misleading.
Show the answers
- Neighborhood is categorical (nominal), while monthly rent and number of bedrooms are quantitative, with bedrooms being a discrete count.
- The balance on March 1 is a stock because it is measured at a moment, and March interest is a flow because it builds up over a period.
- It is panel data, because the same 30 neighborhoods are followed across ten years.
- The change is 30 − 20 = 10 percentage points, and the percent change is 10 ÷ 20 × 100 = 50%.
- It fell, since 53,000 ÷ 1.08 ≈ 49,074 in last year's prices, which is about 1.9% below 50,000.
- The codes only show rank, so the gaps between them are arbitrary and a different but equally valid coding would give a different average.