03 · What You Need to Know
Nesting Means the Data Have More Than One Structural Level
The simplest hierarchy has two levels
Consider students enrolled in classrooms.
You might describe the structure as:
Level 1: Students
Level 2: Classrooms
Each student belongs to one classroom, and several students share the same classroom.
This creates clusters of observations.
Another example is employees within organizations:
Level 1: Employees
Level 2: Organizations
The lower-level observations are nested inside higher-level units.
A hierarchy can have more than two levels
Educational data often have structures such as:
Students → Classrooms → Schools → Districts
Organizational data might contain:
Employees → Teams → Departments → Companies
Health data might contain:
Patients → Physicians → Clinics → Health systems
The levels do not have to be equally important to every research question, but they exist in the data structure.
Repeated measurements can also be nested
Nesting does not require groups of different people.
Suppose 200 participants report stress every day for 30 days.
The hierarchy is:
Level 1: Daily observations
Level 2: Participants
Each participant contributes many repeated observations.
Measurements from the same person are likely to resemble one another more than measurements drawn from different people.
This is why repeated-measures and longitudinal data are also commonly analyzed using multilevel or mixed-effects approaches.
The fundamental issue is dependence
Many familiar statistical procedures assume that observations are independent.
Informally, independence means that knowing something about one observation does not provide systematic information about another observation after accounting for the model.
Nested data challenge this assumption because members of the same group share context.
Students in the same classroom may be similar because they:
- have the same teacher;
- receive the same instruction;
- interact with the same classmates;
- use the same resources;
- experience the same classroom climate.
Ignoring that common context can make the data appear to contain more independent information than they really do.
Clustering does not mean everyone in a group is identical
Students within one classroom can still differ considerably in ability, motivation, achievement, and background.
Nesting simply means that there may be an additional source of similarity associated with group membership.
A useful way to think about the outcome is:
Some variation occurs between individuals within groups.
Some variation may occur between groups.
Multilevel analysis can separate those sources.
A simple variance decomposition makes the hierarchy visible
Suppose the outcome is student achievement.
Conceptually:
This distinction is central to understanding levels of analysis.
The intraclass correlation coefficient summarizes clustering
In a simple random-intercept model, the intraclass correlation coefficient, or ICC, can describe how much outcome variation is associated with differences between higher-level groups.
An ICC of.20 in this simplified example indicates that about 20% of the modeled outcome variation lies between classrooms.
Another interpretation is that two randomly selected students from the same classroom tend to be more similar than two randomly selected students from different classrooms, to an extent summarized by the ICC under the model.
An ICC of zero would imply no modeled clustering in the outcome
If the between-group variance were essentially zero, group membership would contribute little to similarity in the outcome under the fitted model.
But researchers should not conclude that the hierarchy therefore does not exist.
Students are still physically nested within classrooms. Group-level predictors or random slopes may still be substantively relevant, and uncertainty in an estimated ICC should also be considered.
Hierarchy is a property of the design; ICC quantifies one aspect of how strongly that hierarchy appears in a particular outcome.
Even modest ICCs can matter when groups are large
Suppose an ICC is only.05, but each classroom contains 50 students.
Because many students share the same cluster, even modest within-cluster similarity can substantially reduce the amount of independent information compared with a simple random sample of unrelated individuals.
This is often summarized using a design effect.
Real designs may have unequal cluster sizes and additional complexities, so this formula should be treated as an introductory approximation rather than a universal sample-size solution.
Ignoring nesting can make standard errors too small
Suppose 1,000 students are nested in 20 schools.
An ordinary regression that treats all 1,000 student observations as independent may act as though the sample contains more independent information than it actually does.
If students within schools are positively correlated, standard errors can be underestimated.
This can make confidence intervals too narrow and statistical tests too optimistic.
Watch Out
A large number of lower-level observations does not mean you have the same number of independent higher-level contexts. One thousand students from 20 schools contain information from 1,000 students but only 20 observed schools.
Nested data do not automatically require one particular statistical method
Multilevel or mixed-effects modeling is one common approach, but it is not the only way to address dependence.
Depending on the question and design, researchers might use:
- multilevel or hierarchical models;
- linear or generalized linear mixed-effects models;
- cluster-robust standard errors;
- generalized estimating equations;
- fixed-effects models;
- design-based survey methods;
- analysis at the cluster level.
The appropriate strategy depends on whether researchers want to estimate higher-level variance, group effects, within-group effects, cross-level interactions, population-average effects, or something else.
Multilevel models explicitly represent the hierarchy
A basic two-level random-intercept model might be written conceptually as:
This is what allows the model to represent similarity among observations in the same cluster.
A random intercept allows groups to have different baselines
Suppose the outcome is AI adoption among faculty.
Universities may differ in their average adoption rates because of infrastructure, leadership, policy, institutional history, and other shared influences.
A random intercept allows each university to have its own deviation from the overall average.
That captures residual between-university variation not explained by included predictors.
Random slopes allow relationships to differ across groups
Suppose faculty self-efficacy predicts AI adoption.
The relationship may be stronger in some universities than others.
A random-slope model can allow the self-efficacy coefficient to vary across universities.
This raises a deeper multilevel question:
Why does the relationship vary?
A university-level variable may then be used to explain that variation.
This connects directly to cross-level relationships.
Nesting often creates variables at several levels
Consider students within classrooms.
| Student-level variables |
Classroom-level variables |
| Motivation |
Class size |
| Prior achievement |
Teacher experience |
| Study time |
Instructional method |
| Self-efficacy |
Classroom climate |
A multilevel research question may therefore ask what happens within classrooms, what differs between classrooms, or how classroom characteristics relate to individual students.
Not every higher-level unit must be a substantive unit of analysis
Suppose students are nested in schools, but the only substantive question is:
Does individual motivation predict individual achievement?
Schools still create clustering and may need to be accounted for statistically.
But the research does not necessarily have a substantive school-level hypothesis.
This distinction is important when deciding whether a study truly has more than one unit of analysis.
Statistical clustering and substantive multilevel theory are not the same thing
You can have clustered data without having a multilevel substantive theory.
For example, schools may simply be sampling clusters.
Conversely, you can have an important multilevel theory about institutional effects and then discover that your dataset contains too few institutions to test it adequately.
The data structure and theoretical structure should therefore be distinguished.
Nested data create within-group and between-group relationships
Suppose employee workload predicts burnout.
There are at least two possible relationships:
Within organizations: Do employees with heavier workloads than their colleagues experience more burnout?
Between organizations: Do organizations with higher average workloads have higher average burnout?
These are different statistical comparisons.
A raw individual workload coefficient in a multilevel dataset can combine within- and between-group information unless the model is specified to separate them.
Group-mean centering can separate within-group variation
Researchers can calculate:
The group mean, X̄ⱼ, can then be included separately to represent between-group differences.
This makes the interpretation clearer because within-group and between-group effects can differ substantially.
The same predictor can have different within- and between-group effects
Suppose within universities, faculty members who use AI more frequently also report greater self-efficacy.
But universities with higher average AI use might not have higher average self-efficacy because heavily adopting universities may include mandatory implementation policies that bring reluctant users into the system.
The individual and university relationships therefore need not match.
This is one reason relationships can differ across levels of analysis.
Nested structures can be cross-classified rather than strictly hierarchical
Not every dataset fits neatly into one tree.
Suppose students take courses from several teachers.
A student may belong to multiple instructional contexts rather than being nested entirely within one teacher.
Likewise, patients may receive care from several physicians, and employees may participate in multiple project teams.
These structures are cross-classified rather than strictly nested.
They may require models that recognize membership in multiple higher-level units.
Multiple membership is another extension
Suppose a patient's outcome is influenced by several hospitals or providers during treatment.
Assigning the patient to only one cluster may misrepresent the exposure structure.
Multiple-membership models can allow observations to belong partly to several higher-level units.
The broad lesson is that “hierarchical” should not be interpreted as meaning every real dataset forms one perfectly simple pyramid.
Longitudinal data can contain multiple levels simultaneously
Suppose faculty members report AI use monthly and faculty are nested within universities.
The structure becomes:
Level 1: Monthly observations
Level 2: Faculty members
Level 3: Universities
The study can now separate variation across time within a faculty member, variation among faculty members, and variation among universities.
Nested data matter for measurement too
Suppose researchers measure organizational climate through employee surveys.
Responses contain both individual-level and organization-level covariance.
A single-level factor analysis may blend those structures together.
The factor structure of individual perceptions need not be identical to the factor structure of differences among organizations.
Multilevel measurement models can explicitly separate those levels when the research question requires it.
Cluster-randomized trials are inherently hierarchical
Suppose schools rather than individual students are randomly assigned to an intervention.
Students are nested within randomized schools.
The treatment assignment therefore occurs at the school level, even though outcomes may be measured on thousands of students.
The analysis should respect that assignment structure.
Treating every student as an independently randomized experimental unit would create a unit-of-analysis error.
The number of clusters matters independently of the number of individuals
Suppose a trial includes 4,000 students but only eight schools.
There are many student observations but very little independent information about variation among randomized schools.
Estimation of school-level variance, treatment effects assigned at school level, and cross-level interactions can therefore be difficult.
Lower-level sample size cannot fully compensate for very few higher-level units.
Unequal cluster sizes can complicate the design further
One classroom may contain 15 students while another contains 60.
One hospital may contribute 20 patients while another contributes 2,000.
Unequal cluster sizes influence precision and can affect simple design-effect approximations.
The analytical method should therefore use the actual cluster structure rather than assuming perfectly balanced groups when they are not.
The hierarchy should be identified during study design
Before collecting data, researchers should ask:
- What are the lower-level observations?
- What higher-level units contain them?
- How many units exist at each level?
- Which variables are measured at each level?
- At what level is treatment or exposure assigned?
- At what level will conclusions be made?
These decisions affect sampling, power, measurement, analysis, and interpretation.
More observations do not necessarily mean more independent information
This principle is worth emphasizing.
If one person provides 500 measurements, you have 500 observations from one person, not 500 independent people.
If 2,000 students come from three schools, you have extensive student information but only three observed schools.
Nested data force researchers to distinguish the number of records from the number of independent higher-level units.