Statistical Variable
What is the favorite bachata group at your school? How many hours a day do kids your age use their cell phones? To answer, you don't need to ask everyone, but you do have to do it well. Statistics begins by deciding whom we ask and what we measure.
Population, sample, and individual
Why not always study the whole population? Because it can be too expensive, too slow, or even impossible: to check how long light bulbs last, you have to leave them on until they burn out, and you can't test them all. When the whole population is studied, it is called a census.
Proportional stratified sampling
In each stratum, we choose an amount proportional to its size: $\text{muestra del estrato} = \text{tamaño del estrato} \times \dfrac{\text{tamaño de la muestra}}{\text{tamaño de la población}}$.
Designing an investigation: how long does it take us to get to school?
We want to find out the one-way travel time of the 48 students in two classes of 24. First we agree on what we measure: minutes from leaving home until entering the school on a normal day, including the wait for the guagua or the concho. A question like "Does it take you too long?" collects an opinion, not the time.
-
We randomly draw 4 students from each class: a sample of 8 with the same proportions as the population. We don't pick only friends or only those who arrive early.
-
We record class and minutes, without names. If someone doesn't respond, we note the absence; we don't make up their time.
-
We check units and impossible answers. We don't discard a high time just because it looks odd: we check it first.
-
We organize the data and write up what we can conclude and what we cannot. The sample is small and does not automatically represent other schools.
A group of researchers wants to find out the favorite music group of Dominican teenagers aged between 12 and 16. To do this, they conduct a survey among 500 students…
A group of researchers wants to find out the favorite music group of Dominican teenagers aged between 12 and 16. To do this, they conduct a survey among 500 students from several secondary schools in Santo Domingo. State:
- a) The population under study.
- b) The chosen sample.
- c) The individual.
A study is to be conducted on fruit consumption in a high school. Determine whether the following samples are random (chosen at random and representative) or biased: a)…
A study is to be conducted on fruit consumption in a high school. Determine whether the following samples are random (chosen at random and representative) or biased:
- a) Asking the 25 students who arrive first at school in the morning.
- b) Choosing 5 students at random from the class roster of each class in the school.
- c) Asking only the students who are buying food in the cafeteria.
- d) Drawing 50 enrollment numbers at random among all the students in the school and asking their owners.
A team of researchers wants to carry out a study on energy drink consumption among teenagers in a city with $50\,000$ inhabitants. To do so, they select $250$ students…
A team of researchers wants to carry out a study on energy drink consumption among teenagers in a city with $50\,000$ inhabitants. To do so, they select $250$ students aged between $12$ and $18$ from different secondary schools and ask them how many cans they have consumed in the past week.
Identify the following elements of the statistical study:
- a) The target population of the study.
- b) The chosen sample.
- c) The individual.
- d) The sample size.
- e) The statistical variable and its type.
In a school there are $600$ enrolled students. We want to draw a representative sample of $60$ students using stratified sampling by grade level to carry out a study on…
In a school there are $600$ enrolled students. We want to draw a representative sample of $60$ students using stratified sampling by grade level to carry out a study on reading habits. The breakdown by grade level is as follows:
-
$1º$ year of secondary: $180$ students.
-
$2º$ year of secondary: $160$ students.
-
$3º$ year of secondary: $140$ students.
-
$4º$ year of secondary: $120$ students.
Calculate how many students from each grade level should be chosen so that the sample maintains the proportion of the population.
A local municipality wants to know the level of acceptance of a new traffic rule. To do so, they set up an information stand at the gate of a school at 9:00 in the…
A local municipality wants to know the level of acceptance of a new traffic rule. To do so, they set up an information stand at the gate of a school at 9:00 in the morning and ask the first 100 adults who pass by.
- a) Define the target population for the study.
- b) Describe the selected sample.
- c) Critically analyze the sample selection method. Do you think all citizens had an equal probability of being chosen? Propose a stratified random sampling method that would be fairer for this study.
Types of variables
The statistical variable is the characteristic we study. There are two main types:
Categorical variables can be nominal (the categories have no order: color, sport, province) or ordinal (the categories can be ordered: "Dissatisfied, Neutral, Satisfied").
| Type | Values | Examples |
|---|---|---|
| Nominal categorical | Qualities with no order | Favorite sport, eye color, social network |
| Ordinal categorical | Qualities with order | Satisfaction level, soda size (small, medium, large) |
| Discrete numerical | Numbers that are counted (isolated values) | Number of siblings, pets, home runs |
| Continuous numerical | Numbers that are measured (any value in an interval) | Height, weight, time, temperature |
Grouping values changes the type of variable
If a continuous variable is grouped into categories (for example, temperature into "Cold," "Optimal," and "Excess heat"), the variable that remains in the report is ordinal categorical: there are no numbers anymore, but there is an order. If it is grouped into intervals such as $[10, 15)$, $[15, 20)$, we are still working with a continuous numerical variable, and each interval is represented by its class mark, the midpoint: the class mark of the interval $[10, 15)$ is $\dfrac{10+15}{2}=12.5$.
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 home 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 liters, of the water bottles sold in the cafeteria.
- c) The number of WhatsApp messages you receive in a day.
- d) The weight of the backpacks of 3rd year of secondary school 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 municipal sports center.
-
The maximum daily temperature recorded in your city during the month of July.
-
The number of television channels tuned in at home.
For each of the following survey questions, identify whether the response would result in a nominal qualitative, discrete quantitative or continuous quantitative…
For each of the following survey questions, identify whether the response would result in a nominal qualitative, discrete quantitative or continuous quantitative variable:
- a) "Which social media application 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 cinema in the last month?"
- d) "Which is your preferred operating system (Android or iOS)?"
Look at the following table of collected data 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 collected data on the reading habits of a group of students and classify each column according to the type of statistical variable it represents:
| Student's name | Books read per year | Favorite genre | Mean 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) Mean daily reading time.
The following table shows several variables collected in a survey carried out at an e-sports club. Classify each of them as qualitative, quantitative discrete or…
The following table shows several variables collected in a survey carried out at an e-sports club. Classify each of them as qualitative, quantitative discrete or quantitative continuous:
| Variable | Type of variable |
|---|---|
| Favorite video game | |
| Weekly training hours | |
| Number of peripherals (keyboard, mouse...) owned | |
| Brand of monitor used | |
| Internet connection speed (Mbps) | |
| World ranking position |
A biologist is measuring the growth of a species of fern in a greenhouse. After one month, he records the heights (in cm) of $20$ specimens. The data obtained form a…
A biologist is measuring the growth of a species of fern in a greenhouse. After one month, he records the heights (in cm) of $20$ specimens. The data obtained form a continuous quantitative variable. The histogram shows the heights grouped in intervals of $5$ cm.
- a) Explain the difference between a discrete quantitative variable and a continuous one using this example.
- b) If the data are grouped in intervals such as $[10, 15), [15, 20), [20, 25)$..., what would be the class mark of the second interval?
- c) What value does the class mark represent in statistical calculations?
Imagine that you work in the marketing department of a music streaming platform. You want to investigate the relationship between users' age and the style of music they…
Imagine that you work in the marketing department of a music streaming platform. You want to investigate the relationship between users' age and the style of music they listen to the most.
To do so, you design a database with the following fields for each user:
-
Age (completed years).
-
Daily minutes of listening.
-
Preferred musical genre (Pop, Rock, Trap, Other).
-
Degree of satisfaction with the service (from $1$ to $5$).
Classify each of the four variables above and explain what type of chart (bar chart, circle graph, or histogram) you think would be most suitable to represent the data for the variable "Preferred musical genre".
A video game developer is analysing player behavior in a Beta* stage. To optimise performance, they record the following data for each user: 1. The name of the server…
A video game developer is analysing player behavior in a Beta stage. To optimise performance, they record the following data for each user:
-
The name of the server they connect to (North, South, East, West).
-
The unique account ID 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 variables above. 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 streaming platform analyses its subscribers' data to improve its recommendations. Classify the following variables used by its algorithm: a) Total time (in seconds) a…
A streaming platform analyses its subscribers' data to improve its recommendations. Classify the following variables used by its algorithm:
- a) Total time (in seconds) a user stays 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 link from the platform in the last month.
- d) Average rating of watched films (from 1 to 5 stars, allowing half stars such as 3.5).
- e) Position occupied by a series in the country's "Top 10" most watched.
Discuss whether variable (d) could be considered continuous or discrete depending on how the original data are collected (individual votes vs. calculated average).
Biased samples in practice
When you are asked to evaluate a sample, ask yourself three questions: who was left out? Where and when is the question asked? Did all the individuals have the same chance of being chosen?
A survey about a new bike lane done only at a bike shop, or a survey about a traffic rule done at the door of a school at 9:00 a.m., leaves out many people. The solution: random sampling (a draw among everyone) or stratified sampling (by neighborhood, age, or sex, with the proportion of each group).
There can also be bias in timing: measuring only between 12:00 and 12:15 may capture one shift of workers or a machine that was just turned on, and not represent the whole day.
A study on air quality in different locations of an autonomous region is carried out. To do so, measuring stations are installed to record the concentration of $PM_{10}$…
A study on air quality in different locations of an autonomous region is carried out. To do so, measuring stations are installed to record the concentration of $PM_{10}$ particles (in $\mu g/m^3$).
State whether the following statements are true or false, justifying each response:
- 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 measurements are taken is a quantitative continuous variable.
- d) The variable "pollution level" with values (Low, Medium, High) is a qualitative ordinal variable.
A municipality wants to know the number of pets in households in a newly built neighborhood where $1\,200$ families live. To avoid asking everyone, they decide to send a…
A municipality wants to know the number of pets in households in 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 which is the population and which is 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?
To find out citizens' opinions on the construction of a new bike lane in the city center, a local newspaper carries out a survey at the entrance of a store specializing…
To find out citizens' opinions on the construction of a new bike lane in the city center, a local newspaper carries out a survey at the entrance of a store 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 type of bias in this choice? Explain why.
- c) Propose a sampling method that would be more suitable to obtain reliable results.
A courier company wants to improve its efficiency. To do so, it defines the population as "all packages sent in the Dominican Republic during one year". As it is…
A courier company wants to improve its efficiency. To do so, it defines the population as "all packages sent in the Dominican Republic during one year". As it is impossible to study them all, they select a sample of 500 packages.
For each package, they record: weight in kg, volume in $m^3$, destination province and number of delivery attempts.
- a) Identify the population, the sample and the individuals of the study.
- b) Classify the recorded variables.
- c) If, of the 500 packages in the sample, 450 were collected solely from a branch in an affluent area of Santo Domingo, can we say that the sample is representative to draw conclusions about the service across the whole Dominican Republic? Justify your answer using the concept of statistical bias.
In a biology laboratory, the growth of a bacterial colony is studied. The researcher decides to record the culture temperature every hour. The temperature can take…
In a biology laboratory, the growth of a bacterial colony is studied. The researcher decides to record the culture temperature 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 "Excessive 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 what disadvantage doing this transformation has from a statistical point of view.
Imagine that you want to carry out a statistical study on social media use among teenagers in your city. You must design a survey containing exactly: 1. A qualitative…
Imagine that you want to carry out a statistical study on social media use among teenagers in your city. You must design a survey containing exactly:
-
A qualitative nominal variable.
-
A qualitative ordinal variable.
-
A quantitative discrete variable.
-
A quantitative continuous variable.
Write a question for each case that is realistic and useful for your research. Explain why each question corresponds to the type of variable requested.
Quantitative continuous variables are often presented as discrete due to the precision of measuring instruments. A precision sensor measures the thickness of steel…
Quantitative continuous variables are often presented as discrete due to the precision of measuring instruments. A precision sensor measures the thickness of steel sheets produced in a factory. The sensor displays values such as $2.00$ mm, $2.01$ mm, $2.02$ mm...
- a) Even though the sensor only displays two decimal places, why is thickness considered a quantitative continuous variable rather than discrete?
- b) If the factory produces 10 000 sheets per 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? Reason your answer, mentioning possible factors that could vary throughout the day.
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). The…
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).
The figure shows the interval in which the measured values lie and the 85 dB threshold set by the medical team.
-
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".
Back to the beginning: to find out the favorite bachata group or the hours of cell phone use, you first define the population (the students at your school), draw a random, representative sample, and identify each variable: the favorite group is nominal categorical and the hours of use are continuous numerical.