L4 Types of Data, and Your Question

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

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 MarsHeight
The plan226 km
The lowest the spacecraft could survive80 km
What NASA worked out afterwards57 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.

DateSlept (h)Alarm?Mood (1 to 5)Notes
9/9/20266.5yes3
9/10/20267.4yes4
9/11/20268.9no4Friday
9/12/2026missed

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.

TypeIts values areExamples
nominallabels with no ordertransport mode (bus, walk, car); yes or no; the meal (breakfast, lunch, dinner)
ordinallabels with an order but no fixed distance between thema mood rating from 1 to 5; small, medium, large
discretea count, whole numbers onlytexts sent; flights of stairs; free throws made of 20
continuousa measurement that can land anywhere on a scalehours 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.

As a category (ordinal)051015Under 7 h: 7 nights7Under7 h7 to 8 h: 11 nights117 to8 h8 h or more: 13 nights138 h ormoreNights (count)As a number (continuous)68101102031Day 1, Wed 9 Sep: 6.5 hDay 2, Thu 10 Sep: 7.0 hDay 3, Fri 11 Sep: 8.2 hDay 4, Sat 12 Sep: 7.7 hDay 5, Sun 13 Sep: 8.9 hDay 6, Mon 14 Sep: 6.7 hDay 7, Tue 15 Sep: 7.1 hDay 8, Wed 16 Sep: 7.0 hDay 9, Thu 17 Sep: 6.7 hDay 10, Fri 18 Sep: 8.6 hDay 11, Sat 19 Sep: 9.2 hDay 12, Sun 20 Sep: 8.5 hDay 13, Mon 21 Sep: 6.9 hDay 14, Tue 22 Sep: 8.3 hDay 15, Wed 23 Sep: 7.4 hDay 16, Thu 24 Sep: 7.1 hDay 17, Fri 25 Sep: 9.7 hDay 18, Sat 26 Sep: 7.9 hDay 19, Sun 27 Sep: 8.0 hDay 20, Mon 28 Sep: 7.8 hDay 21, Tue 29 Sep: 6.7 hDay 22, Wed 30 Sep: 7.0 hDay 23, Thu 1 Oct: 6.1 hDay 24, Fri 2 Oct: 8.1 hDay 25, Sat 3 Oct: 8.4 hDay 26, Sun 4 Oct: 9.2 hDay 27, Mon 5 Oct: 7.3 hDay 28, Tue 6 Oct: 8.5 hDay 29, Wed 7 Oct: 7.3 hDay 30, Thu 8 Oct: 6.3 hDay 31, Fri 9 Oct: 8.8 hBefore a day offmean 7.7 hDay of the windowHours slept (h)
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.

TypeExampleSummary that makes senseChart that fits, in Sheets
nominaltransport modea count and a percent for each label; the most commonColumn chart, one bar per label
ordinalmood, 1 to 5a count for each level; the median; the share at 4 or above; no meanColumn chart, levels in order
discretetexts sent in a daymean, median, total, rangeLine chart over days (a Column chart of the days comes second); dot plot
continuoushours sleptmean, median, rangehistogram; 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.

AreaA variable, with its type
Sleephours slept (continuous); alarm, yes or no (nominal)
Phonescreen time, min (continuous); texts sent (discrete)
Activitysteps (discrete); minutes of practice (continuous)
Fooddollars spent (continuous); servings of vegetables (discrete)
Schoolhomework, min (continuous); subject (nominal)
Commutemode (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.

Calendar of 7 September to 11 October 2026. The 31 days from Wednesday 9 September to Friday 9 October are filled in. Monday 21 September and Wednesday 7 October are marked no school. The four Sundays, 13, 20 and 27 September and 4 October, are outlined in red.
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 planRows
Once a day1 × 31 = 31
Once per school day1 × 21 = 21
Twice a school day, to school and home2 × 21 = 42
Once every Sunday1 × 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 strategy

Go 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
HeaderTypeWhy
Dateoutside the four typesthe when; every row needs it
Modenominalbus, walk, car: labels, no order
Left homecontinuousa clock time, a measurement on a scale
Travel timecontinuousa measurement, and the header has no unit
Stairs climbeddiscretea count
Late?nominalyes or no
Notestextkept 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 check

Read 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 strategy

Run 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
WordDoes it pass?The repair
THE THINGfails 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 WHOpassesMe. One row is one day.
THE WHENmissing9 p.m. every day, 9 September to 8 October: 30 rows by the bell on 9 October.
THE SHAPEfails“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 check

Four 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 strategy

Rows = 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
PlanOne row isRows
(a)one bus trip, two per school day2 × 21 = 42
(b)one set of 20, one per calendar day1 × 31 = 31
(c)one rating, one per Sunday1 × 4 = 4

Plan (c) has rows on 13, 20 and 27 September and 4 October, and no others.

Reflect and check

Plan (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.

  1. In your browser’s address bar, type: sheets.new
  2. Click the file name at the top left and rename it, with your own last name: Lastname - Personal Data Story - Raw Data
  3. Click cell A1. Type: Date
  4. Click cell B1. Type your first variable’s header, with its unit in brackets, like: Travel time (min)
  5. Type one header for each of your other variables, one in each cell of row 1.
  6. Click the next empty cell in row 1. Type: Notes
  7. Click cell A2. Type the date like this: 9/9/2026
  8. Type your first observation across row 2, one fact in each cell.
  9. Share (top right) > General access > Arlington Public Schools > Viewer > Copy link.
  10. 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

Claim: “The faster a song’s beat, the more plays it gets on my playlist.” Which job does the chart have to do? L3

At a restaurant you order your food mild, medium or hot. What type of variable is the spice level?

A sheet has a column named Locker number. Its values are 418, 207 and 355. What type of variable is it?

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?

After each dog walk, a student types “30 min, rainy” in one cell. What is the fix?

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?

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?

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?

Read More

OpenStax, Introductory Statistics 2e, section 1.2: Data, Sampling, and Variation in Data and Sampling. A free college textbook. Read as far as Example 1.7. It says qualitative for categorical and quantitative for numerical. It sorts numbers into discrete and continuous the same way: books in a backpack are counted, and the weight of the backpack is measured. The next section, 1.3, names nominal and ordinal.

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.