Tutorials › Regression Analysis (Undergraduate) › Recognizing Clustered and Repeated Observations

Grouped Data and Dependence Awareness · Tutorial 867 of 991

Recognizing Clustered and Repeated Observations

Identify the observational unit, spot shared groups and repeated measurements, and decide when independence is a reasonable working assumption.

Advanced 9 min read

What You'll Learn

  • Distinguish a row in a data table from an independent observational unit.
  • Recognize grouped records, repeated measurements, and overlapping sources of dependence.
  • Use study design and data collection details to assess whether independence is plausible.
  • Explain why different people or different rows do not by themselves guarantee independence.
  • Avoid inferring independence merely because a dataset has no obvious group labels.

Why the Data Table May Hide Dependence

A regression data set is often displayed with one row per observation. That layout can make the rows look interchangeable and separate. But the way data were collected matters: several rows may come from the same person, or different people may share a school, clinic, workplace, or other setting. Such records may be related, even though they occupy different rows.

Recognizing this structure is a first step in describing the data correctly. It does not, by itself, choose a regression method or prove that any particular pair of outcomes is correlated. It identifies where dependence may arise and whether treating every row as independent needs careful justification.

Definition: An observational unit is the entity about which a record is made, such as a person, school, or patient visit. A repeated observation is another record collected from the same observational unit at a different time or occasion. Clustered observations are records from distinct units that belong to a shared group, such as students in the same school. Observations are independent when the occurrence or value of one does not change the probability distribution of another; for a set of observations, mutual independence means their joint distribution factors into the product of their individual distributions.

Start With What One Row Represents

The row is a storage format, not a statistical definition. One row might represent one student, one student-year, one clinic visit, or one school. Before deciding whether the rows are independent, identify what was measured on each row and which records refer to the same person or shared group.

A useful distinction is between the record and the entity. If each student has one row, the student is both the record’s subject and the observational unit. If each student has a row for every school year, the rows are student-year records, but the same student contributes several records. Those rows cannot be treated as measurements on unrelated students simply because they are listed separately.

Dependence can arise in at least two common ways. Repeated measurements share the same person, so stable features of that person can affect several measurements. Grouped observations come from different people who share a setting; conditions in that setting can affect their outcomes in similar ways. In either case, the design points to a possible connection between records. The actual strength and form of any dependence require more information and are not determined just by recognizing the grouping.

A Practical Recognition Process

For this assessment, assume the study description accurately reports how records were collected and that the identifiers or labels shown are correct. Do not infer independence solely from the values in a response column: dependence is primarily a feature of the data-generating process and study design, not a pattern that can be ruled out by a small sample that happens to look varied.

1
Name the row.
State exactly what one row describes: a person, a visit, a school, or another entity. If the row combines an entity and a time point, state both.
2
Look for repeat contributors.
Check whether the same person, household, school, clinic, or other unit can contribute more than one row. Repeated records from the same unit are not automatically independent.
3
Look for shared settings.
Even when each person appears once, ask whether several people share a school, clinic, classroom, workplace, or other environment that could affect their outcomes.
4
State the conclusion cautiously.
Describe the dependence structure suggested by the design. Call independence a reasonable working assumption only when the units were collected separately and no relevant shared source of dependence is apparent; state that this is an assumption, not a guarantee.

The key word is could. Students in the same school may share teachers or policies; patients at the same clinic may share staff or local practices. These are reasons to consider dependence, not proof that their outcomes must be similar. Conversely, records with no displayed group label may still share a household or another relevant setting if the design indicates that they do.

Worked Example: Students From Several Schools

Hypothetical data: A survey records one mathematics score for each of 12 students: four students from each of three schools. Each row represents a student, and the survey also records the student's school.

SchoolStudent score recordsNumber of rows
A71, 76, 80, 834
B68, 74, 79, 824
C72, 77, 81, 854

There are \(3 \times 4 = 12\) student records, so the row count is \(n=12\). The observational units are the 12 students, not the three schools: the outcome is recorded for each student. But students are grouped within schools. For example, classmates may share instruction or school-wide conditions, which could make scores from the same school related.

The appropriate recognition is therefore students nested within schools, with possible within-school dependence. It would be incorrect to describe the 12 rows as 12 demonstrably independent observations just because they refer to 12 different students. The design identifies a shared setting; it does not establish from these values alone how much that setting affects scores.

Repeated Records From the Same Person

Repeated-measures data have a more direct link between records: the same observational unit is measured on multiple occasions. The occasions might be visits, days, or stages of follow-up. Even if the person’s condition changes over time, measurements may share stable characteristics of that person, and measurements close in time may be related.

A simple decomposition shows why repeated records can be dependent. Suppose, for illustration, that a response at occasion \(t\) for person \(i\) can be written as \(Y_{it}=\mu+U_i+\varepsilon_{it}\). Assume \(U_i\) is a person-specific component with variance \(\tau^2\), the occasion-specific errors have variance \(\sigma^2\), and errors from different occasions are independent of one another and of \(U_i\). These are assumptions for the illustration, not facts that can be read off a table. For two different occasions \(t\) and \(s\) from the same person, the shared component yields:

$$ \begin{aligned} \operatorname{Cov}(Y_{it},Y_{is}) &=\operatorname{Cov}(\mu+U_i+\varepsilon_{it},\ \mu+U_i+\varepsilon_{is})\\ &=\operatorname{Var}(U_i)\\ &=\tau^2. \end{aligned} $$

The constant \(\mu\) contributes no variance, and the occasion-specific errors contribute no covariance under the stated assumptions. The person-specific component appears in both records, so it contributes their covariance. If \(\tau^2>0\), the records are not independent, because independent variables with finite variances have covariance zero. This illustration explains one possible source of dependence; it does not claim that every repeated-measure design follows this particular model.

Worked Example: Several Visits From Each Patient

Hypothetical data: A clinic records a blood-pressure measurement at three visits for each of five patients. Each row is one visit, not one new patient.

PatientVisit 1 (mmHg)Visit 2 (mmHg)Visit 3 (mmHg)
P1142138136
P2151149145
P3132130128
P4146143141
P5139137134

In a long-format table, there would be \(5 \times 3 = 15\) visit rows. There are only 5 people, each contributing 3 records. The repeated-measures structure is clear: compare, for example, P1's 142 mmHg at the first visit with that same patient's 138 mmHg at the second visit. Those are two measurements on one person, not measurements on two independent people.

The values decrease for all five patients, but that visual pattern is not needed to identify the structure. Even if some patients' readings rose and others' fell, the records would still be repeated measurements because the same patients were measured several times. The design supports concern about within-person dependence; it does not, by itself, quantify it.

When Independence Is a Reasonable Working Assumption

A data set with one record per person and no apparent shared groups may be reasonably treated as independent if people were sampled separately and the design gives no relevant reason for their outcomes to be linked. For example, a hypothetical sample could consist of four different adults approached independently at separate locations, with one sleep-duration and one reaction-time measurement recorded for each. The number of rows and the number of people would both be four:

$$ n=4\text{ people}\times 1\text{ record per person}=4\text{ records}. $$

Under the stated design, there are no repeated records and no identified shared group among those four people, so independence is a reasonable working assumption for this small illustration. The conclusion is conditional on how the sample was gathered. If all four adults came from one household, for example, a shared environment would need consideration. One row per person is helpful, but it is not a proof of independence.

This distinction also prevents an opposite error: not every data set that includes a school or clinic label automatically has repeated observations. If each school contributes exactly one school's average, the observational units are schools; students are not separate rows. If each school contributes many student records, the observational units are students grouped within schools. Describe the unit at the level at which the response was actually recorded.

Worked Example: Distinct People or Repeated Measurements?

Hypothetical data: A researcher compares reaction times among six participants. Each participant is measured once, and the six participants are recruited individually from different locations. The table contains these six reaction times in milliseconds: 310, 295, 327, 304, 289, and 318.

There are six response records and six distinct participants:

$$ 6\text{ participants}\times 1\text{ measurement each}=6\text{ rows}. $$

Unlike the clinic example, no participant contributes a second measurement. Unlike the school example, the study description identifies no shared group among the participants. If recruitment was indeed separate and no other shared source is relevant, treating the six rows as independent is a defensible working assumption.

The reaction times are not all identical, but that fact is not evidence of independence. Nor does the fact that the participants are different prove independence: study design supports the assumption here. If the six participants were recruited as members of one team that trained together, the shared setting would be a reason to revisit it.

Common Mistakes and Why Recognition Matters

  • Counting rows as independent units. Wrong reasoning: “There are 15 rows, so there are 15 independent observations.” Correction: identify what each row represents. Fifteen visit rows from five patients are repeated records from five people.
  • Assuming different people must be independent. Wrong reasoning: “Every student is a different person, so the student scores are independent.” Correction: students may share a school or classroom. Different people can still be grouped by a relevant setting.
  • Assuming a grouping label proves dependence. Wrong reasoning: “The school column proves all scores from the same school are correlated.” Correction: the label reveals a structure that could produce dependence; it does not prove a particular degree or pattern of association.
  • Using the outcome pattern to decide the design. Wrong reasoning: “The readings do not look especially similar, so repeated visits are independent.” Correction: repeated visits remain repeated records because they come from the same person. Independence is not established by a visual impression.
  • Calling independence certain because no group is listed. Wrong reasoning: “There are no group labels in the file, so rows are independent.” Correction: ask how the records were collected. A missing label cannot rule out shared people, settings, or other design links.
Key takeaway: Describe both the row and its connection to other rows. Repeated records share an observational unit; clustered records come from distinct units sharing a group. Independent observational units require support from the study design, not merely separate rows or different people.

Check Your Understanding

For each situation, name what one row represents and describe whether the design suggests repeated observations, clustering, or a reasonable working assumption of independence.

  1. A school records one annual test score for each of 30 students, all from the same school. What is the observational unit, and what shared setting should be noted?
  2. A clinic records three measurements for each of 12 patients. How many visit records are there, and how many people contribute them?
  3. A dataset has 20 rows, one for each of 20 adults recruited independently from separate locations, with no shared group identified. What is a cautious conclusion about independence?
  4. Why does observing similar outcomes among members of one clinic not prove that the clinic caused the similarity?
  5. A table has one row per school and reports that school's average outcome. Are the rows individual students or schools? Explain.