Two-Level Rank Constraints for Latent Causal Discovery in Cluster-Sampled Surveys

Large health, education and social surveys almost never sample people independently. They pick schools, clinics or villages first and then people inside them. Methods that find hidden causes by looking at the rank of covariance matrices, meaning how many independent directions of dependence link two groups of variables, assume every row of data is an independent draw. This note argues that the assumption fails in a specific, predictable way. Anything shared within a sampled cluster, such as a school's teaching quality or a village's air quality, acts as an extra hidden common cause of every variable measured on people in that cluster. When the data are pooled, that shared factor adds to the rank of every cross-covariance block. A rank-based method then reports hidden variables that do not exist at the individual level and misses real structure. At the same time, its rank tests become overconfident, because sampling a few hundred people from 40 schools yields much less information than sampling a few hundred people at random.

The proposal is to split the covariance of cluster-sampled data into a within-cluster part and a between-cluster part, and to run rank-based latent discovery on each. The within-cluster covariance recovers the hidden causal structure among individuals, cleaned of shared context. The between-cluster covariance recovers how many contextual hidden causes exist at the cluster level and which measured variables they reach. Rank tests are recalibrated to the number of clusters actually sampled, not the number of rows. We also show that the common practice of selecting clusters with unequal probability, a form of non-random selection, leaves within-cluster rank constraints intact whenever selection depends only on cluster-level quantities. This extends the selection-invariance result of Latent Variable Causal Discovery under Selection Bias to the multi-stage designs these surveys actually use.

Core Claim

Assume a two-level linear model. A person $i$ in cluster $c$ within stratum $s$ has measurements $$X_{ic} = \mu_s + W_{ic} + B_c,$$ where $\mu_s$ is a stratum mean. $W_{ic}$ is the individual-level part, generated by a linear latent causal graph $G_W$ with covariance $\Sigma_W$. $B_c$ is the cluster-level part, generated by a possibly different graph $G_B$ with covariance $\Sigma_B$, and is shared by everyone in cluster $c$. For any two disjoint sets of measured variables $X_A, X_Y$, the pooled cross-covariance satisfies $$\operatorname{rank}\,\Sigma_T[A,Y] \le \operatorname{rank}\,\Sigma_W[A,Y] + \operatorname{rank}\,\Sigma_B[A,Y],$$ with equality for generic parameters. This follows from the trek-separation theorem applied to the union graph, in which the cluster latents sit alongside the individual ones.

The consequence is concrete. A clean single-factor tetrad at the individual level becomes rank 2 in pooled data as soon as one contextual factor touches both sides. Pooled rank-based discovery therefore either merges clusters of variables incorrectly or introduces spurious latent parents. The error grows with the intra-cluster correlation, which is the share of variance explained by cluster membership.

The fix is to estimate both parts separately. The pooled within-cluster covariance $\hat\Sigma_W$ uses $n - C$ degrees of freedom, where $n$ is the number of people and $C$ the number of clusters. The between-cluster covariance is recovered by a method-of-moments estimate $\hat\Sigma_B = (S_{\text{means}} - \hat\Sigma_W/\bar m)$, where $S_{\text{means}}$ is the covariance of cluster means and $\bar m$ is an effective cluster size, as in multivariate analysis of variance. Trek-separation rank tests then run on each part. Tests on $\hat\Sigma_B$ carry roughly $C$ effective observations. Tests on $\hat\Sigma_W$ use $n - C$ degrees of freedom plus a cluster-robust variance for the estimated canonical correlations.

Relation to Prior Work

The method layer comes from rank-based latent discovery. A Versatile Causal Discovery Framework to Allow Causally-Related Hidden Variables introduced RLCD. It uses trek-separation to learn graphs in which latents can be causes, mediators or effects and observed variables may cause each other directly. It was validated on about 20,000 Big Five respondents treated as independent draws. Latent Hierarchical Causal Structure Discovery with Rank Constraints learns multi-layer latent hierarchies with canonical-correlation rank tests. Causal Structure Discovery between Clusters of Nodes Induced by Latent Factors clusters variables under latent factors using tetrads even when the data are Gaussian. We reuse these search procedures unchanged. What we change is the covariance they are fed and the null distribution of their tests. All three assume the sample covariance converges to a single population covariance, the i.i.d. assumption this note targets.

The closest bridge is Latent Variable Causal Discovery under Selection Bias. It adds a selection node to the graph and shows rank constraints survive truncating the data on that node. It then applies the method to the World Values Survey. It models selection of individuals, but it does not model clustering, strata, or the fact that selection happens in stages. We borrow its invariance argument and apply it to the first sampling stage. If the probability of drawing cluster $c$ depends only on cluster-level variables, conditioning on selection changes the distribution of $B_c$ but not of $W_{ic}$. Within-cluster ranks are therefore untouched, while between-cluster ranks follow its selection-augmented t-separation rules.

Multi-environment representation learning motivates, but does not supply, the treatment of strata. Learning Linear Causal Representations from General Environments: Identifiability and Intrinsic Ambiguity uses variation across environments to resolve orientation. Linear Causal Disentanglement via Interventions shows that differences in precision matrices across contexts have low rank. Strata such as urban versus rural areas are natural environments, but they are not interventions. We use them only as a secondary check that rank patterns in $\Sigma_W$ are stable across strata, and we do not claim orientation gains from them.

The surveys supply the regime and the motivation. Urban-rural differences in the prevalence and influencing factors of insomnia: a cross-sectional study in Foshan, China (n = 9,044 across five districts) and Trends in National Assessment of Educational Achievement (2003~2005) (a two-stage design of schools, then students) both state that their regressions cannot address unmeasured confounding. Both collect exactly the nested structure that two-level rank analysis needs.

Research Program

The theoretical part has three pieces. First, we prove the rank-additivity statement and its generic equality for two-level linear models in which cluster latents may cause individual latents; these are contextual effects. Second, we give conditions under which $G_W$ and $G_B$ are separately identifiable up to the usual rank equivalence. Third, we prove the stage-one selection invariance described above, and characterize when selection that also depends on individual variables at stage two breaks it.

The statistical part builds a rank test that is valid under clustering. We compute the smallest canonical correlations of the relevant block of $\hat\Sigma_W$ or $\hat\Sigma_B$. Their sampling variance is estimated with a cluster-robust sandwich estimator of the covariance entries, and calibrated with a cluster bootstrap that resamples whole clusters within strata. This matters because the file notes that canonical-correlation rank tests already depend on fragile thresholds at finite sample sizes. Clustering makes those thresholds wrong in a known direction: tests using the nominal sample size reject too often.

The software part wraps RLCD and the hierarchical rank search so they accept a pair of covariance estimates and a supplied test function. It also reports which structure was attributed to which level. Survey weights enter the moment estimators in the standard design-weighted way.

Baselines

The naive reference point is pooled RLCD. It runs on the ordinary sample covariance of all rows, with its standard i.i.d. rank test and nominal sample size. This is what an applied researcher would do today with Foshan-style data. The theory predicts it fails through spurious latents and inflated rank-test false positives as intra-cluster correlation rises. Beating it means lower structural Hamming distance and fewer spurious latents on the individual graph at intra-cluster correlation of 0.05 or higher, and similar performance when the correlation is zero.

The strongest existing competitor is cluster-demeaned RLCD. It subtracts each cluster's mean and runs RLCD with the i.i.d. test on the residuals, which is the fixed-effects habit from econometrics applied to discovery. It removes $\Sigma_B$ from the pooled covariance, so it should recover $G_W$ nearly as well as our within-level analysis. On the individual graph, our method must match it in structure recovery. We claim to beat it only on test calibration, through nominal false-positive rates of rank tests after dropping the i.i.d. degrees-of-freedom assumption, and on recovering $G_B$, which it discards entirely. No reported result was found on Lacuna for RLCD or any rank-based method on cluster-sampled data. The only reported figures in this area are for independent data. Latent Hierarchical Causal Structure Discovery with Rank Constraints reports 70% to 86% cluster-identification accuracy on its synthetic hierarchies as sample size grows from 2,000 to 10,000. Causal Structure Discovery between Clusters of Nodes Induced by Latent Factors reports nearly 100% cluster recovery at n = 200. We will reproduce these setups at intra-cluster correlation of zero to confirm our implementation reaches these levels before adding clustering.

We also run the selection-aware method of Latent Variable Causal Discovery under Selection Bias on pooled data, and PC, FCI and GIN from Causal-learn: Causal Discovery in Python as non-rank references. Two ablations isolate the ingredients. The first uses the two-level covariance split with the i.i.d. test, which isolates the calibration contribution. The second uses the pooled covariance with the cluster-robust test, which isolates the decomposition contribution. Every method sees the same simulated survey draws, the same significance level, and the same threshold-tuning budget, chosen on held-out simulation seeds.

Why not just…?

Why not just demean by cluster and run existing methods? This is the real threat to the individual-level part of the proposal. We expect it to nearly tie our method on $G_W$ when clusters are large. The experiments will show whether it wins there, and we will report it honestly as the recommended practice if so. It still falls short in two measurable ways. First, it treats $n$ rows as independent when only $n - C$ degrees of freedom remain and residuals within a cluster are correlated, so its rank tests should reject too often when clusters are small. Second, it throws away the between-cluster covariance, where contextual confounders such as school or district effects live. Those confounders are exactly what the surveys' open questions concern.

Why not just add cluster identity as an observed variable? A categorical cluster indicator with hundreds of levels does not fit linear trek-separation. Collapsing it to a few dummies imposes an arbitrary low-rank form on $\Sigma_B$ that our estimator instead tests. We include a variant that adds stratum dummies as a sensitivity check.

Why not just fit a multilevel structural equation model? Multilevel structural equation models, used implicitly by Park et al., require the analyst to specify the latent structure in advance at both levels. Our goal is to discover that structure. Their fit statistics can confirm a graph we find but cannot search over graphs.

Why not just apply survey weights to pooled RLCD? Weights correct for unequal selection probabilities, but they do nothing about shared cluster factors adding rank. The weighted-pooled condition in our simulations will show whether spurious latents persist after weighting.

Proposed Experiments

Simulations. The main experiments are simulations with known ground truth. We generate two-level linear models whose individual graphs come from the latent tree, measurement model and general latent model families used in the RLCD evaluation. Cluster graphs have one to three contextual latents. The simulated survey designs imitate the file's examples: five strata with between 20 and 200 sampled clusters, cluster sizes between 10 and 100, and intra-cluster correlation from 0 to 0.3. Some designs select clusters with probability proportional to a cluster-level size variable. Metrics are cluster-recovery accuracy, skeleton F1, structural Hamming distance, the number of spurious latents, and recovery of the between-level rank and graph. Test calibration is measured as the empirical false-positive rate of individual rank tests against a nominal 5%.

Decisive checks. The first check tests the additivity prediction directly. Pooled RLCD's spurious-latent count should track the number of contextual factors touching each block. If it does not, the core claim is wrong. The second check requires our cluster-robust test to hold near-nominal size where the i.i.d. test inflates. The third checks whether between-level recovery is usable at realistic cluster counts. We expect a failure regime below roughly 50 clusters, because between-level tests have about $C$ effective observations, and we will map that boundary rather than hide it.

Real data. No real survey in the file has a known causal graph, so real-data work is limited to consistency checks. On the World Values Survey, as used by Dai et al., countries serve as top-level groups. We check whether structure attributed to the individual level stays stable when groups are resampled. We also check whether pooled analysis produces extra latents that disappear after the split, as the simulations predict.