Before you start
You will be able to
- Distinguish structured, semi-structured and unstructured data, and explain what has to happen before unstructured data can be counted.
- Identify the observations, variables and unit of observation of a dataset.
- Classify a variable as categorical (nominal or ordinal) or numerical (discrete or continuous), and by level of measurement, and state which summaries each level allows.
- Recognise identifiers and codes that are written with digits but are not amounts.
- Distinguish cross-sectional, time-series and panel data, and primary from secondary data, and choose the kind a question needs.
Review first
- Business questions and measurable objectives — You need the idea that a question names its unit of analysis and its time frame; this lesson describes the data that has to match them.
- The four kinds of analytics — The analytics process runs from question to data; this lesson is the first close look at the data step.
Fictional case A fictional coffee business founded by Ana Lim. It starts as a catering and barista-training service, opens its own cafés and an online shop for beans, and plans a canned cold brew.
The idea
Fictional case
It is the start of October 2026, and Ana Lim is preparing her monthly review of Lantern’s online shop. Her evidence arrives in very different shapes. The shop platform gives her a spreadsheet of orders, one row per order. The app keeps a log of what customers tap, one labelled record per event.
Fictional case
The survey she e-mailed on 1 October to the 240 customers who ordered in September is bringing back ticked boxes and a few sentences of comment. And she keeps her own monthly summary of visits and ratings, one line per month. Before she can ask any of it a question, she needs to know what kind of data each one is, because that decides what she can sensibly do with it.
Data means recorded facts: values written down, counted or measured so that they can be analysed. This lesson gives you the vocabulary to describe any data you meet, in layers.
First, how the data is organised: as a table, as labelled records or as free content. Second, what one row describes and what each column records. Third, what kind of value a column holds, which decides the comparisons and summaries that mean something. Last, two descriptions that matter whenever you choose data for a question: how the data runs through time, and who collected it and why.
Structured, semi-structured and unstructured data
Structured data fits a fixed layout of rows and columns in which every record has the same fields. Lantern’s order export is structured: every order has an order number, a date, a customer, a product, a quantity and so on, each in its own column. Spreadsheets and database tables hold structured data, and almost every calculation in this course starts from it.
Semi-structured data labels its parts but doesn’t force every record into the same columns. The app’s event log is written in JSON, a common text format made of named fields. One record looks like {"event": "add_to_cart", "product": "House Blend 250g", "qty": 2}. Every value travels with its name, so software can read it reliably, but a payment event carries different fields from an add-to-cart event, and some records contain lists inside them. E-mails are semi-structured too: the sender, date and subject are labelled fields, and the body is free text.
Unstructured data has no predefined data model: free text such as reviews and survey comments, photographs, recordings of phone calls, video. None of it can be counted until someone decides what to count. Turning a comment such as “Card page froze on my phone” into variables (topic: payment; device: mobile; tone: negative) is called coding the text. Coding takes judgement, and two people can code the same comment differently, so the rules for each code should be written down and checked like any other definition.
Observations, variables and the unit of observation
A structured dataset is a table in which each row is an observation (also called a record) and each column is a variable (also called a field): one characteristic recorded for every observation. The most important fact about any table is its unit of observation, the kind of thing one row describes. In the order export, one row is one order. In the survey file, one row is one respondent. In Ana’s monthly summary, below, one row is one month.
| Month | Web visits | App visits | Gift-box orders | Ratings given | Average rating (stars) |
|---|---|---|---|---|---|
| Jul 2026 | 7,400 | 2,400 | 6 | 118 | 4.4 |
| Aug 2026 | 7,700 | 2,500 | 7 | 126 | 4.4 |
| Sep 2026 | 8,800 | 2,600 | 5 | 97 | 4.1 |
| Oct 2026 | 8,300 | 2,700 | 9 | 124 | 4.3 |
| Nov 2026 | 10,400 | 3,200 | 88 | 161 | 4.4 |
| Dec 2026 | 12,500 | 3,700 | 231 | 199 | 4.5 |
The average rating is the mean of the 1–5 star ratings customers gave that month.
Every count, total and average is counted in units of the observation. Averaging the web-visits column gives visits in the average month, not anything about the average visitor. Averaging the average-rating column is a trap of the same kind: it treats every month as equal, although December’s figure rests on 199 ratings and September’s on 97. Before calculating anything, finish the sentence “one row in this table is one ___”. The business-questions lesson asked you to name the unit a question is about; the data you use must be recorded at that unit, or be convertible to it, for example by adding up orders to get months.
Categorical and numerical variables
What you can do with a variable depends on what its values mean, not on whether they are written with digits. A categorical variable places each observation in a group: the channel an order came through, the product, whether it contained a gift box, the answer to a survey question. A numerical variable records an amount found by counting or measuring: visits, packs ordered, the order total, the weight of a parcel.
Each kind splits again. A nominal variable is categorical with no natural order: web is neither more nor less than app. An ordinal variable is categorical with a meaningful order but no fixed distance between categories: a five-star rating ranks orders, but nothing says the step from three stars to four equals the step from four to five.
A discrete variable is numerical and takes separate values with gaps between them, usually because it counts: 2 visits or 3, never 2.6. A continuous variable can take any value in a range, at least in principle, because it is measured: weight, time, temperature. Money is recorded to the cent, so strictly it is discrete, but it has so many possible values that analysts treat it as continuous.
In depth
Levels of measurement
In 1946 the psychologist S. S. Stevens proposed classifying measurements by the comparisons between their values that make sense. His scheme gives every variable a level of measurement (nominal, ordinal, interval or ratio), and it is still the standard framework in introductory statistics. Each level allows everything the level before it allows, plus one more kind of statement.
| Level | You can say | Meaningful summaries | Lantern examples |
|---|---|---|---|
| Nominal | Same or different | Counts, shares, the mode | channel, product, customer_id, would recommend (yes or no) |
| Ordinal | Also: higher or lower | Also: the median and percentiles | star rating; disagree, neutral or agree; roast (light, medium, dark) |
| Interval | Also: by how much (differences) | Also: the mean and the standard deviation | order date; temperature in °C |
| Ratio | Also: how many times (ratios) | Also: ratios, such as “1.7 times as many” | visits, packs, order total, gift-box orders |
Each row allows everything in the rows above it. Based on Stevens (1946), who listed the statistics each scale permits.
Interval and ratio variables are both numerical; the difference lies in zero. On a ratio variable zero means none of the quantity, so ratios mean something: 12,500 web visits in December is about 1.7 times July’s 7,400. On an interval variable differences mean something but zero is an arbitrary point on the scale, so ratios do not. Calendar dates are interval: 5 October is 34 days after 1 September, but no date is “twice” another. Temperature in degrees Celsius is the textbook case: 0 °C is the temperature at which water freezes, not an absence of warmth, so 20 °C is not twice as warm as 10 °C.
The level tells you which statements are safe. “Web visits rose by 5,100 from July to December” and “they were 69% higher” are both fine for a ratio variable. For an ordinal rating you can say that more orders were rated five stars, or that the median rating fell from 5 to 4, but “customers were twice as satisfied” is meaningless, because a four-star order is not two two-star orders. For a nominal variable you can only count and compare shares: about 30% of July’s orders came through the app (89 of 294).
Averaging a rating
Stevens wrote that in strict propriety the ordinary statistics involving means and standard deviations “ought not to be used” with ordinal scales, because the steps between categories need not be equal. He also recognised that such means are used anyway because they often lead to fruitful results.
Many statisticians defend the practice more strongly, especially when several rating questions are added into one score or samples are large, and Velleman and Wilkinson (1993) argued that whether a summary is meaningful depends on the question asked rather than on a fixed level; B02 returns to this. Shops average star ratings all the time: Lantern’s monthly summary reports the mean of the stars given. The mean of a rating is a reasonable quick summary as long as you remember what it hides.
Take two months with 40 ratings each. In the first, 10 customers give three stars, 20 give four and 10 give five. In the second, 10 give one star and 30 give five. Both average exactly stars.
Yet the first describes steady satisfaction, and the second a shop that delights most customers and badly lets down a quarter of them. The medians, 4 and 5, begin to separate the months, and the full counts separate them completely. When you report an average rating, report the distribution with it, or at least the median and the share of low ratings.
Identifiers and codes
An identifier is a value whose only job is to say which thing a row is about: an order number, a customer number, a product code, a postcode. Identifiers are often written with digits, which tempts people and software into treating them as amounts. The average of Lantern’s order numbers means nothing, and a spreadsheet that stores the postcode 02134 as a number silently drops the leading zero and creates a different label. Identifiers are used to count, match and look things up, never to calculate with.
Survey and system codes cause the same confusion. A survey file may store “strongly disagree” to “strongly agree” as 1 to 5, and a shop system may store web as 1 and app as 2. The codes are labels for categories. The average channel code is meaningless, and the average agreement code is the mean of an ordinal variable, with all the caveats above. Before you summarise a coded column, find out from the data’s documentation what each code means; B02 Data Cleaning and Preparation calls that documentation the data dictionary and shows you how to write one.
How software stores a column (as a number, as text, as a date, or as true or false) is a separate question from what the values mean. A date can be stored as text and a postcode as a number; both are mistakes that break sorting, sums and joins, and B02 shows how to find and fix them. The classification in this lesson is about meaning, and it comes first: you can only say that storing a postcode as a number is wrong once you know that the postcode is a nominal identifier.
Data over time: cross-sections, time series and panels
Data also differ in how they relate to time, and this decides which questions they can answer.
- Cross-sectional data
- Many units observed at one point or in one period: every respondent’s answers to Lantern’s October survey, or every order placed on 14 November. It compares units with each other.
- Time-series data
- One unit observed at many points in time, in order: Lantern’s total web visits month by month. It shows how one thing changes, and reveals trends and seasons.
- Panel data
- The same units observed at several points in time: each customer’s spending in each month, or Lantern’s visits by channel by month. Also called longitudinal data. It shows how each unit changes.
Ana’s monthly summary is a time series if you add the channels together, and a small panel if you keep them apart: two units, web and app, followed for six months. Large official panels exist for the same reason. The US Bureau of Labor Statistics runs the National Longitudinal Surveys, in which the same sample of individuals is interviewed every year or every other year; its NLSY79 cohort has been interviewed regularly for over 40 years. Following the same people lets researchers see how each person’s working life changes, not only how averages move.
The distinction matters most when you compare periods. Two cross-sections taken a month apart, such as October’s orders and November’s orders, contain different customers buying different things. When their average changes, you can’t tell whether people changed or the mix of people changed. A panel, which follows the same units, separates the two most directly. The applied example below shows how much that can matter.
Primary and secondary data
Primary data is collected for the question at hand: Lantern’s October survey was designed to ask about September. Secondary data already exists because someone collected it for another purpose: the order export exists to run the shop, government statistics exist to describe the economy, a supplier’s price list exists to sell coffee. Most business analysis uses secondary data, much of it from the organisation’s own systems, because it is cheap, already there and complete for what it records.
Each has a typical weakness. Secondary data was defined by someone else, so its definitions may not match your question: a “visit” as the web-analytics tool counts it, an “order” that includes cancelled orders, a “customer” who is really an e-mail address. Primary data fits your question but costs time and money, and the way it is collected can bias it, which is the subject of the next lesson. A second, separate split is between internal data, from the organisation’s own systems, and external data, from outside it. The order export is internal secondary data; a national statistics office’s population figures are external secondary data.
| Source | Organisation | One row (or record) is | Time structure | Who collected it |
|---|---|---|---|---|
| Order export | Structured | One order | Cross-sectional for a month; a panel once rolled up by customer and month | Secondary, internal |
| App event log | Semi-structured | One event | A time-stamped log of events | Secondary, internal |
| October survey | Structured answers plus free-text comments | One respondent | Cross-sectional | Primary |
| Monthly summary | Structured | One month | Time series; a panel if kept by channel | Secondary, internal (built from the shop’s records) |
Formulas
Share of a category
- Observations in category kcount
- All observations with a recorded valuecount
Assumes. Valid at every level of measurement: for a nominal variable, shares and the mode are the only summaries there are.
Say what n is. A share of all orders and a share of the orders that were rated are different numbers.
Position of the median
- Number of observations, sorted from lowest to highestcount
Assumes. The values can be put in order, so the variable is at least ordinal.
When n is even the position falls between two observations. If they differ, the median lies between them; for ordinal data, say “between 4 and 5” rather than inventing a category of 4.5.
Mean of a rating scale from its counts
- Mean ratingstars
- A score on the scale, such as 1 to 5 starsstars
- Number of responses with score sresponses
Assumes. Treats the steps between scores as equal, which an ordinal scale doesn’t guarantee.
Report the counts, or at least the median and the share of low scores, alongside it.
Worked examples
Fictional figures
Ana’s survey software exports one row per respondent. The extract below shows five rows, invented for this example. Describe the dataset (its unit of observation, how it relates to time, and whether it is primary or secondary data), classify each column, and say which summary suits each one.
| respondent | channel | orders_sep | checkout_easy | recommend | comment |
|---|---|---|---|---|---|
| R017 | web | 1 | Agree | Yes | “Quick, once I found the pay button.” |
| R018 | app | 2 | Neutral | Yes | “I only use the app.” |
| R019 | web | 1 | Disagree | No | “Card page froze on my phone.” |
| R020 | web | 2 | Agree | Yes | |
| R021 | app | 1 | Agree | Yes | “Love the Ethiopia beans.” |
- Name the unit. One row is one respondent: a customer who ordered in September and answered. The answers were collected once, about one period, so the data is cross-sectional; Ana designed the survey for her question, so it is primary data.
- Classify the labels. respondent is an identifier: nominal, to be counted and matched, never averaged. channel (web or app) and recommend (yes or no) are nominal: categories with no order.
- checkout_easy has three ordered answers (disagree, neutral, agree) with no fixed distance between them, so it is ordinal. orders_sep counts orders, so it is numerical, discrete and ratio: a customer with 2 orders placed twice as many as one with 1.
- comment is unstructured text. Before it can be counted it has to be coded, for example into a topic variable (payment, product, delivery) with a written rule for each topic.
- Choose summaries. For channel and recommend, counts and shares: in these five rows 4 would recommend, . For checkout_easy, the count in each category and the median: 3 agree, 1 neutral and 1 disagree, so the median (the 3rd of 5 answers in order) is agree. For orders_sep the mean is fine: orders.
Answer. One row is one respondent; the data is cross-sectional and primary. respondent: a nominal identifier. channel and recommend: nominal. checkout_easy: ordinal. orders_sep: numerical, discrete, ratio. comment: unstructured text, to be coded before counting.
What it means. Describing the file already exposes a weakness of the survey: two of these five rows are app buyers, who were asked whether the website’s new checkout was easy to use. Because channel is kept as a variable, their answers can be looked at separately. The next lesson explains why that matters.
Fictional figures
Ridgeway Storage, a fictional company that installs home battery-storage systems, records for each installation: job_no (such as 40117); warranty tier (Bronze, Silver or Gold, coded 1, 2 and 3); battery capacity (5, 10 or 13.5 kWh); install_date; site temperature at installation in °C; and the customer’s satisfaction score from 1 to 5. A draft report makes six statements. Which are meaningful, and how should the others be rewritten? (a) “The average job number this spring was 40,212.” (b) “Gold customers have three times the cover of Bronze customers.” (c) “Our largest battery stores 2.7 times as much as our smallest.” (d) “Installers worked in twice the warmth in May: the average site temperature rose from 8 °C in March to 16 °C.” (e) “Gold customers are twice as satisfied as Bronze customers: an average score of 4 against 2.” (f) “Half of all customers gave a score of 4 or more.”
- Classify first. job_no is an identifier (nominal). Warranty tier is ordinal: Gold covers more than Silver and Silver more than Bronze, but the codes 1, 2 and 3 label the order; they are not amounts of cover. Capacity is ratio: 0 kWh means no storage. install_date and temperature in °C are interval. Satisfaction is ordinal.
- (a) averages an identifier, which is meaningless: delete it. The meaningful statement about jobs is how many there were.
- (b) divides ordinal codes: says nothing about cover. Rewrite it as an ordered statement (“Gold gives the most cover”), or compare the cover itself if it is measured, for example in years of warranty.
- (c) uses a ratio variable: . Meaningful as written.
- (d) divides interval values. The same temperatures are 46.4 °F and 60.8 °F, a ratio of , not 2: a ratio that changes when the scale changes was never meaningful. The difference is meaningful: °C warmer, which is the same warming as 14.4 °F.
- (e) treats ordinal averages as ratio values. Rewrite it as “Gold customers score higher on average”, with the medians or the distribution of scores. (f) is a statement about the median, which ordinal data supports: meaningful as written, provided it is true.
Answer. (c) and (f) are meaningful as written. (d) and (e) should be rewritten as a difference of 8 °C and as “higher”, with the distributions. (a) should go, because an identifier can’t be averaged, and (b) should be rewritten as an ordered statement, because tier codes can’t be divided.
What it means. Every statement rested on correct arithmetic, and four of them still said something empty or false. The level of measurement is the check that catches this before a report reaches a reader, who would otherwise remember “twice as satisfied” and act on it.
Fictional figures
In her November review Ana sees that the shop’s average order value rose from $42.10 in October to $47.90 in November. She wonders whether her regular customers have started spending more per order; if they have, she will widen the range of premium coffees. Besides the monthly figures she has the order export, from which she can follow individual customers. The table shows five returning customers (fictional) who placed exactly one order in each month. What should she conclude?
| customer_id | October order ($) | November order ($) |
|---|---|---|
| C0141 | 41.50 | 41.50 |
| C0187 | 33.00 | 34.00 |
| C0216 | 46.00 | 44.50 |
| C0230 | 28.00 | 28.00 |
| C0252 | 55.00 | 56.00 |
- Compare the cross-sections. October’s orders and November’s orders are two cross-sections: different sets of customers buying different products. The average order rose by dollars.
- Look at the mix. Gift-box orders rose from 9 in October to 88 in November, and the Gift Box Trio, at $58, is the dearest item on Lantern’s price list. First-time buyers rose from 188 to 291. A higher average can come from new and different orders without any existing customer changing.
- Follow the same customers. The five customers form a small panel. Their orders averaged dollars in October and in November, a change of 10 cents: two spent a little more, one a little less and two exactly the same.
- Decide. On this evidence regular customers have not started spending more; the rise in the shop’s average is better explained by November’s gift-box buyers. Five customers are far too few to settle it, so before changing the range Ana should build the full panel from the order export: every customer who ordered in both months, with their order values side by side.
Answer. No, not on this evidence. The rise from $42.10 to $47.90 compares two different groups of orders, while the customers followed through both months changed by only $0.10 on average. Widening the premium range on the strength of the monthly average would respond to a change in the mix, not in the customers.
What it means. The same question, “are customers spending more?”, gets different answers from two cross-sections and from a panel, because only the panel holds the customers fixed. Whenever an average moves between periods, ask whether the people or things being averaged are the same ones.
Explore
Common mistakes
“It is written in digits, so it is a number.”
Order numbers, customer numbers, postcodes, phone numbers and survey codes are labels written with digits. Averaging them produces numbers that mean nothing, and storing them as numbers can destroy leading zeros. Apply the adding test: if adding two values would mean nothing, the variable is categorical.
“The average rating tells the whole story.”
A rating is ordinal, so its mean assumes equal steps between stars, and very different months can share a mean: 10 three-star, 20 four-star and 10 five-star ratings average 4.0, and so do 10 one-star and 30 five-star ratings. Report the counts, or at least the median and the share of low ratings, with any average.
“Each row is a customer.”
Each row is whatever the unit of observation is: an order, an event, a respondent, a month. Counting rows of the order export counts orders, not customers, and averaging the rows of a monthly summary gives the average month. Finish the sentence “one row is one ___” before you count or average.
“Unstructured data can’t be analysed.”
It can, once it is coded into variables: comments into topics, photos into “damaged or not”. What it can’t do is count itself. Coding needs written rules and a check that two people apply them the same way, because the resulting variable is only as good as the rules.
“The average went up, so customers spent more.”
Comparing two periods’ averages compares two cross-sections, which may contain different customers buying different things. A change in the mix can move the average while no individual changes. To learn how the same customers changed, follow them in a panel.
“Secondary data is second-rate data.”
Most business analysis rightly uses secondary data: it is cheap, already there and often complete. Its risk is that someone else defined it for another purpose, so read its definitions (what counts as a visit, an order, a customer) before relying on it.
Guided practice
Work through these with hints when you need them. Every hint and every worked solution is there to be used.
Loading four questions…
On your own
No hints this time. Answer, check, and read the feedback; the solution appears once you have answered or if you ask for it. Your first answers count toward mastery.
Loading six questions…
In practice
Analysts usually begin a project with a data inventory: a list of every source that might help, described in exactly the terms of this lesson. Here is one drawn up for Ridgeway Storage, the fictional battery installer from the worked examples, whose operations manager wants to know why some batteries fail in their first year.
| Source | Organisation | One record is | Time structure | Who collected it |
|---|---|---|---|---|
| Job records from the scheduling system | Structured | One installation | Cross-sectional | Secondary, internal |
| Battery readings (charge and temperature) sent every 15 minutes | Semi-structured messages | One reading from one battery | Panel: many batteries, many times | Secondary, internal |
| Technicians’ visit notes | Unstructured text | One visit | Cross-sectional | Secondary, internal |
| Daily weather records from a national weather service | Structured | One weather station on one day | Panel | Secondary, external |
| A follow-up call to 50 customers whose batteries failed | Structured answers plus comments | One customer | Cross-sectional | Primary |
The inventory shapes the analysis before any calculation. The question is about batteries, so the analyst makes the battery the unit and plans to bring every source to it. The job record supplies the install date and the battery model, a nominal variable. The readings, summarised to one row per battery per day, become a panel of daily maximum temperatures; these are in degrees Celsius, an interval scale, so the report will say “8 °C hotter”, never “twice as hot”.
The visit notes are coded into a categorical variable, fault type, with a written rule for each code and a second analyst checking a sample of the coding. Battery serial numbers, long strings of digits, are kept as text, so that none loses a leading zero when the files are joined.
The inventory also shows what is missing and what is borrowed. No source records how each household uses its battery, so the analyst adds two questions about it to the follow-up call: primary data, collected because the secondary data can’t answer. The weather records are external and defined by someone else, so the analyst reads their documentation to learn where each station is and what its daily maximum means, because a station many kilometres away may not describe a garage wall in the sun.
The same habit pays off in very different businesses. A hotel’s revenue manager knows that the booking file has one row per booking while the occupancy report has one row per room per night, and converts one to the other before comparing them. A university’s planning office knows that a module-feedback survey is a cross-section of the students who answered, while its records of grades follow the same students for years, a panel in which the students who experienced a change in teaching can be followed before and after it.
Ana does the same, on a smaller scale, at the start of each monthly review. Her monthly summary is a time series; the survey is a one-off cross-section of September’s buyers; the order export can be rolled up into a panel of customers by month whenever she needs to know whether individual customers are changing. A few minutes spent describing the data saves her from averaging an identifier, from calling a mean of star ratings the whole story, and from reading a change in the mix of customers as a change in the customers themselves.
Knowledge check
Six questions, one attempt each, no hints. Score 80% or more to complete the lesson; you can take it again at any time.
Loading six questions…
Summary
- Structured data fits rows and columns with the same fields for every record; semi-structured data labels its parts without a fixed table (JSON, e-mail); unstructured data (text, images, audio) must be coded into variables before it can be counted.
- Rows are observations and columns are variables. The unit of observation is what one row describes; every count, total and average is per unit.
- Categorical variables are nominal (no order) or ordinal (ordered); numerical variables are discrete (counted) or continuous (measured).
- Stevens’s levels say which statements are meaningful: equality (nominal), order (ordinal), differences (interval), ratios (ratio). Averaging a rating is common but hides its shape; report the distribution too.
- Identifiers and codes are labels written with digits: count and match them, never calculate with them.
- Cross-sectional data compares units at one time, a time series follows one unit over time, and panel data follows the same units over time. A panel separates a change in individuals from a change in the mix most directly.
- Primary data is collected for the question; secondary data is reused from another purpose. Check secondary data’s definitions before relying on it.
Key formulas
Terms introduced
- Structured data
- Data organised in a fixed layout of rows and columns in which every record has the same fields, such as an order export or a database table.
- Semi-structured data
- Data that labels its parts, such as the named fields of a JSON record or an e-mail’s headers, without forcing every record into the same columns.
- Unstructured data
- Data with no predefined data model, such as free text, images, audio and video, which must be coded into variables before it can be counted.
- Dataset
- A collection of values organised so that each value describes one characteristic of one thing; usually a table of rows and columns.
- Observation
- One row of a dataset: all the values recorded for one instance of the unit of observation. Also called a record.
- Variable
- One column of a dataset: a characteristic recorded for every observation. Also called a field or an attribute, and in machine learning a feature.
- Unit of observation
- The kind of thing one row describes, such as an order, an order line, a booking or a student.
- Categorical variable
- A variable whose values place each observation in a group, such as channel, product or a survey answer. It is nominal or ordinal.
- Numerical variable
- A variable whose values are amounts found by counting or measuring, such as visits, packs ordered or an order total. It is discrete or continuous.
- Nominal variable
- A categorical variable whose categories have no natural order, such as region or product. Supports equality, counts and the mode.
- Ordinal variable
- A categorical variable whose categories have a meaningful order but no fixed distance between them, such as a 1–5 rating. Also supports the median and percentiles.
- Interval variable
- A numerical variable on which differences are meaningful but zero is an arbitrary point, so ratios are not, such as a calendar date or a temperature in °C.
- Ratio variable
- A numerical variable with a true zero meaning “none”, so differences and ratios are both meaningful, such as quantity, price or nights stayed.
- Discrete variable
- A numerical variable that takes separate values with gaps between them, usually a count, such as packs ordered.
- Continuous variable
- A numerical variable that can take any value within a range, at least in principle, usually a measurement such as weight or time.
- Level of measurement
- The classification of a variable as nominal, ordinal, interval or ratio (Stevens, 1946), according to which comparisons between its values are meaningful.
- Identifier
- A value whose job is to say which thing a row describes, such as an order number, customer number or postcode. It may be written with digits but is never an amount.
- Cross-sectional data
- Data on many units at one point or in one period of time, such as every respondent’s answers to one survey.
- Time-series data
- Data on one unit at many points in time, kept in time order, such as a shop’s visits month by month.
- Panel data
- Data on the same units at several points in time, such as each customer’s spending in each month. Also called longitudinal data.
- Primary data
- Data collected for the question at hand, such as a survey designed to answer it.
- Secondary data
- Data that already exists because it was collected for another purpose, such as transaction records or official statistics, reused for a new question.
Sources
- Illowsky, B. & Dean, S. (2023). Introductory Statistics 2e, sections 1.2 “Data, Sampling, and Variation in Data and Sampling” and 1.3 “Frequency, Frequency Tables, and Levels of Measurement”. OpenStax. openstax.org/books/introductory-statistics-2e/pages/1-3-freq…
- Ault, S. V., Nam Liao, S. & Musolino, L. (2025). Principles of Data Science, section 1.3, “Data and Datasets”. OpenStax. openstax.org/books/principles-data-science/pages/1-3-data-an…
- Stevens, S. S. (1946). On the theory of scales of measurement. Science, 103(2684), 677–680. doi.org/10.1126/science.103.2684.677
- Velleman, P. F. & Wilkinson, L. (1993). Nominal, ordinal, interval, and ratio typologies are misleading. The American Statistician, 47(1), 65–72.
- US Bureau of Labor Statistics. Handbook of Methods: “National Longitudinal Surveys: Data sources”. bls.gov/opub/hom/nls/data.htm
