Statistics for
Data Science 1
Introduction and types of data: what statistics is, how data are organised, and how to classify them.
Chapters
- 01Course OverviewCourse overview
- 02Introduction to StatisticsLecture 1.1
- 03Understanding DataLecture 1.2
- 04Classification of DataLecture 1.3
- 05Scales of MeasurementLecture 1.4
- 06Week 1 Summary SheetAll lectures
Based on lectures by Usha Mohan, IIT Madras
Course Overview
Statistics for Data Science 1 is an introductory course in statistics for beginners. You learn to create and handle data sets and to summarise them using graphical and numerical techniques. Then the idea of uncertainty is introduced, and probability is used as the tool to handle it. The course ends with random variables, with a detailed look at the Binomial and Normal distributions.
1.1Course objectives
- Create, download and manipulate data sets.
- Learn methods for presenting and describing sets of data, and select an appropriate graphical technique for a given scenario.
- Learn measures that summarise a data set, and use the appropriate numerical summary for a given question.
- Understand uncertainty through probability: random experiment, events, probability and conditional probability; and random variables, both discrete (in particular Binomial) and continuous (in particular Normal).
1.2Road map
The twelve weeks fall into three stages. Each stage builds on the one before: you first learn to describe data, then to reason about chance, and finally to model chance with random variables.
Numerical summaries
Conditional probability
Continuous: Normal
1.3Week-wise schedule
Each week is set up by a question that the data from the admissions office can answer. The last column lists that question.
| Week | Topic | A question it sets up |
|---|---|---|
| 1 | Introduction | Identify the variables and observations in a data set |
| 2 | Describing categorical data: one variable | What is the proportion of women and of men? How many students come from each board? |
| 3 | Describing numerical data: one variable | What are the average marks? How much do marks vary? Least and highest marks? |
| 4 | Association between two variables | Do high scorers in Class 10 also score high in Class 12? |
| 5 | Permutations and combinations | In how many ways can a committee of 3 be formed from 10 people? |
| 6 to 7 | Probability | What are the chances of a student getting a top grade? |
| 8 to 9 | Discrete random variables | What is the chance that a random student has 2 siblings? |
| 10 | Binomial distribution | Chance of exactly 5 correct answers out of 25 by guessing? |
| 11 to 12 | Continuous distributions and the Normal distribution | Chance that a student needs more than 45 minutes for a test? |
1.4Running example: university admissions
XYZ university has just completed admissions to its undergraduate programme. Every admitted student fills in a form and the information is tabulated. A portion of the data collected by the admissions office is shown below. We will keep coming back to this table.
| S.No | Name | Gender | Date of birth | Marks in Class 10 | Board (Class 10) | Marks in Class 12 | Board (Class 12) | Mobile number |
|---|---|---|---|---|---|---|---|---|
| 1 | Anjali | F | 17-Feb-03 | 484 | State Board | 394 | CBSE | xxx7252826 |
| 2 | Pradeep | M | 03-Jun-02 | 514 | ICSE | 437 | ICSE | xxx5243748 |
| 3 | Varsha | F | 02-Mar-01 | 527 | CBSE | 442 | CBSE | xxx5242824 |
| 4 | Divya | F | 22-Mar-03 | 397 | State Board | 401 | State Board | xxx6546889 |
| 5 | Thomas | M | 19-Dec-02 | 562 | CBSE | 451 | CBSE | xxx4242736 |
| 6 | Sarita | F | 19-May-02 | 533 | ICSE | 462 | ICSE | xxx5242577 |
| 7 | Prashant | M | 30-Oct-01 | 496 | CBSE | 413 | CBSE | xxx3352630 |
| 8 | Harsha | M | 11-Feb-01 | 436 | CBSE | 375 | CBSE | xxx1702736 |
1.5Week 1 learning objectives
- What is statistics? Descriptive and inferential statistics; population versus sample. (Lecture 1.1)
- How data are collected. Identify variables and cases (observations) in a data set. (Lecture 1.2)
- Types of data. Categorical versus numerical, cross-sectional versus time-series, and measurement scales. (Lectures 1.3 and 1.4)
- Creating data sets, downloading and manipulating them, working on subsets, and framing questions that data can answer. These two objectives are listed in the course slides but are not part of the lectures used for these notes.
1.6What to expect from Week 1
Week 1 has almost no calculation. Nearly every question asks you to classify something. Five question types cover almost everything, and each one is handled in one chapter below.
| Question type | What you must decide | Chapter |
|---|---|---|
| Descriptive or inferential? | the purpose of the study | 2 |
| Population or sample? | whom the conclusion is about, and who was actually measured | 2 |
| Cases and variables | what one row stands for, and the table size | 3 |
| Categorical or numerical; cross-sectional or time series | is a label or a measurement; one time or over time | 4 |
| Scale of measurement | nominal, ordinal, interval or ratio | 5 |
The only calculations in Week 1 are a proportion (count ÷ total), the table size , a unit conversion, and the Celsius to Fahrenheit formula.
1.7How to study this week
- Answer a classification question as label + one-line reason. The reason shows you understood, and it protects you when the label is debatable.
- Learn the short definitions (statistics, population, sample, case, variable, the four scales) almost word for word.
- Test yourself on the admissions table: for every column say categorical or numerical, and for the numerical ones the unit.
- Use the Chapter 6 answer templates for the last-minute revision.
Handle data, summarise it, then study uncertainty
Describe data: graphs and numbers
Understand uncertainty: probability
Numerical summaries
Association between variables
Conditional probability
Discrete: Binomial
Continuous: Normal
Variables and cases
Types of data and scales
Introduction to Statistics
Before collecting or describing anything we need two ideas: what statistics is for, and the difference between the group we care about and the part of it we actually look at.
2.1What is statistics?
The word "art" is a hint that statistics is not only calculation: choosing what to collect and how to read it matters just as much.
2.2Two branches of statistics
Descriptive statistics
The part of statistics concerned with the description and summarisation of data.
Inferential statistics
The part of statistics concerned with the drawing of conclusions from data.
2.3Population and sample
Suppose we want to know any of the following.
| We want to know | The population is | A sample could be (illustration) |
|---|---|---|
| Percentage of all students in India who passed Class 12 and study engineering | Every student in India who passed Class 12 and studies engineering | A few thousand such students surveyed |
| Prices of all houses in Tamil Nadu | Every house in Tamil Nadu | A few hundred houses whose prices are collected |
| Total sales of all cars in India in 2019 | Every car sold in India in 2019 | Sales records of some dealerships |
| Age distribution of people who visit a city mall in a month | Everyone who visits the mall that month | Ages noted for some visitors on some days |
Population
The total collection of all the elements that we are interested in.
Sample
A subgroup of the population that will be studied in detail.
If the population has elements and the sample has , then every sample satisfies . We usually cannot measure the whole population, which is why we study a sample.
2.4Purpose of statistical analysis
- If the purpose is to examine and explore information for its own intrinsic interest only, the study is descriptive.
- If the information is obtained from a sample of a population and the purpose is to draw conclusions about the population, the study is inferential.
- A descriptive study may be performed either on a sample or on a population.
- Only when an inference is made about the population, based on information from the sample, does the study become inferential.
2.5Going deeper: population, sample and inference
- Find the population from the question. The population is the group the conclusion is about. The sample is the part that was actually measured. If you measured everyone the conclusion is about, there is no sample, and the study is descriptive on a population.
- Why study a sample at all? Reaching every element is often too costly, too slow or impossible (every house in a state, every car sold in a year).
- The sample must represent the population. The lecture does not cover how to pick a sample, but remember the idea: a sample that leaves out part of the population can mislead, and inference carries a chance of error (this is why probability comes later).
- The same numbers can be used in two ways. The Class 12 marks of the 8 students in the admissions table add up to 394 + 437 + 442 + 401 + 451 + 462 + 413 + 375 = 3375, so the average is . Saying "these 8 students averaged 421.875" is descriptive. Saying "admitted students at the university average about 421.9" is inferential.
Words that hint at the type
| Phrase in the question | Usually means |
|---|---|
| summarise, report, list, find the highest and lowest | Descriptive |
| estimate, predict, conclude about all, generalise | Inferential |
These words are only hints. The final test is always the purpose: does the statement go beyond the data in hand?
2.6Exam tips and common mistakes
- Underline the group the conclusion is about: that is the population. Compare it with who was measured: that is the sample.
- Same group in both places means no sample: descriptive on a population.
- Remember . A sample is never larger than its population.
- Write the reason: "inferential, because the sample is used to conclude about ..." or "descriptive, because it only summarises ...".
- Calling every study that uses a sample inferential. Describing the sample alone is descriptive.
- Thinking descriptive statistics needs the whole population. It can be done on a sample too.
- Mixing up the two sizes: population is , sample is .
- Treating an inference as certain. It can be wrong, because it must allow for chance.
Practice questions (graded-assignment style)
Multiple Choice Question (MCQ): choose the one correct option.
A survey of 800 voters is used to estimate the share of all 2 million voters who support a party. The study is
The purpose decides the type: does the conclusion go beyond the data in hand?
- The 800 voters are a sample and the conclusion is about all 2 million voters.
- Using a sample to conclude about the population is inferential.
- Answer: option 3.
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements.
A sample is a subgroup of the population.
- Option 1 is correct: a subgroup cannot be bigger than the whole.
- Option 2 is wrong: a descriptive study may be done on a sample or on a population.
- Option 3 is correct.
- Option 4 is wrong for the same reason as option 1.
- Answer: options 1 and 3.
Numerical Answer Type (NAT).
In a sample of 250 students, 95 prefer online classes. What percentage of the sample prefers online classes?
Proportion = count ÷ total, then multiply by 100.
- 95 ÷ 250 = 0.38.
- 0.38 × 100 = 38%.
- Answer: 38
Multiple Choice Question (MCQ): choose the one correct option.
The average Class 12 marks of 8 admitted students is reported as "the average of all students admitted this year". This claim is
Look at the claim, not at the numbers.
- Saying "these 8 students averaged 421.875" would be descriptive.
- Claiming it for all admitted students goes beyond the data, which is inferential.
- Answer: option 2.
Description of data
Analysis, then conclusions
Sample or population
No conclusion beyond the data
Sample to population
Needs probability (chance)
Size N
Size n, with n at most N
Conclude about population: inferential
Understanding Data
Statistics works on data, so the first job is to understand what data are, where they come from, and how to lay them out so that they can be used.
3.1What is data?
To learn something we need to collect data. Statistics relies on data, the information that is all around us.
3.2Why do we collect data?
We are interested in the characteristics of some group or groups of people, places, things or events. For example:
- To know about the temperatures in a particular month in Chennai, India.
- To know about the marks obtained by students in their Class 12.
- To know how many people like a new song, product or video, collected through comments.
3.3Data collection
Use published data.
We need to collect or generate the data ourselves.
3.4Unstructured and structured data
For the information in a database to be useful, we must know the context of the numbers and text it holds. When they are scattered about with no structure, the information is of very little use. Hence we need to organise data.
"Anjali, a girl born on 17 Feb 2003, got 484 in Class 10 from the State Board and 394 in Class 12 from CBSE. Pradeep, a boy, born 3 Jun 2002 ..."
The same facts placed in a table where every column has a name and every row is one student, like the admissions table in Topic 1.
3.5Variables and cases
- Case (observation): a unit from which data are collected.
- Variable:
- Intuitively, a variable is something that varies.
- Formally, it is a characteristic or attribute that varies across all units.
- In our school data set the case is each student, and the variables are name, marks obtained, board and so on.
- Rows represent cases: for each case, the same attributes are recorded.
- Columns represent variables: for each variable, the same type of value is recorded for every case.
A table with cases and variables has rows and columns, so it holds data values.
3.6Going deeper: rows, columns and missing values
- A case is whatever one row stands for. It depends on the data set: a student in the admissions table, a comment in the video data, a day in the potato data. Decide this first and the rest follows.
- A variable is what is recorded for each case. Even S.No is a column, so it is a variable (an identifier), though we would never average it.
- A data value is one cell. cases and variables give values. The header row names the variables; it is not a case.
- A well-organised table passes three checks: every column has a name and holds one kind of thing; every row is one case; every cell holds one value (not "Anjali, F, 484").
- Missing is not zero. In the potato table, 04-Mar shows quantity 0 and cost NA. No potatoes were bought, so there is no cost to report. Writing 0 would claim the potatoes were free and would pull any average down. NA means "not available".
3.7How data are collected: sources, sampling methods and bias
Section 3.3 says that when the data are not available we must collect them. How we collect them decides whether we can trust what we conclude. This section covers the standard vocabulary.
A. Primary and secondary data
- Primary data are collected first-hand for the question at hand (your own survey, experiment or measurements).
- Secondary data were collected by someone else for another purpose and are reused: published reports, government statistics, existing databases.
B. Census and sample survey
| Census | Sample survey | |
|---|---|---|
| Who is measured | every unit of the population () | a subset of the population () |
| Strength | no sampling error | cheaper, faster; the only option if measuring destroys the unit |
| Weakness | costly and slow; impossible when measuring destroys the unit (testing the lifetime of light bulbs) | sampling error, and bias if the sample is chosen badly |
C. Observational study and experiment
- Observational study: the researcher only records what happens (compare the marks of students who sleep 8 hours with those who sleep 5). No treatment is imposed.
- Experiment: the researcher assigns a treatment (for example one group gets a new teaching method, the control group gets the usual one) and compares the outcomes. Assigning units to groups at random makes the groups comparable.
- Only a well-designed experiment can support a cause-and-effect claim. In an observational study a confounding variable (a hidden factor linked to both) can create a false link: ice-cream sales and drowning both rise in summer, but ice cream does not cause drowning.
D. Sampling methods
| Method | How it works |
|---|---|
| Simple random sampling | Every possible sample of size is equally likely (a lottery from a full list). Every unit has the same chance . |
| Systematic sampling | Pick a random start, then every -th unit, where . With and , . |
| Stratified sampling | Split the population into similar groups (strata), then take a random sample from each. With proportional allocation the sample from stratum is . Strata of 500, 300 and 200 with : . |
| Cluster sampling | Split the population into groups (clusters, each a mini-population, such as classrooms), pick some clusters at random and study every unit in them. |
| Convenience / voluntary response | Whoever is easy to reach, or whoever chooses to reply. Not random, so usually biased. |
Stratified versus cluster. Stratified: all groups are used and a few units are taken from each. Cluster: a few groups are used and all units are taken from each.
E. Bias
Bias is a systematic error that pushes the result in one direction. The usual sources:
- Selection bias: part of the population has no chance of being chosen (a phone survey that dials only landlines misses people with mobiles only).
- Voluntary-response bias: people with strong opinions are the ones who reply (online polls, call-in shows).
- Non-response bias: the chosen people who do not answer differ from those who do.
- Measurement (response) bias: a leading question or a faulty instrument distorts the answers.
F. Parameter and statistic
- A parameter is a number that describes the population (the mean of all students, ; the population size, ). It is fixed, usually unknown.
- A statistic is a number computed from a sample (the sample mean ; the sample size ). It changes from sample to sample.
- We use statistics to estimate parameters. The difference is the sampling error, the unavoidable chance difference between a sample and the population. Non-sampling errors (bias, wrong recording, non-response) can occur even in a census.
3.8Exam tips and common mistakes
- For any data description, first ask: what does one row represent?
- Count dimensions as rows × columns = cases × variables, without the header row.
- The fix for a badly organised table is always the same two rules: one variable per column, one case per row.
- Counting the header row as a case.
- Mixing up case and variable: a student is a case, "marks" is a variable.
- Spreading one case over two rows, or putting two variables in one column.
- Treating NA as 0.
Practice questions (graded-assignment style)
Numerical Answer Type (NAT).
A table records 6 variables for each of 40 students. How many data values does it hold?
n cases and k variables give n × k values.
- 40 × 6 = 240.
- The header row names the variables and is not counted as a case.
- Answer: 240
Multiple Choice Question (MCQ): choose the one correct option.
A table has a header row, then 25 rows of students, and 4 columns. How many cases are there?
Each row of data is one case. The header row is not.
- 25 student rows give 25 cases.
- 100 would be the number of data values (25 × 4), not cases.
- Answer: option 2.
Multiple Choice Question (MCQ): choose the one correct option.
Which layout breaks the rule "each variable must have its own column"?
Three variables should not share one column.
- Option 2 packs name, gender and marks into a single column.
- The other three layouts follow the tidy-table rules.
- Answer: option 2.
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements about NA.
Missing is not zero.
- Option 1 is correct.
- Option 2 is wrong: 0 is a real value, NA means no value exists.
- Option 3 is correct: a false 0 enters the average.
- Option 4 is correct: nothing was bought, so there is no cost.
- Answer: options 1, 3 and 4.
Multiple Choice Question (MCQ): choose the one correct option.
A school lists its 1,200 students in alphabetical order, picks a random starting position among the first 30, and then takes every 30th student. This is
"Random start, then every -th unit" is the signature of systematic sampling.
- gives a sample of students.
- Not simple random sampling: only 30 different samples are possible, not every group of 40. Not stratified or cluster: no groups were formed.
- Answer: option 2.
Numerical Answer Type (NAT).
A college has 1,000 students: 500 in Science, 300 in Commerce and 200 in Arts. A stratified sample of 100 students is taken with proportional allocation. How many come from Commerce?
Each stratum is represented in proportion to its size: .
- Commerce: .
- Check: ✓ (Science 50, Arts 20).
- Answer: 30
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements.
Statistic goes with sample, parameter goes with population; bias comes from the method, not from the size.
- 1 ✓ That is the definition of a census.
- 2 ✗ People who choose to reply still differ from those who do not; more responses repeat the same bias.
- 3 ✓ Randomisation makes the groups comparable, so a difference in outcome can be attributed to the treatment.
- 4 ✗ That is a parameter. A statistic describes a sample.
- 5 ✓ is computed from a sample.
- Answer: options 1, 3 and 5.
Multiple Choice Question (MCQ): choose the one correct option.
A company wants the average lifetime of the light bulbs in a batch of 10,000. It burns each tested bulb until it fails. Which approach is sensible?
If measuring destroys the unit, a census would leave nothing to sell, so use a sample, and make it random.
- Option 1 would burn out the whole batch. Options 3 and 4 are voluntary-response and convenience sampling: biased.
- Answer: option 2.
Numerical Answer Type (NAT).
A systematic sample of size 40 is to be drawn from a population of 1,200. What is the sampling interval ?
.
- .
- Answer: 30
e.g. temperatures, Class 12 marks
Not available: collect or generate it
We assume it is available
Unstructured data is of little use
So we organise it into a table
Variable: attribute that varies across the units
Columns are variables
One variable per column, one case per row
Classification of Data
Once data are in a table, we classify each variable. The kind of variable decides which summaries and graphs make sense, so this classification comes before almost everything else in the course.
4.1Categorical and numerical variables
- Also called qualitative variables.
- Identify group membership.
- Also called quantitative variables.
- Describe numerical properties of cases.
- Have measurement units.
4.2Measurement units
A measurement unit is the scale that defines the meaning of numerical data, such as weights measured in kilograms, prices in rupees, heights in centimetres.
4.3Cross-sectional and time-series data
- Time series: data recorded over time.
- Cross-sectional: data observed at the same time.
Time-series example from the lecture
The lecture shows a daily record of potatoes, with the quantity (kg), the cost (Rs.) and the selling price (Rs.) for each date in March. The first rows look like this.
| Date | Qty (kg) | Cost (Rs.) | Selling price (Rs.) |
|---|---|---|---|
| 01-Mar | 0 | 21 | 24 |
| 02-Mar | 1350 | 20.05 | 24 |
| 03-Mar | 675 | 20.5 | 24 |
| 04-Mar | 0 | NA | NA |
| 05-Mar | 675 | 20.8 | 24 |
Every row is a different date for the same item, so this is a time series. NA means the value is not available.
4.4How to classify a data set
- Classify each variable as categorical or numerical.
- For numerical data, find out the unit of measurement.
- Check whether the data are collected at a point of time (cross-sectional) or over time (time series).
4.5Going deeper: telling the types apart
- Categorical or numerical? Ask: does an average make sense? Mobile number, PIN code, roll number and S.No are all made of digits, but averaging them means nothing, so they are categorical labels. Marks, price and height can be averaged, so they are numerical.
- Categorical does not mean text, and numerical does not mean digits. The look of the value does not decide the type; its meaning does.
- Every numerical variable has one unit. Write it down (marks, kg, Rs., cm). If entries use different units, convert first: 1 lb = 0.4536 kg, 1 m = 100 cm, 1 ft = 30.48 cm.
- Cross-sectional or time series? Ask what each row is. Different people or items at one time: cross-sectional. The same item on different dates: time series.
- The shuffle test. Shuffle the rows. If no information is lost, the data are cross-sectional. If the order matters (earlier to later), they are a time series.
Quick classification
| Variable | Type | Why |
|---|---|---|
| Board of Class 12 | Categorical | names a group |
| Marks in Class 10 | Numerical (marks) | a measurement |
| Mobile number | Categorical | a label made of digits |
| PIN code | Categorical | a label made of digits |
| Price | Numerical (Rs.) | can be added and averaged |
| Height | Numerical (cm) | a measurement with a unit |
4.6Discrete and continuous numerical variables
Numerical variables split once more, and this split decides which graphs and summaries come later in the course.
- Discrete: the possible values can be listed or counted one by one, with gaps between them. Usually the variable is a count: number of siblings, number of defective items, number of goals.
- Continuous: the variable can take any value in an interval, with no gaps. Usually it is a measurement: height, weight, time, temperature, rainfall.
Counted means discrete, measured means continuous. Between any two heights, such as 170 cm and 171 cm, there are infinitely many possible heights; between 2 siblings and 3 siblings there is nothing.
| Variable | Type | Why |
|---|---|---|
| Number of defective bulbs in a box of 50 | numerical, discrete | a count: |
| Time taken to run 100 m | numerical, continuous | measured; any value such as s |
| Marks out of 500, whole numbers only | numerical, discrete | only whole-number values occur |
| Mobile number, PIN code, roll number | categorical (label) | digits, but averaging them means nothing |
| Satisfaction rating 1 to 5 | categorical, ordinal | ordered labels; the gaps between ratings are not guaranteed equal |
Two cautions. (1) A variable that is continuous in principle is often recorded to a fixed precision (weight in whole kilograms, age in completed years); the underlying quantity is still continuous. If a question says the values are whole numbers only, treat it as it is stated. (2) Do not call a variable numerical just because it is written with digits: ask can it be meaningfully added or averaged? If not, it is a label.
The whole classification tree. Variable categorical (nominal, ordinal) or numerical (discrete, continuous); and, for numerical variables, the scale of measurement is interval or ratio.
4.7Exam tips and common mistakes
- For a numerical variable always state the unit; for a categorical one say "no unit".
- For cross-sectional versus time series, look at what the rows are, not at the columns.
- Give the three-step answer: categorical or numerical, unit, and one time or over time.
- Calling a mobile number, PIN code or roll number numerical because it is made of digits.
- Calling the admissions table a time series because it has a Date of birth column. Its rows are different students at one time, so it is cross-sectional.
- Leaving mixed units in one column (kg with lb, cm with m).
Practice questions (graded-assignment style)
Multiple Select Question (MSQ): select all that apply.
Choose all the categorical variables.
Ask: does an average make sense? Digit labels such as PIN code and roll number are still labels.
- PIN code, blood group and roll number identify groups or individuals, so they are categorical.
- Height (cm) and price (Rs.) are measurements with a unit, so they are numerical.
- Answer: options 1, 3 and 5.
Multiple Choice Question (MCQ): choose the one correct option.
A table gives the closing price of one stock on each trading day of a month. The data are
One item, rows are different dates.
- The same item is recorded again and again over time, so it is a time series.
- Categorical and nominal describe variable types, not how the data were collected.
- Answer: option 2.
Numerical Answer Type (NAT).
Convert 5 ft to centimetres (1 ft = 30.48 cm).
Multiply by the conversion factor so the column has one unit.
- 5 × 30.48 = 152.4.
- So 5 ft = 152.4 cm.
- Answer: 152.4
Multiple Choice Question (MCQ): choose the one correct option.
The admissions table has a "Date of birth" column. Which classification of the table is correct?
Look at what the rows are, not at the columns.
- Each row is a different student, all recorded at one point in time.
- A date of birth is just a variable, not a record of the same case over time.
- Answer: option 2.
Multiple Select Question (MSQ): select all that apply.
Which of these variables are continuous?
Counted means discrete; measured means continuous.
- 1 ✓ measured. 2 ✗ counted. 3 ✓ measured. 4 ✗ counted (whole runs). 5 ✓ measured.
- Answer: options 1, 3 and 5.
Multiple Choice Question (MCQ): choose the one correct option.
The PIN codes of the delivery addresses in a data table are best classified as
Can the values be meaningfully added or averaged? An average PIN code is nonsense, so the digits are a label.
- PIN codes identify an area (group membership) and have no measurement unit. "Time series" describes how the data are recorded, not the type of a variable.
- Answer: option 3.
Numerical Answer Type (NAT).
A table has the variables: gender, board (CBSE/ICSE/State), marks in Class 12 (out of 500, whole numbers), height in cm, number of siblings, and mobile number. How many of them are numerical?
Numerical means a measured or counted quantity with a unit; labels are categorical, even when written in digits.
- Gender: categorical. Board: categorical. Mobile number: categorical (a label).
- Marks (discrete), height (continuous), number of siblings (discrete): numerical.
- Answer: 3
Identifies group membership
e.g. Gender, Board
Describes numerical properties
Has a measurement unit
kg, rupees, centimetres
One variable, one common unit
Many cases, one point in time
Unit of measurement?
One time or over time?
Scales of Measurement
Data collection uses one of four scales of measurement: nominal, ordinal, interval or ratio. The scale tells us what we are allowed to do with the values. Each scale has all the properties of the one before it, plus one more.
5.1Nominal scale
- The data are labels or names used to identify the characteristic of an observation.
- Examples: name, board, gender, blood group.
- Nominal variables are sometimes numerically coded. For example, we might code men as 1 and women as 2, or men as 3 and women as 1. Both codes are valid.
- There is no ordering in the variable.
5.2Ordinal scale
- The data have the properties of nominal data, and the order or rank of the data is meaningful.
- Example: each customer who visits a restaurant rates the service as excellent, good or poor. The values are labels, as in nominal data. In addition they can be ranked with respect to service quality.
5.3Interval scale
- The data have all the properties of ordinal data, and the interval between values is expressed in terms of a fixed unit of measure.
- Interval data are always numeric. We can find the difference between any two values.
- Ratios of values have no meaning, because the value of zero is arbitrary.
5.4Ratio scale
- The data have all the properties of interval data, and the ratio of two values is meaningful.
- Examples: height, weight, age, marks.
5.5Example: temperature
The same word, "temperature", can be measured on different scales depending on what is recorded.
- If the response to "how hot is the day?" is comfortable or uncomfortable, temperature is a nominal variable.
- If the temperature of a liquid is recorded as cold, warm or hot, the variable is ordinal.
- Temperature in degrees Celsius or Fahrenheit is an interval variable, since there is no absolute zero.
| Celsius | Fahrenheit | |
|---|---|---|
| Freezing point | 0 | 32 |
| Boiling point | 100 | 212 |
In an air-conditioned room set at 20 °C, with 40 °C outside, it is correct to say the difference in temperature is 20 °C, but it is incorrect to say that outdoors is twice as hot as indoors.
ratio: 40 ÷ 20 = 2
ratio: 104 ÷ 68 ≈ 1.53
5.6What each scale allows
| Scale | Names or labels | Order matters | Differences | Ratios | Meaningful comparisons |
|---|---|---|---|---|---|
| Nominal | ✓ | ✗ | ✗ | ✗ | =, ≠ |
| Ordinal | ✓ | ✓ | ✗ | ✗ | =, ≠, <, > |
| Interval | ✓ | ✓ | ✓ | ✗ | =, ≠, <, >, +, − |
| Ratio | ✓ | ✓ | ✓ | ✓ | =, ≠, <, >, +, −, ×, ÷ |
5.7Going deeper: choosing the scale
Do not guess the scale from how the value looks. Ask four questions in order and stop at the first yes.
| Question | If yes | Test |
|---|---|---|
| Are the values just names, with no order? | Nominal | can only say equal or different |
| Can they be ranked, but the gaps between ranks mean nothing? | Ordinal | can say better or worse |
| Numbers with a fixed unit, but is zero just a convention? | Interval | can subtract, cannot say "twice" |
| Does zero mean none of the quantity? | Ratio | can say "twice as much" |
- The zero test. Does 0 mean "none of it"? 0 marks means no marks scored (ratio). 0 °C does not mean no heat: the same point is 32 °F, so zero is just a convention (interval).
- The "twice" test. Would "twice as much" survive a change of unit? Rs. 400 is twice Rs. 200 in any currency unit. 40 °C is not twice 20 °C, as the Fahrenheit conversion showed.
- Why ordinal has no differences. Excellent, good and poor are ranked, but nobody knows that "excellent minus good" equals "good minus poor", so subtracting is meaningless.
- The scale depends on how it is recorded. Age as exact years (25) is ratio. Age as a group (young, middle-aged, senior) is ordinal. The temperature example in 5.5 shows the same idea.
- Numbers can hide a nominal scale. Gender coded 1 and 2, or a PIN code, are still nominal. A 1-to-5 satisfaction rating is ordinal: ordered labels, not equal steps.
- Beyond the lecture: temperature in kelvin has a true zero (no heat energy), so ratios are meaningful there. That is why only Celsius and Fahrenheit are the interval example.
5.8Exam tips and common mistakes
- Each scale includes the properties of the one before it. When asked "which scale?", give the most specific one that fits, with a one-line reason.
- Memorise the standard examples: nominal (gender, board, blood group), ordinal (service rating), interval (temperature in °C or °F), ratio (height, weight, age, marks).
- Use the table of allowed comparisons: nominal =, ≠; ordinal adds <, >; interval adds +, −; ratio adds ×, ÷.
- Calling any numerically coded variable numerical-scale. Codes 1 and 2 for gender are still nominal.
- Calling temperature in °C or °F a ratio variable, and saying "40 °C is twice as hot as 20 °C".
- Calling poor/good/excellent nominal. It has an order, so it is ordinal.
- Taking the mean of nominal codes. The answer depends on the arbitrary codes (1.5 or 2 for the same class).
Practice questions (graded-assignment style)
Multiple Choice Question (MCQ): choose the one correct option.
A restaurant rating of poor, good or excellent is on which scale?
Labels that can be ranked, but with no defined gaps.
- The values are labels, so it is at least nominal.
- They can be ranked, so it is ordinal. The gaps between ranks are not defined, so it is not interval.
- Answer: option 2.
Multiple Select Question (MSQ): select all that apply.
Choose the valid statements.
Ratios need a true zero. Differences need a fixed unit.
- Option 1: money is on a ratio scale.
- Option 2: °C is interval, so ratios have no meaning (2 in °C but about 1.53 in °F).
- Option 3: differences are meaningful on an interval scale.
- Option 4: gender is nominal, and the mean changes with the arbitrary codes.
- Answer: options 1 and 3.
Numerical Answer Type (NAT).
Use to convert 25 °C to °F.
Multiply by 9/5 and add 32.
- 9/5 × 25 = 45.
- 45 + 32 = 77 °F.
- Answer: 77
Multiple Choice Question (MCQ): choose the one correct option.
The calendar year of an event (2019, 2020, 2021 ...) is on which scale?
Differences make sense, but zero is only a convention.
- Year 0 does not mean "no time", so there is no true zero.
- Differences are meaningful (2021 is 2 years after 2019), so it is interval.
- Answer: option 3.
Multiple Choice Question (MCQ): choose the one correct option.
Which scale has a meaningful absolute zero, so that ratios make sense?
Ratio adds one property to interval.
- Ratio is interval plus a meaningful ratio of two values, which needs zero to mean "none".
- Answer: option 4.
no orderE.G.Gender, Board, Blood group
is meaningfulE.G.Service rating: poor, good, excellent
no absolute zeroE.G.Temperature in degrees C or F
is meaningfulE.G.Height, weight, age, marks
Week 1 Summary Sheet
Every topic of Week 1 on one sheet, lecture by lecture, for a last-minute revision.
Course overview
- Describe data (graphs, numbers) → handle uncertainty (probability) → random variables (Binomial, Normal).
- Data: Weeks 1–4 · Probability: Weeks 5–7 · Random variables: Weeks 8–12.
- Admissions table: 8 rows (cases) × 9 variables = 72 values. Class 12: highest Sarita (462), lowest Harsha (375).
- Week 1 aims: what statistics is, population and sample, data and tables, types of data, scales of measurement.
Lecture 1.1 · Introduction to Statistics
- The art of learning from data: collection → description → analysis → conclusions.
- Descriptive: describe and summarise data.
- Inferential: draw conclusions about a population; needs probability because of chance.
- Population (size ): all elements of interest. Sample (size ): subgroup studied in detail, .
- Inference goes from sample to population.
- The purpose, not the data, decides descriptive or inferential.
- Only summarising the sample → descriptive; saying something about the population → inferential.
Lecture 1.2 · Understanding Data
- Data: facts and figures collected, analysed and summarised.
- We collect it to learn about groups of people, places, things or events.
- Data available → use published data.
- Not available → collect or generate it. This course assumes data is available.
- Unstructured: facts scattered in text, of little use.
- Structured: a table with named columns, one row per case.
- Case: the unit data come from (a row). Variable: an attribute that varies (a column).
- One variable per column, one case per row; cases × variables = values.
Lecture 1.3 · Classification of Data
- Categorical (qualitative): group membership, no unit. e.g. gender, board, mobile number (digits, but only a label).
- Numerical (quantitative): numerical property with a unit. e.g. marks, weight (kg), price (Rs.).
- A numerical variable must share one common unit.
- Convert before mixing: 135 lb × 0.4536 ≈ 61.2 kg.
| Cross-sectional | Time series | |
|---|---|---|
| Cases | Many cases (students, houses, shops…) | One case (one item, one person) |
| Time | All recorded at one point in time | Recorded again and again over time |
| Each row is | a different person or item | a different date |
| Used to | compare cases with each other | see how one case changes |
| Example | Class 12 marks of 5 students: Anjali 394, Pradeep 437, Varsha 442… | Daily potato cost: Rs. 21 (1 Mar), Rs. 20.05 (2 Mar) … Rs. 21.25 (6 Mar) |
Spot it: rows are different people or items → cross-sectional; rows are different dates of the same item → time series. NA = value not available.
- Ask three questions: (1) categorical or numerical? (2) what is the unit? (3) one point in time, or over time?
Lecture 1.4 · Scales of Measurement
- Each scale keeps everything the previous one has and adds one more property.
- Nominal (names) → Ordinal (order) → Interval (differences) → Ratio (ratios).
- . Differences carry over (a 20 °C gap = 36 °F); ratios do not (2 in °C, about 1.53 in °F).
- So “40 °C is twice as hot as 20 °C” is wrong.
- Weight is a ratio scale: a new unit multiplies every value by one constant, so the ratio stays (60 kg / 30 kg = 2 = 60,000 g / 30,000 g).
6.1Descriptive or inferential?
| Study | Type |
|---|---|
| Average Class 12 marks of all admitted students | Descriptive |
| 400 mall visitors used to estimate the ages of all visitors | Inferential |
| Highest and lowest marks in a class of 40 | Descriptive |
| 1,000 houses used to say what houses in Tamil Nadu cost | Inferential |
Rule: the purpose decides: only summarising the sample → descriptive; drawing a conclusion about the population → inferential (needs probability).
6.2Population and sample
All elements of interest. Size .
A subgroup studied in detail. Size , always .
Inference goes from the sample back to the population.
6.3Cross-sectional or time series?
| Cross-sectional | Time series | |
|---|---|---|
| Cases | Many cases (students, houses, shops…) | One case (one item, one person) |
| Time | All recorded at one point in time | Recorded again and again over time |
| Each row is | a different person or item | a different date |
| Used to | compare cases with each other | see how one case changes |
| Example | Class 12 marks of 5 students: Anjali 394, Pradeep 437, Varsha 442… | Daily potato cost: Rs. 21 (1 Mar), Rs. 20.05 (2 Mar) … Rs. 21.25 (6 Mar) |
Spot it: rows are different people or items → cross-sectional; rows are different dates of the same item → time series. NA = value not available.
6.4How to classify a variable
6.5The four scales at a glance
| Scale | In one line | Examples |
|---|---|---|
| Nominal | Name categories without implying order | Name, board, gender, blood group |
| Ordinal | Name categories that can be ordered | Service rating: excellent, good, poor |
| Interval | Values can be added or subtracted; no absolute zero | Temperature in °C or °F |
| Ratio | Values can be added, subtracted, multiplied or divided | Height, weight, age, marks |
6.6What each scale allows
| Scale | Names or labels | Order matters | Differences | Ratios | Meaningful comparisons |
|---|---|---|---|---|---|
| Nominal | ✓ | ✗ | ✗ | ✗ | =, ≠ |
| Ordinal | ✓ | ✓ | ✗ | ✗ | =, ≠, <, > |
| Interval | ✓ | ✓ | ✓ | ✗ | =, ≠, <, >, +, − |
| Ratio | ✓ | ✓ | ✓ | ✓ | =, ≠, <, >, +, −, ×, ÷ |
Each scale keeps every property of the one before it, and adds one more.
6.7Formulas and facts to remember
Example: 4 women among 8 students gives .
and : ratio 2 becomes about 1.53, so ratios are meaningless on an interval scale.
- A mobile number is categorical (a label), not numerical.
- Descriptive or inferential depends on the purpose, not on the data.
- Never mix units in one numerical column (kg with lb).
- “Twice as hot” is wrong on an interval scale (°C, °F).
- The mean of nominal codes (1/2 or 3/1) is meaningless.
6.8Exam answer templates
For each question type, ask the check question, then use the answer template.
| Question type | Check question | Answer template |
|---|---|---|
| Descriptive or inferential | Does the statement go beyond the data in hand? | "Descriptive, because it only summarises ..." / "Inferential, because the sample is used to conclude about the population of ..." |
| Population and sample | Who is the conclusion about? Who was measured? | "Population: all ... (N). Sample: the ... surveyed (n)." |
| Cases and variables | What does one row stand for? | "Case: each ... Variables: ... Table size ." |
| Categorical or numerical | Does an average make sense? | "Categorical: a label, no unit." / "Numerical, unit ...". |
| Cross-sectional or time series | Different items at one time, or one item at different times? | "Cross-sectional, because ..." / "Time series, because rows are different dates of ...". |
| Scale | Names only? Ranked? Is zero "none"? | "Nominal / Ordinal / Interval / Ratio, because ...". |
- Give label + one-line reason
- Write the unit for every numerical variable
- Remember
- Use the zero test and the "twice" test for interval vs ratio
- Convert to one unit before comparing
- Call digit labels (mobile, PIN, roll no.) numerical
- Call a study inferential just because it has a sample
- Treat NA as 0
- Say "twice as hot" for °C or °F
- Average nominal codes
6.9Mixed practice
Practice questions (graded-assignment style)
Multiple Choice Question (MCQ): choose the one correct option.
The blood group of 200 patients is recorded on one day. Choose the correct classification.
Check three things: categorical or numerical, scale, one time or over time.
- Blood group names a group, so it is categorical, with no order, so nominal.
- Many patients at one time make it cross-sectional.
- Answer: option 2.
Multiple Select Question (MSQ): select all that apply.
Choose the correct statements.
Rows are cases and columns are variables.
- Options 1 and 2 are correct.
- Option 3 is wrong: a mobile number is only a label, so it is categorical.
- Option 4 is wrong: °C is an interval scale.
- Answer: options 1 and 2.
Numerical Answer Type (NAT).
The daily potato record has 4 columns (Date, Qty, Cost, Selling price) and 31 rows for a month. How many data values does it hold?
n × k, with one row per date.
- 31 × 4 = 124.
- Answer: 124