Nesting vs Grouping (Crossed Structures)
1. Why This Matters
Many datasets in econometrics, panel data, and hierarchical modeling involve structured observations —
individuals within groups, or observations classified by multiple dimensions.
Understanding whether these structures are nested or crossed determines:
- How we model random effects / fixed effects
- How we cluster standard errors
- How we interpret within- and between-group variation
2. Nested Data Structures
Definition A nested structure means smaller units are fully contained within larger units.
Each lower-level unit belongs to exactly one higher-level unit.
\([ \text{Level 3: Country} ; ⊃ ; \text{Level 2: Region} ; ⊃ ; \text{Level 1: City} ]\)
Key Properties
| Feature | Explanation |
|---|---|
| Belonging | One-to-one hierarchy |
| Independence | Observations within the same group are correlated |
| Model implication | Use hierarchical or multilevel models with random intercepts/slopes |
| Typical notation | a/b/c (e.g., country/region/city) |
Economic Examples
| Example | Interpretation |
|---|---|
| Students within Schools | Each student belongs to one school |
| Cities within Regions within Countries | Strict geographic hierarchy |
| Years within Firms | Time nested within individual firms (panel data) |
Model Form
\(Y_{ij} = \beta_0 + u_j + \beta_1 X_{ij} + e_{ij}\)
where \(u_j\) = group-level (nested) random effect.
3. Grouped or Crossed Data Structures
Definition
A grouped (crossed) structure means units are classified along multiple independent dimensions.
Each observation can belong to several groups simultaneously.
$ $
Key Properties
| Feature | Explanation |
|---|---|
| Belonging | Many-to-many relationship |
| Independence | Observations share multiple group memberships |
| Model implication | Use crossed random effects (or two-way fixed effects) |
| Typical notation | a * b (e.g., city * brand) |
Economic Examples
| Example | Interpretation |
|---|---|
| Teachers × Students | Each teacher teaches many students; each student has multiple teachers |
| Firms × Industries | Firms operate across industries; industries have many firms |
| Cities × Brands | Each city sells many brands; each brand sold in many cities |
Model Form
\(Y_{ij} = \beta_0 + u_i^{(city)} + v_j^{(brand)} + e_{ij}\)
where \(u_i\), \(v_j\) = crossed random effects.
4. Mixed (Nested + Crossed) Structures
Sometimes, you have both:
\((\text{country/region/city}) * (\text{brand/product})\)
Interpretation:
- Cities are nested within regions and countries.
- Brands/products are nested within brand lines.
- The two hierarchies cross each other → mixed structure.
Example:
| Country | Region | City | Brand | Product | Sales |
|---|---|---|---|---|---|
| USA | California | Los Angeles | Nike | Air Max | 300 |
| USA | California | Los Angeles | Apple | iPhone | 500 |
| UK | England | London | Nike | Air Max | 220 |
Model Form:
$Y_{ijkm} = 0 + u{country_j} + u_{region_{k(j)}} + u_{city_{m(k,j)}} + v_{brand_b} + v_{product_{p(b)}} + e_{ijkm} $
where \(u\) = nested random effects; \(v\) = crossed random effects.
5. Summary Table
| Concept | Relationship | Example | Model Type | Typical Notation |
|---|---|---|---|---|
| Nesting | One unit belongs exclusively to another | Students within schools | Multilevel / hierarchical | a/b/c |
| Grouping (Crossed) | Units classified by multiple factors | City × Brand sales | Crossed random / two-way FE | a * b |
| Mixed | Nested hierarchies crossed with another | (Country/Region/City) × (Brand/Product) | Mixed-effects | (a/b) * (c/d) |
##6. Key Takeaways
- Nesting = contained within (hierarchy).
→ one-to-one belonging (tree structure).
- Grouping = classified by (intersection).
→ many-to-many relationship (grid structure).
- Mixed structures combine both.
→ e.g., “Cities within Countries × Brands across Markets.”
*Econometric translation:**
| Data Type | Model Framework |
|---|---|
| Time within Firm | Fixed or random effects (nested) |
| Individuals across Firms × Industries | Two-way fixed effects (crossed) |
| Schools within Districts × Teachers across Classes | Mixed / Crossed multilevel |
Summary
Nesting forms hierarchies; grouping forms grids.
Econometric models must reflect which structure your data actually follow.