Tutorials › AP Statistics › Counting Cases and Variables in a Large Data Set

Variables and investigative questions · Tutorial 14 of 1000

Counting Cases and Variables in a Large Data Set

Practice interpreting a data-set summary by counting its observational units and classifying each recorded variable.

Beginner 9 min read

What You'll Learn

  • Identify what one observational unit represents in a data-set summary.
  • Interpret a stated sample size as a count of observational units, not variables.
  • Count variables by identifying the recorded characteristics.
  • Classify a six-variable inventory as categorical or quantitative.
  • Distinguish numeric labels from quantitative measurements when checking variable types.
  • Check that your variable counts agree with the full inventory.

Read the Summary Before Counting

In Defining Variables Precisely With Units, you practiced describing what a variable records. Now use those descriptions to read a data-set summary and count its cases and variables. A summary might state that a data set has \(n=250\) and list six recorded characteristics. Those numbers answer different questions: \(n\) tells us how many observational units are represented, while the list tells us how many variables were recorded for each unit.

A data set can contain many rows, and some values may repeat. Neither fact changes the number of variables. To count variables, count the distinct characteristics recorded—not the number of different values a characteristic happens to take. To count observational units, use the number of cases represented, not the number of columns or categories.

Definition: In a data-set summary, the number of observational units is the number of cases represented, often reported as \(n\). The number of variables is the number of distinct characteristics recorded for each case.

As in Identifying the Observational Unit, first ask what one case represents. Then read the variable inventory and classify each recorded characteristic. For this tutorial, the main classification is whether a variable is categorical or quantitative, as introduced in Categorical Versus Quantitative Variables. If a variable is written as a number, use the arithmetic-meaning test from Spotting Numerical Variables That Are Really Categorical: does arithmetic with its values describe an amount, or does the number only act as a label?

A Reliable Way to Count

A short summary can be easy to misread when it has a large number of cases. Use the same sequence each time: identify the cases, record the stated case count, list each variable once, and classify each listed variable. A tally can help keep the last step organized.

1
Name one observational unit.
State what a single case represents, such as one student or one tree.
2
Read the case count.
If the summary gives \(n=250\), it represents 250 observational units, assuming the summary describes 250 cases.
3
Count distinct variables.
Count each characteristic in the inventory once. A repeated value does not create an additional variable.
4
Classify each variable.
Decide whether each characteristic records a category or a numerical count or measurement.
5
Check the totals.
The categorical and quantitative counts should add to the total number of listed variables.

Keep the two counts separate in your notes. For example, a compact record might say “250 students; six variables: three categorical and three quantitative.” The 250 is not a count of variables, and the six is not a count of students. Naming what each number counts helps prevent a common mix-up.

Worked Example: A Summary With 250 Students and Six Variables

A school data summary describes 250 participating students and lists these six recorded characteristics: student ID number, usual travel mode to school, satisfaction rating from very dissatisfied to very satisfied, number of school absences this term, commute time in minutes, and hours spent studying last week. How many observational units and variables are represented? How many variables are categorical and how many are quantitative?

Identify the observational unit: One case represents one participating student. The summary states \(n=250\), so it represents 250 observational units. The number of cases is supplied directly; it does not need to be found by counting the six characteristics.

Count the variables: The inventory contains six distinct characteristics. Count each listed characteristic once: ID number, travel mode, satisfaction rating, absences, commute time, and study hours. Therefore, there are six variables.

Classify each variable: Student ID number is categorical because it identifies a student; differences between ID values do not measure a meaningful amount. Travel mode is categorical because its values are groups such as walking, bus, or car. Satisfaction rating is categorical and ordinal because the response categories have an order, but the gaps between them are not established as equal amounts.

The number of absences is quantitative and discrete: it is a count. Commute time in minutes is quantitative because it measures a duration. Hours spent studying last week is also quantitative because it measures time. Whether the time values are recorded as whole numbers or with fractions does not change the fact that they represent measured amounts.

Recorded characteristicTypeReason
Student ID numberCategoricalIdentifies a student; arithmetic differences are not meaningful amounts.
Usual travel modeCategoricalPlaces students into groups.
Satisfaction ratingCategorical, ordinalOrdered response categories.
Number of absencesQuantitative, discreteA count of absences.
Commute time in minutesQuantitativeA measured duration.
Study hours last weekQuantitativeA measured duration.

Check the totals: There are three categorical variables and three quantitative variables. Since \(3+3=6\), the type counts account for every variable in the inventory. The complete answer is: 250 student observational units, six variables, three categorical variables, and three quantitative variables.

Do Not Let the Number of Cases Distract You

The case count may be much larger than the variable count. A data set with 250 cases and six variables can be pictured as 250 rows, one for each student, and six columns, one for each recorded characteristic. The row-and-column convention was introduced in Reading a Data Table: Rows, Columns, and Cases. A summary may not show all those rows, but it can still state how many cases and variables the data set contains.

Repeated values do not reduce the number of cases or variables. If 80 students report traveling by bus, those are still 80 student cases, and “usual travel mode” is still one variable. Similarly, a variable does not become two variables because it has many possible values. Commute time remains one variable whether the observed times are 12, 15, 18, or many other values.

A number in a summary can refer to a count, a label, or a measurement. For example, \(n=250\) is a count of cases. An ID number is a label. The number of absences is a quantitative count, and minutes of commuting is a quantitative measurement. Read what each number refers to before deciding what it counts or how its variable should be classified.

Worked Example: Keep Cases and Variables Separate

A community garden inventory reports 180 plants. For each plant, volunteers record species, bed location, number of flowers, and height in centimeters. A student says, “There are 180 variables because there are 180 plants.” Correct the statement and count the variables of each type.

Name the cases: One observational unit is one plant. The summary reports 180 plants, so it represents 180 observational units. The student has mistaken the number of cases for the number of variables.

Count the characteristics: The inventory has four variables: species, bed location, number of flowers, and height. Species and bed location are categorical because they assign plants to groups or locations. Number of flowers is quantitative and discrete because it is a count. Height in centimeters is quantitative because it is a measurement.

Check the result: There are two categorical and two quantitative variables, and \(2+2=4\), the total number of listed variables. The corrected statement is: “The data set represents 180 plant observational units and records four variables: two categorical and two quantitative.”

Classify Every Listed Variable, Even the Tricky Ones

A variable inventory can include a mixture of labels, categories, counts, and measurements. A fast classification based only on appearance can lead to errors. A numeric code such as 1 for “morning,” 2 for “afternoon,” and 3 for “evening” may be categorical if the numbers are codes for groups rather than measured amounts. In contrast, a recorded number of visits is a quantitative count. Use the meaning of the values, not just their format.

Ordinal categories still count as categorical variables. As covered in Ordinal Categories and Rating Scales, a meaningful order does not establish that the spaces between response categories are equal numerical amounts. So a satisfaction rating with ordered verbal responses is one categorical variable, not a collection of separate variables and not automatically a quantitative measurement.

The variable inventory also helps you avoid counting a compound description twice. “Height in centimeters” is one variable: the unit clarifies how the measurement is expressed. “Number of absences this term” is one variable: the time period specifies which count is recorded. A precise name can contain several details without representing several variables.

Worked Example: Classify a Compact Technology Summary

A fictional device-use survey summarizes 96 participants. For each participant, it records participant code, primary device type, daily screen time in hours, number of app notifications received yesterday, and agreement with the statement “I can manage my notifications” using responses from strongly disagree to strongly agree. How many cases and variables are represented, and how many variables are of each type?

Count observational units: One observational unit is one survey participant. The summary reports 96 participants, so it represents 96 observational units.

List the variables: The five recorded characteristics are participant code, primary device type, daily screen time, notification count yesterday, and agreement rating. Thus, there are five variables.

Classify and tally: Participant code is categorical because it identifies a participant. Primary device type is categorical because it assigns a participant to a device group. The agreement rating is ordinal categorical because the responses have a meaningful order. Daily screen time is quantitative because it measures duration, and number of notifications is quantitative and discrete because it counts events.

Check the totals: Three variables are categorical and two are quantitative. The counts add to five, matching the inventory. The answer is 96 observational units and five variables: three categorical and two quantitative.

Common Mistakes and AP Exam Tips

  • Calling the sample size the number of variables. State what \(n\) counts: observational units or cases. Then count variables from the inventory.
  • Counting values instead of characteristics. A variable with many possible values is still one variable. Count each listed characteristic once.
  • Classifying every number as quantitative. An ID or numeric group code is categorical when it serves as a label. Explain whether arithmetic differences have meaningful interpretations.
  • Forgetting that ordered responses are categorical. A rating scale can have order without meaningful equal spacing. Identify it as ordinal categorical when appropriate.
  • Skipping the total check. Add the categorical and quantitative variable counts and compare the sum with the number of variables listed.
  • Counting units or time details as extra variables. “Height in centimeters” is one measurement variable, not a height variable plus a centimeters variable. Count distinct recorded characteristics.

For a clear AP Statistics response, name the observational unit, state the case count, list or count the variables, and explain any classification that could be mistaken—especially numerical labels. A concise full-credit answer ties each number to what it counts and verifies that the type counts add to the variable total.

Key takeaway: Count observational units from the case total and count variables from the distinct recorded characteristics. Classify each variable by what its values mean, then check that the categorical and quantitative counts add to the total number of variables.

Check Your Understanding

Use the summaries below to identify the observational units, count the variables, and classify each variable as categorical or quantitative.

  1. A summary lists 72 bicycles and records frame color, gear count, and wheel diameter in centimeters. How many observational units and variables are represented? How many variables are categorical and how many are quantitative?
  2. A survey includes 140 households and records postal code, household size, and preferred internet plan. Why should postal code not automatically be classified as quantitative?
  3. A data summary says \(n=315\) and lists four variables: daily temperature, weather category, number of rainy hours, and station ID. State the number of observational units and variables, then classify the variables.
  4. In a study of 50 seedlings, height is recorded in centimeters and the number of leaves is counted. How many cases and variables are represented? Which variable is a count?
  5. A student counts six different response choices for one survey question and concludes that the data set has six variables. Explain the error and state what should be counted instead.