Variables, Populations, and Samples
What is the most popular music artist at your school? How many hours a day do 8th graders spend on their phones? You don't have to ask everyone, but you do have to ask in a smart way. Statistics starts with two decisions: who you ask and what you measure.
Population, Sample, and Individual
Why not study the whole population every time? It can be too expensive, too slow, or impossible. To find out how long phone chargers last, you would have to wear out every one of them, and then there would be none left to sell. When you do study the entire population, it is called a census.
A group of researchers wants to know the favorite video game of American teenagers aged between 12 and 16. To do this, they survey 500 students from several middle and…
A group of researchers wants to know the favorite video game of American teenagers aged between 12 and 16. To do this, they survey 500 students from several middle and high schools in Chicago. State:
- a) The population under study.
- b) The chosen sample.
- c) The individual.
A team of researchers wants to carry out a study on the consumption of energy drinks among teenagers in a city of $50\,000$ inhabitants. To do this, they select $250$…
A team of researchers wants to carry out a study on the consumption of energy drinks among teenagers in a city of $50\,000$ inhabitants. To do this, they select $250$ students aged between $12$ and $18$ years from different middle and high schools and ask them how many cans they have consumed in the last week.
Identify the following elements of the statistical study:
- a) The population under study.
- b) The chosen sample.
- c) The individual.
- d) The sample size.
- e) The statistical variable and its type.
Qualitative and Quantitative Variables
A statistical variable is the characteristic we record for each individual. There are two big families.
| Type | Values | Examples |
|---|---|---|
| Qualitative (categorical) | Categories or labels, not true amounts | Favorite sport, eye color, social media app |
| Quantitative, discrete | Numbers you count (separate, isolated values) | Siblings, pets, goals scored |
| Quantitative, continuous | Numbers you measure (any value in an interval) | Height, weight, time, temperature |
Classify the following statistical variables as qualitative or quantitative: a) The favorite color of a cell phone case. b) The number of followers on a TikTok account.…
Classify the following statistical variables as qualitative or quantitative:
- a) The favorite color of a cell phone case.
- b) The number of followers on a TikTok account.
- c) The time, in minutes, it takes you to get from your house to school.
- d) The brand of sneakers preferred by the students in your class.
Within quantitative variables, we must distinguish between discrete and continuous. State the type of each of the following: a) The number of cousins each student has.…
Within quantitative variables, we must distinguish between discrete and continuous. State the type of each of the following:
- a) The number of cousins each student has.
- b) The capacity, in gallons, of the water bottles sold in the cafeteria.
- c) The number of WhatsApp messages you receive throughout a day.
- d) The weight of the backpacks of 8th grade students.
Match each of the following situations with the nature of its statistical variable (Qualitative, Discrete Quantitative or Continuous Quantitative): 1. The sports played…
Match each of the following situations with the nature of its statistical variable (Qualitative, Discrete Quantitative or Continuous Quantitative):
-
The sports played at the community sports center.
-
The maximum daily temperature recorded in your city during the month of July.
-
The number of television channels tuned in a household.
Nominal and Ordinal Variables
Qualitative variables come in two flavors.
For each of the following survey questions, identify whether the answer would result in a nominal qualitative, discrete quantitative or continuous quantitative variable:…
For each of the following survey questions, identify whether the answer would result in a nominal qualitative, discrete quantitative or continuous quantitative variable:
- a) "Which social media app do you use most frequently?"
- b) "How many hours a day (with decimals) do you spend studying?"
- c) "How many times have you been to the movie theater in the last month?"
- d) "What is your preferred operating system (Android or iOS)?"
Look at the following table of data collected on the reading habits of a group of students and classify each column according to the type of statistical variable it…
Look at the following table of data collected on the reading habits of a group of students and classify each column according to the type of statistical variable it represents:
| Student name | Books read per year | Favorite genre | Average reading time (h) |
|---|---|---|---|
| Lucía | $12$ | Fantasy | $0,5$ |
| Marcos | $4$ | Science Fiction | $1,2$ |
| Elena | $0$ | Does not read | $0$ |
- a) Books read per year.
- b) Favorite genre.
- c) Average daily reading time.
The following table presents several variables collected in a survey carried out in an esports club. Classify each of them into qualitative, discrete quantitative or…
The following table presents several variables collected in a survey carried out in an esports club. Classify each of them into qualitative, discrete quantitative or continuous quantitative:
| Variable | Type of Variable |
|---|---|
| Favorite video game | |
| Weekly training hours | |
| Number of peripherals (keyboard, mouse...) owned | |
| Brand of monitor used | |
| Internet connection speed (Mbps) | |
| Position in the world ranking |
Tricky Cases: Rounding, Ratings, and Money
Some variables look discrete because of how we write them. Always think about the quantity itself, not the display.
-
Measurements rounded by a device are still continuous. A sensor that shows $2.00$ in., $2.01$ in., $2.02$ in. is rounding. The true thickness of a steel sheet could be $2.0137\ldots$ in., and a better instrument would show more digits. The thing being measured is continuous.
-
Ratings with fixed steps are discrete. A movie rating from 1 to 5 stars in half-star steps can only be $1, 1.5, 2, \dots, 5$. That is only 9 possible values. But the mean rating of many users can be $3.7284\ldots$, and that is usually treated as continuous. Always say what you are classifying.
-
Money is counted in cents, so strictly it moves in steps of $\$0.01$. With so many tiny steps, "money spent" is usually treated as continuous. If the question only allows whole dollars, you can say discrete.
-
Age is continuous, because time passes without jumps, even though people say "13 years old".
A study is carried out on air quality in different locations of a state. To do this, measuring stations are installed to record the concentration of particles $PM_{10}$…
A study is carried out on air quality in different locations of a state. To do this, measuring stations are installed to record the concentration of particles $PM_{10}$ (in $\mu g/m^3$).
State whether the following statements are true or false, justifying each answer:
- a) The variable "particle concentration" is qualitative because it indicates air quality.
- b) If we measure the concentration at $15$ randomly chosen points, the individual is each of those measuring points.
- c) The number of inhabitants in the areas where it is measured is a continuous quantitative variable.
- d) The variable "pollution level" with values (Low, Medium, High) is an ordinal qualitative variable.
Often, continuous quantitative variables are presented as discrete due to the precision of the measuring instruments. A precision sensor measures the thickness of steel…
Often, continuous quantitative variables are presented as discrete due to the precision of the measuring instruments. A precision sensor measures the thickness of steel sheets produced in a factory. The sensor shows values such as $2,00$ in., $2,01$ in., $2,02$ in....
- a) Although the sensor only shows two decimal places, why is the thickness considered a continuous quantitative variable and not discrete?
- b) If the factory produces 10,000 sheets a day and quality control decides to measure only those sheets manufactured between 12:00 and 12:15, will the sample be representative of the total daily production? Justify your answer by mentioning possible factors that could vary throughout the day.
A streaming* platform analyzes its subscribers' data to improve its recommendations. Classify the following variables used by its algorithm: a) Total time (in seconds) a…
A streaming platform analyzes its subscribers' data to improve its recommendations. Classify the following variables used by its algorithm:
- a) Total time (in seconds) a user spends watching a video before closing it.
- b) Type of device used (Smart TV, Smartphone, Tablet, PC).
- c) Number of times a user has shared a platform link in the last month.
- d) Mean rating of the movies watched (from 1 to 5 stars, allowing half stars such as 3.5).
- e) Position a series occupies in the "Top 10" most watched in the country.
Discuss whether variable (d) could be considered continuous or discrete depending on how the original data is collected (individual votes vs. calculated mean).
Grouping Data into Intervals and Categories
When a continuous variable has many different values, we often group them into intervals. Intervals are written like $[15, 20)$: the bracket means $15$ is included, and the parenthesis means $20$ is not included. That way each value lands in exactly one interval.
The midpoint is a good stand-in because, if the data in an interval are spread fairly evenly, the values above the midpoint balance the values below it.
Grouping can also change the type of the variable. If you turn measured numbers into labeled categories, you get a qualitative variable and you lose the exact values.
A biologist is measuring the growth of a fern species in a greenhouse. After a month, they note down the heights (in inches) of $20$ specimens. The data obtained is a…
A biologist is measuring the growth of a fern species in a greenhouse. After a month, they note down the heights (in inches) of $20$ specimens. The data obtained is a continuous quantitative variable.
- a) Explain the difference between a discrete and a continuous quantitative variable using this example.
- b) If the data is grouped into intervals such as $[10, 15), [15, 20), [20, 25)$... what would be the midpoint of the second interval?
- c) What value does the midpoint represent in statistical calculations?
In a biology laboratory, the growth of a bacteria colony is studied. The researcher decides to record the temperature of the culture every hour. The temperature can take…
In a biology laboratory, the growth of a bacteria colony is studied. The researcher decides to record the temperature of the culture every hour. The temperature can take values such as $36,42 ^\circ C$, $36,45 ^\circ C$, etc. However, to simplify the final report, the researcher groups the results into three categories: "Cold" (less than $30 ^\circ C$), "Optimal" (between $30 ^\circ C$ and $40 ^\circ C$) and "Excess heat" (more than $40 ^\circ C$).
- a) What type of variable is the originally measured temperature?
- b) What type of variable is the one that finally appears in the report after grouping the data?
- c) Has information been lost in this process? Explain what advantage and disadvantage this transformation has from a statistical point of view.
A study is carried out on the hearing health of young people. The volume intensity at which they listen to music with headphones is measured (in decibels, dB). 1.…
A study is carried out on the hearing health of young people. The volume intensity at which they listen to music with headphones is measured (in decibels, dB).
-
Classify the variable "Sound intensity in dB".
-
If the values obtained range between $65,4$ dB and $105,9$ dB, explain why it would not make sense to treat this variable as a nominal qualitative variable.
-
The medical team decides that if the intensity exceeds $85$ dB, the risk is "High", and if it is lower, the risk is "Low". Classify this new variable "Hearing risk".
Biased and Representative Samples
A sample is representative when it has the same mix as the population, so what you find in the sample is probably true for the whole population. A sample is biased when it leaves out or favors some part of the population.
Common sources of bias:
-
Convenience sample: you ask whoever is easiest to reach (the first 25 students who walk in, or the people at one place and time).
-
Voluntary response: only people who choose to answer, such as an online poll. They tend to have strong opinions.
-
Leaving groups out: surveying only one location, one age group, or one time of day.
The fix is random selection: every individual has the same chance of being chosen. A simple random sample could be drawn by picking student ID numbers out of a hat or with a random number generator.
Imagine you want to carry out a study on the amount of money young people in your neighborhood spend weekly on leisure. a) What type of variable is "money spent"? b) If…
Imagine you want to carry out a study on the amount of money young people in your neighborhood spend weekly on leisure.
- a) What type of variable is "money spent"?
- b) If $1.200$ young people live in the neighborhood and you ask $60$, what is the sample size?
- c) Would it be representative if you only ask the young people at the door of a movie theater on a Saturday afternoon? Justify your answer.
A study on fruit consumption in a school is to be carried out. Determine whether the following samples are random (chosen at random and representative) or biased: a)…
A study on fruit consumption in a school is to be carried out. Determine whether the following samples are random (chosen at random and representative) or biased:
- a) Asking the first 25 students who arrive at school in the morning.
- b) Choosing 5 students at random from the roster of each class in the school.
- c) Asking only the students who are buying food in the cafeteria.
- d) Drawing 50 student ID numbers among all the students in the school and asking their owners.
To find out the citizens' opinion on the construction of a new bike lane downtown, a local newspaper conducts a survey at the entrance of a shop specializing in mountain…
To find out the citizens' opinion on the construction of a new bike lane downtown, a local newspaper conducts a survey at the entrance of a shop specializing in mountain biking.
- a) Do you think the chosen sample is representative of the city's population? Justify your answer.
- b) Is there any kind of bias in this choice? Explain why.
- c) Propose a sampling method that is more appropriate so that the results are reliable.
Stratified Sampling and Estimating
A simple random sample can still, by bad luck, include very few 6th graders or too many 8th graders. In a stratified random sample you:
-
Split the population into groups called strata that matter for the study (grade levels, age groups, neighborhoods).
-
Take a random sample from each stratum.
-
Make each stratum's share of the sample match its share of the population:
We can also use a representative sample to estimate something about the whole population. Find the fraction in the sample, then apply it to the population size.
In a school there are $600$ enrolled students. We want to extract a representative sample of $60$ students using stratified sampling by grade levels to carry out a study…
In a school there are $600$ enrolled students. We want to extract a representative sample of $60$ students using stratified sampling by grade levels to carry out a study on reading habits. The distribution by grade levels is as follows:
-
Grade $1º$: $180$ students.
-
Grade $2º$: $160$ students.
-
Grade $3º$: $140$ students.
-
Grade $4º$: $120$ students.
Calculate how many students from each grade level should be chosen so that the sample maintains the proportionality of the population.
A local council wants to know the number of pets in the households of a newly built neighborhood where $1\,200$ families live. To avoid asking everyone, they decide to…
A local council wants to know the number of pets in the households of a newly built neighborhood where $1\,200$ families live. To avoid asking everyone, they decide to send a survey to the $120$ families living at the first addresses on the alphabetical list of streets.
- a) State the population and the sample.
- b) Is this a simple random sampling method? Why?
- c) Identify the variable and state its type.
- d) If $15\%$ of the families in the sample do not have a pet, how many families in the neighborhood are estimated to have at least one pet?
A city council wants to know the level of acceptance of a new traffic regulation. To do this, they set up an information booth outside a school at 9:00 in the morning…
A city council wants to know the level of acceptance of a new traffic regulation. To do this, they set up an information booth outside a school at 9:00 in the morning and ask the first 100 adults who pass by.
- a) Define the population under study.
- b) Describe the selected sample.
- c) Critically analyze the sample selection method. Do you think all citizens had the same probability of being chosen? Propose a stratified random sampling method that would be fairer for this study.
Putting It All Together
To classify a variable, ask two questions: Does it make sense to average it? and then Does order matter? or Is it counted or measured?
Imagine you work in the marketing department of a music streaming platform. You want to investigate the relationship between the age of the users and the style of music…
Imagine you work in the marketing department of a music streaming platform. You want to investigate the relationship between the age of the users and the style of music they listen to the most.
To do this, you design a database with the following fields for each user:
-
Age (completed years).
-
Daily listening minutes.
-
Preferred musical genre (Pop, Rock, Trap, Others).
-
Degree of satisfaction with the service (from $1$ to $5$).
Classify each of the four previous variables and explain which type of chart (bar chart, pie chart or histogram) you think would be most suitable to represent the data for the variable "Preferred musical genre".
A video game developer is analyzing player behavior in a Beta* phase. To optimize performance, they record the following data for each user: 1. The name of the server…
A video game developer is analyzing player behavior in a Beta phase. To optimize performance, they record the following data for each user:
-
The name of the server they connect to (North, South, East, West).
-
The unique account identifier code (an 8-digit number).
-
The response time or ping measured in milliseconds.
-
The number of times the player has pressed the "pause" button in an hour.
-
The user's satisfaction level, rated as: "Very dissatisfied", "Dissatisfied", "Neutral", "Satisfied" or "Very satisfied".
Reason and classify each of the above variables. Pay special attention to variable number 2: does the fact that it is a number imply that it is a quantitative variable? Justify your answer.
A delivery company wants to improve its efficiency. To do this, it defines the population as "all packages sent in the United States during a year." Since it is…
A delivery company wants to improve its efficiency. To do this, it defines the population as "all packages sent in the United States during a year." Since it is impossible to study them all, they select a sample of 500 packages.
For each package they note down: weight in pounds, volume in $m^3$, destination state, and number of delivery attempts.
- a) Identify the population, the sample, and the individuals of the study.
- b) Classify the recorded variables.
- c) If out of the 500 packages in the sample, 450 have been collected solely from an office in a luxury area of New York, can we say that the sample is representative to draw conclusions about the service throughout the United States? Justify your answer using the concept of statistical bias.
Imagine you want to carry out a statistical study on the use of social media among teenagers in your city. You must design a survey that contains exactly: 1. A nominal…
Imagine you want to carry out a statistical study on the use of social media among teenagers in your city. You must design a survey that contains exactly:
-
A nominal qualitative variable.
-
An ordinal qualitative variable.
-
A discrete quantitative variable.
-
A continuous quantitative variable.
Write a question for each case that is realistic and useful for your research. Explain why each question corresponds to the requested type of variable.
Back to the start: To find the favorite artist at your school or the daily phone time of 8th graders, first define the population (all students at your school, or all 8th graders). Then take a random, representative sample, using stratified sampling if you want every grade or group included fairly. Favorite artist is a nominal qualitative variable. Hours on the phone is a quantitative continuous variable.