DATA SCIENCE · CYCLE 1 · L4 · TEXTBOOK CHAPTER
Types of Data, and Your Question
A project starts with a question you can collect data on. The question decides what you write down, what type each column is, and what you can say at the end. The goal is to collect useful data: two or three well-chosen variables, measured the same way every day, beat a dozen measured badly.
After this chapter, you can
- Lay out a data sheet with one row per observation and one column per variable, and put a unit in every numerical header.
- Classify a variable as categorical (nominal or ordinal) or numerical (discrete or continuous), and say what that type lets you compute and chart.
- Write your question in the four words, THE THING, THE WHO, THE WHEN, THE SHAPE, and count the rows it produces by Friday 9 October.
Why It Matters
A number means nothing until you know what it measures and in what unit. NASA lost a spacecraft because two teams read the same numbers in two units.
The Mars Climate Orbiter launched on 11 December 1998. On 23 September 1999 it reached Mars and came in too low. NASA’s investigation found that it burned up in Mars’ atmosphere.
The investigation found one root cause. A program on the ground wrote a file of numbers about the spacecraft’s small thruster firings. The plan said the file must be in newton-seconds, a metric unit. The program wrote it in pound-seconds, an English unit. A number looks the same in either unit, and the navigation software read each one as newton-seconds.
One pound of force is 4.45 newtons. So the software counted every firing as 4.45 times smaller than it was, and the path it worked out was wrong.
| The lowest point of the first pass over Mars | Height |
| The plan | 226 km |
| The lowest the spacecraft could survive | 80 km |
| What NASA worked out afterwards | 57 km |
The spacecraft passed 169 km lower than the plan, and 23 km under the lowest it could survive.
Your data sheet can go wrong the same way. A column named Travel time that holds 45 can mean 45 minutes or 45 seconds. A column named Travel time (min) can be read only one way. This chapter is about what you decide before the first number goes in: what one row is, what each column is, its type and its unit.
The Idea
Rows and columns
A data sheet has one row per observation and one column per variable. An observation is one thing that happened: one night, one bus trip, one meal. A variable is one fact you record about every observation.
Row 1 is the header row, one name per column, and every numerical header carries its unit: Hours slept (h), Travel time (min), Cost ($). Date goes first and Notes goes last. One fact per cell: “45 min, felt tired” in one cell is two variables, and Sheets cannot add it up.
| Date | Slept (h) | Alarm? | Mood (1 to 5) | Notes |
| 9/9/2026 | 6.5 | yes | 3 | |
| 9/10/2026 | 7.4 | yes | 4 | |
| 9/11/2026 | 8.9 | no | 4 | Friday |
| 9/12/2026 | | | | missed |
One row is one night: four rows, four nights. A made-up example. A missed observation keeps its row: blank cells, and “missed” in Notes. Never a zero and never a number remembered later. A zero means you measured zero.
Categorical and Numerical
Four types of variable
A variable is categorical when its values are labels, and numerical when its values are amounts. Each splits in two.
| Type | Its values are | Examples |
| nominal | labels with no order | transport mode (bus, walk, car); yes or no; the meal (breakfast, lunch, dinner) |
| ordinal | labels with an order but no fixed distance between them | a mood rating from 1 to 5; small, medium, large |
| discrete | a count, whole numbers only | texts sent; flights of stairs; free throws made of 20 |
| continuous | a measurement that can land anywhere on a scale | hours slept; minutes late; dollars spent; °F |
A rating of 4 looks like a number and behaves like a label: 4 is above 3, but nobody can say the gap from 3 to 4 equals the gap from 1 to 2. The type is decided by what the value means, never by whether it is written in digits.
The same thing can be recorded as either kind. Here are 31 nights of sleep, written down two ways.
The same 31 nights, recorded two ways. On the left, sleep is an ordinal category, and all you can do is count the nights in each bin. On the right it is a continuous measurement. You can take a mean (7.7 h) and see the spread. You can also see when the long nights come: 9 of the 13 nights of 8 hours or more come before a day off. The number holds more. The category is quicker to write. A made-up example.
What the Type Lets You Do
The type of a variable decides what you can compute and what chart fits. The mean of a nominal variable means nothing. Code bus as 1, walk as 2 and car as 3. Ten trips, 5 by bus, 3 on foot and 2 by car, have a mean of (5 × 1 + 3 × 2 + 2 × 3) ÷ 10 = 1.7. A mean of 1.7 describes no trip anyone took. A bar for categories; a histogram or a line for numbers.
| Type | Example | Summary that makes sense | Chart that fits, in Sheets |
| nominal | transport mode | a count and a percent for each label; the most common | Column chart, one bar per label |
| ordinal | mood, 1 to 5 | a count for each level; the median; the share at 4 or above; no mean | Column chart, levels in order |
| discrete | texts sent in a day | mean, median, total, range | Line chart over days (a Column chart of the days comes second); dot plot |
| continuous | hours slept | mean, median, range | histogram; Line chart over time; Scatter chart against another number |
A comparison needs one numerical variable plus one categorical variable that says which group each row is in: hours slept, and school night or weekend night.
The Four Words
Your question, in four words
Every data question in this course answers four things, in this order, with no other names for them.
THE THING is what gets written down, its type, and its unit. “Happier”, “late” and “better” are judgments. Decide in advance what value stands for the word, and say that the value is narrower than the word.
THE WHO is what each row describes, said as one row is one night, or one trip, one meal, one day. It is you, your bus, your kitchen: something you can reach. No other person’s name goes in the sheet. You never have to show your raw sheet to the class.
THE WHEN is how often, over what stretch. The stretch is fixed. How often is yours: an actual time (9 p.m.) or an actual trigger (when I step off the bus), never “whenever”. THE WHEN is your sample: a fixed time or trigger is a systematic sample of your moments. Say what it misses.
THE SHAPE is what the answer looks like: a single number, a comparison between groups, or a trend over time. A yes you already know is a fact rather than a finding. Ask how much instead of whether.
A menu of things worth measuring. Pick two or three. Each must take under 60 seconds to record, or you will stop by day four.
| Area | A variable, with its type |
| Sleep | hours slept (continuous); alarm, yes or no (nominal) |
| Phone | screen time, min (continuous); texts sent (discrete) |
| Activity | steps (discrete); minutes of practice (continuous) |
| Food | dollars spent (continuous); servings of vegetables (discrete) |
| School | homework, min (continuous); subject (nominal) |
| Commute | mode (nominal); travel time, min (continuous) |
The Window, and the Rows It Holds
Collection runs from Wednesday 9 September to Friday 9 October 2026. September 9 to 30 is 30 − 9 + 1 = 22 days and October adds 9, so 31 calendar days. Three weekdays in the first week plus four whole weeks is 3 + 4 × 5 = 23 weekdays. Two are no-school days, Mon 21 Sep and Wed 7 Oct, leaving 21 school days. The four Sundays are 13, 20 and 27 September and 4 October.
The window. Tan cells are weekdays, dotted cells are the two no-school days, and red outlines are the four Sundays. Weekends are collection days. Source: APS 2026-27 calendar.
Count your rows
Rows = observations per unit × units in the window.
| The plan | Rows |
| Once a day | 1 × 31 = 31 |
| Once per school day | 1 × 21 = 21 |
| Twice a school day, to school and home | 2 × 21 = 42 |
| Once every Sunday | 1 × 4 = 4 |
Four dots on a chart is not a story. The floor is 15 rows: a plan needs at least that many. Below it, make the row smaller: a week becomes a day, a day becomes a meal or a trip.
Two dates to mark. On Thursday 17 September, day 9, you show a partner one chart of your rows so far. On Friday 9 October, day 31, collection closes.
Worked Examples
Example 1 · Classify every column of a proposed sheet. A student proposes a commute sheet with the headers Date | Mode | Left home | Travel time | Stairs climbed | Late? | Notes. Name the type of every variable, and fix any header that is missing something.
Create a strategyGo across the header row one column at a time and ask two questions of each. Are the values labels or amounts? If amounts, is it a count or a measurement? Then check that every amount has a unit in its header.
Apply the idea
| Header | Type | Why |
| Date | outside the four types | the when; every row needs it |
| Mode | nominal | bus, walk, car: labels, no order |
| Left home | continuous | a clock time, a measurement on a scale |
| Travel time | continuous | a measurement, and the header has no unit |
| Stairs climbed | discrete | a count |
| Late? | nominal | yes or no |
| Notes | text | kept for the story, never charted |
The broken header is Travel time. It becomes Travel time (min). With no unit, a 45 two weeks from now could be minutes or seconds.
Reflect and checkRead the types back against the shape you want. Travel time by day is a line. Travel time by mode is a comparison: one numerical variable split by one nominal one, the chart this sheet was built for. A mean travel time makes sense; a mean mode does not. With “(min)” in the header, a stranger writes the same number you would.
Example 2 · Repair a vague question, with types. A student proposes: “Does the weather affect my mood?” Rewrite it so all four words are answered, and name the type of each variable it needs.
Create a strategyRun the four words in order. For each one the question fails, replace the failing word with a value, a type, a unit and a way to get it. Then write the repaired question, ending in a question mark, and read it back against all four.
Apply the idea
| Word | Does it pass? | The repair |
| THE THING | fails twice | “Weather” becomes the day’s high temperature in °F, continuous, from the same app at 9 p.m. “Mood” becomes a self-rating from 1 to 5, ordinal, 1 the worst day and 5 the best, written at 9 p.m. |
| THE WHO | passes | Me. One row is one day. |
| THE WHEN | missing | 9 p.m. every day, 9 September to 8 October: 30 rows by the bell on 9 October. |
| THE SHAPE | fails | “Affect” hides a yes or no. Ask how much: a comparison between two groups of days, a high of 70°F or above and a high below it. That adds a nominal group column you can fill from the temperature. |
Repaired: “Is my 9 p.m. mood rating higher on days when the high reached 70°F than on cooler days, and by how much?”
Headers: Date | High (°F) | Warm day? | Mood (1 to 5) | Notes.
Reflect and checkFour cells, about 20 seconds, once a night. The types fix the summary. For an ordinal rating, report the median and the share of days at 4 or above in each group. Chart it as a Column chart with two bars. The repair has a cost, and your story has to say it: you are studying a 9 p.m. rating rather than mood, and one app’s high rather than the weather.
Example 3 · Count the rows a plan produces. Three plans. (a) One row per bus trip, to school and home, on school days. (b) Free throws made out of 20, once every calendar day. (c) A mood rating every Sunday night. How many rows does each have on Friday 9 October?
Create a strategyRows = observations per unit × units in the window. Read the units off the calendar: 31 calendar days, 23 weekdays, 21 school days, 4 Sundays. Compare each answer to the floor of 15.
Apply the idea
| Plan | One row is | Rows |
| (a) | one bus trip, two per school day | 2 × 21 = 42 |
| (b) | one set of 20, one per calendar day | 1 × 31 = 31 |
| (c) | one rating, one per Sunday | 1 × 4 = 4 |
Plan (c) has rows on 13, 20 and 27 September and 4 October, and no others.
Reflect and checkPlan (c) fails the floor, and the reason is the size of the row rather than the length of the window. The fix is to make the row smaller: a week becomes a day, and the same question gives 31 rows. Counting every weekday for plan (a) gives 2 × 23 = 46. Either count is fine in your plan, as long as you say which you counted.
Try It: Count the Rows
Choose how many rows you record each time, and how often. The lab multiplies the two. Then meet the three goals.
In Sheets: Build the Collection Sheet
The sheet comes before the first number. These steps make the place your data goes.
- In your browser’s address bar, type:
sheets.new
- Click the file name at the top left and rename it, with your own last name: Lastname - Personal Data Story - Raw Data
- Click cell A1. Type:
Date
- Click cell B1. Type your first variable’s header, with its unit in brackets, like:
Travel time (min)
- Type one header for each of your other variables, one in each cell of row 1.
- Click the next empty cell in row 1. Type:
Notes
- Click cell A2. Type the date like this:
9/9/2026
- Type your first observation across row 2, one fact in each cell.
- Share (top right) > General access > Arlington Public Schools > Viewer > Copy link.
- Paste the link in the Canvas assignment.
Row 1 is the header row. Your first row of data goes in row 2. A real date sits at the right of its cell. If it sits at the left, Sheets has read it as text.
Two rules about other people. If your data involves anyone else, you tell them first. No other person’s name goes in your sheet.
In your project
The Cycle 1 project is your own data, collected for about a month. This chapter is its first step: the question and the sheet. Your question names THE THING, THE WHO, THE WHEN and THE SHAPE. Your Google Sheet starts as one tab, with Date first, Notes last and a unit in every numerical header.
From L6 that tab is RAW, and it sits beside a CLEAN tab, a CLEANING LOG and an ABOUT tab. The ABOUT tab says where each number comes from, when you record it and what that misses. That is THE WHEN from this chapter.
The type of each column decides the rest. It picks the charts you make from L5 on. It picks the numbers your one-page Google Doc reports: a mean for hours, a count for each label, a median for a rating.
Check Yourself
Answer each one before you look. The first two are from L2 and L3, so you keep them.
A club has 40 members in September and 52 in October. What is the percent change? L2
(new − old) ÷ old × 100 = (52 − 40) ÷ 40 × 100 = 30%. The bottom number is the starting value, 40. The answer is positive, so the club grew: a 30% increase.
Claim: “The faster a song’s beat, the more plays it gets on my playlist.” Which job does the chart have to do? L3
Each song has two measurements, its beats per minute and its plays, and the claim says they move together. That job is Relationships. A Scatter chart does it: one dot per song. Comparisons puts groups side by side. Proportions shows parts of one whole. Start with the job. The picture comes second.
At a restaurant you order your food mild, medium or hot. What type of variable is the spice level?
The values are labels with an order: hot is above medium, and medium is above mild. Nobody can say the gap from mild to medium equals the gap from medium to hot, so there is no fixed distance. That is ordinal. Nominal labels have no order. Discrete and continuous values are amounts.
A sheet has a column named Locker number. Its values are 418, 207 and 355. What type of variable is it?
The type is decided by what the value means, never by whether it is written in digits. A locker number names a locker. Locker 418 is no more of anything than locker 207, and a mean locker number describes no locker. Labels with no order are nominal.
For 20 school days a student logs how she gets to school: bus on 11 days, walk on 6 days, car on 3 days. On what percent of the days does she take the bus?
11 ÷ 20 × 100 = 55%. Mode is nominal, so the summary that makes sense is a count and a percent for each label: bus 55%, walk 30%, car 15%. The most common label is bus. A mean of the three labels would mean nothing.
After each dog walk, a student types “30 min, rainy” in one cell. What is the fix?
One fact per cell. “30 min, rainy” is two variables in one cell, and Sheets cannot add it up. Walk time (min) is continuous and carries its unit. Weather is nominal. Two rows would break the other rule: one walk is one observation, so it gets one row.
A student asks: “How far do I run this month?” Her plan is to add up the miles and type one total on 9 October. Which of the four words does the plan fail?
THE WHEN is how often, over what stretch. One total at the end is one row, far under the floor of 15. THE THING passes: miles, a continuous number with its unit. THE WHO passes: her own runs. THE SHAPE passes: a single number. The repair is a smaller row: one row is one run, with Date and Distance (mi).
A student times each of his 4 walks between classes, every school day in the window. One row is one walk. How many rows does the plan give by Friday 9 October?
The window holds 23 weekdays, and 2 of them are no-school days: 23 − 2 = 21 school days. Each school day gives 4 rows. 4 × 21 = 84 rows, well over the floor of 15.
A plan records one row every Saturday: the week’s total spending. It gives 4 rows, under the floor of 15. What is the fix?
The window is fixed, so it cannot get longer. More columns add variables, and the plan still has 4 rows. A smaller row gives more rows from the same days: one row per day gives 1 × 31 = 31 rows.
Stuck on any of this? Ask Mr. Case in class or send him a message in Canvas. Name the example or the question number, and say which step lost you.