↖︎ Vishal Singh Same Betas, Three Standard Errors · NHANES
Survey variance · an empirical note

Same Betas, Three Standard Errors

One NHANES dataset, four variance machines, and exactly what the naive standard error quietly gets wrong.

This is the empirical companion to a conceptual note, “Weights get the point estimate right; the design gets the uncertainty right.” That note made three claims. Here we put all three on real data — the National Health and Nutrition Examination Survey (NHANES) — and hold every claim to an explicit numerical gate. The setting is deliberately mundane: the association between family income and depression. The point is not the finding; it is that one number can carry three or four different standard errors depending on which variance machinery you turn on — while the estimate itself never moves.

Concretely, we test that (1) point estimates are invariant to the variance machinery — a weighted mean and a weighted regression coefficient are numerically identical whether computed naively, with fixest and clustering, or with the full survey/srvyr design; (2) fixest with weights + clustering at the PSU recovers most of the design-based standard error; and (3) naive standard errors are materially anti-conservative, by an amount we quantify.

1One dataset, three variance machines


NHANES is a stratified, multistage cluster sample. Respondents are nested in primary sampling units (PSUs, roughly counties), PSUs are nested in strata, and each respondent carries a MEC examination weight that scales the sample up to the U.S. population.1 Pooling the eight PHQ-9 cycles from 2005–2023 and restricting to adults aged 20–80 with a valid income-to-poverty ratio gives an analytic domain of 42,463 respondents, spread over 129 strata and 263 PSUs (2–3 PSUs per stratum, median 2). The weights are far from equal — their coefficient of variation is 0.90, a Kish weighting design effect of $1+\mathrm{CV}(w)^2 = 1.80$ before a single cluster is considered.

1. Pooled MEC weight: each cycle’s 2-year weight (the 3.2-year WTMECPRP for the combined 2017–March 2020 file) is multiplied by its share of the 17.2 pooled analytic years, per CDC’s NHANES weighting guidance. Point estimates and design-based SEs are both invariant to a common rescaling of the weights.

The key move is to declare the design once and read four different standard errors off the same estimate. We line up four variance regimes, from the one that knows nothing about the design to the one that knows everything:

Regimeweightsheterosk.clustering (PSU)stratification
V0  naive iid
V1  hetero-robust (HC1)
V2  cluster @ PSU
V3  full survey design

V0 is what you get by bolting a textbook standard error onto a weighted group-by. V1 adds White heteroskedasticity-robust corrections. V2 clusters at the PSU — the econometrician’s rendering of the design. V3 is the full Taylor-linearized survey estimator, which additionally nets out the between-stratum variation and uses the design-correct degrees of freedom.2 Two families of estimand run through all four: Family A, weighted prevalences of probable major depression (PHQ-9 ≥ 10), overall and by income and age; and Family B, regressions whose headline coefficient is the Low–High income gap.

2. The design degrees of freedom are $\text{n}_{\text{PSU}} - \text{n}_{\text{strata}} = 263 - 129 = 134$. Note the gulf: 42,463 respondents but only 134 design df. The number of PSUs, not the number of people, governs the precision of the tails.

2The point estimates are identical


Start with the claim that should be boring and is worth making undeniable. A sampling weight fixes who is in the sample; it is the inverse probability of selection, and it enters every estimator as a simple ratio $\hat{\bar Y} = \sum_i w_i y_i / \sum_i w_i$. Nothing about strata or PSUs appears in that formula. So the same number falls out of a naive weighted mean, a fixest weighted regression, and srvyr’s survey_mean() — to the last decimal.3

3. This is design-unbiasedness: once each observation counts in proportion to the population it represents, the estimate is unbiased no matter how convoluted the sampling was. The design changes only the variance–covariance matrix, never the coefficient.
QuantityNaive weighted (V0)fixest + cluster (V2)Survey design (V3)
A1 · P(PHQ-9 ≥ 10), overall0.08342236230.08342236230.0834223623
B1 · Low–High gap (LPM β)0.11905944080.11905944080.1190594408

Across all 42,463-respondent prevalence cells, the closed-form weighted mean and srvyr’s design-based mean agree to max |V0 − V3| = 0.0e+00. For the regressions, feols/feglm and svyglm return the same coefficient vector to 3.3e-14 (linear probability model), 1.8e-12 (linear score), and 1.3e-12 (logit — different IRLS paths, same maximum). Every estimand in the study, plotted below, sits on the 45° line to within 1.8e-12.

0.0 0.5 1.0 1.5 2.0 0.0 0.5 1.0 1.5 2.0 Point estimate · V0 (naive weighted) Point estimate · V3 (full survey design) Regression coef. (Family B) Weighted mean (Family A) All 25 estimands on the 45° line · max |V0 − V3| = 9.2e-14 The point estimates are literally identical
Figure 1. The point-estimate identity. Naive weighted estimates (x) against full-design estimates (y) for every estimand in the study; all fall on the 45° line. The maximum absolute deviation is 1.8e-12 — machine precision. This figure is deliberately boring; that is the entire point.

The verbatim gate log:

[PASS] POINT-A: srvyr means == closed-form weighted means -- max|V0-V3| = 0.000e+00 over 22 cells
[PASS] POINT-B1: feols == svyglm (LPM) -- max|dcoef| = 3.331e-14
[PASS] POINT-B3: feols == svyglm (linear) -- max|dcoef| = 1.805e-12
[PASS] POINT-B2: feglm == svyglm (logit) -- max|dcoef| = 1.258e-12
[PASS] SANITY-DEFF: A1 implied DEFF (se_V3/se_V0)^2 in [1.2,6] -- implied = 1.470 ; srvyr deff = 2.409

3What the naive SE misses


Now turn on the variance machines one at a time and watch the confidence interval breathe while the point stays pinned. Figure 2 is the thesis in one frame: a single vertical line for the shared coefficient, four stacked intervals of visibly different width.

95% CI width 0.0149 · df 38,232 · t = 31.4 95% CI width 0.0201 · df 38,232 · t = 23.2 95% CI width 0.0228 · df 262 · t = 20.6 95% CI width 0.0218 · df 134 · t = 21.6 shared β = 0.1191 V3 · survey design V2 · cluster @ PSU V1 · hetero (HC1) V0 · naive iid 0.105 0.110 0.115 0.120 0.125 0.130 0.135 Low–High income gap in P(PHQ-9 ≥ 10) (LPM coefficient) NHANES 2005–2023 · B1 linear probability model · identical β across all four variance machines One point estimate, four standard errors
Figure 2. One point estimate, four standard errors. The Low–High income gap in P(PHQ-9 ≥ 10) from the linear probability model (B1). The shared β is drawn as a dashed vertical line through all four rows; only the interval width and the degrees of freedom change.

For that headline gap, the naive standard error is 0.00380 against a design-based 0.00550. The naive interval is 32% too narrow — the honest interval is 1.46× wider — and the t-statistic on the income gap falls from a swaggering 31.4 to a still-decisive 21.6. Here the association is strong enough to survive; for a marginal subgroup contrast, that same factor is the difference between a star and a shrug.

B1 · linear probability model  ·  shared β = 0.1191
Variance regimeSEdf95% CI widthtSE / design
V0 · naive iid0.0038038,2320.014931.40.69
V1 · hetero-robust (HC1)0.0051338,2320.020123.20.93
V2 · cluster @ PSU0.005792620.022820.61.05
V3 · full survey design0.005501340.021821.61.00
B2 · logistic regression (log-odds)  ·  shared β = 1.4708
Variance regimeSEdf95% CI widthtSE / design
V0 · naive iid0.0499238,2320.195729.50.74
V1 · hetero-robust (HC1)0.0686538,2320.269121.41.02
V2 · cluster @ PSU0.074442620.293119.81.11
V3 · full survey design0.067071340.265321.91.00
B3 · PHQ-9 total score (0–27)  ·  shared β = 2.1651
Variance regimeSEdf95% CI widthtSE / design
V0 · naive iid0.0561238,2320.220038.60.74
V1 · hetero-robust (HC1)0.0728338,2320.285529.70.96
V2 · cluster @ PSU0.085982620.338625.21.13
V3 · full survey design0.076161340.301328.41.00
The naive SE is 26–31% smaller than the design SE across all three regressions. Relative to the design, the naive standard error is 0.69× (LPM), 0.74× (logit), and 0.74× (total score). The implied design effects — $(\text{SE}_{V3}/\text{SE}_{V0})^2$ — are 2.10, 1.81, and 1.84 respectively.

Two structural details earn the tables their credibility. First, the tolerance the logit demanded: feglm and svyglm travel different IRLS routes, so we tightened both to deviance tolerances near $10^{-11}$ to make the coefficients agree past the eighth decimal. Second, and more consequential, the naive iid SE for the logit is only meaningful once the weights are normalized to mean 1.4

4. Fed raw population MEC weights (which sum to hundreds of millions), a GLM’s Fisher information behaves as if $n$ equalled the U.S. population, collapsing the naive SE toward zero — the classic probability-weights-as-frequency-weights trap. Normalizing to mean 1 leaves every coefficient and every robust/cluster/design SE unchanged (all scale-invariant) but restores an honest naive baseline with effective $n$ = the sample size.

4Cluster(PSU) gets you most of the way


The good news for practitioners who live in fixest: you do not need the full survey apparatus to get an honest standard error. Weighting and clustering at the PSU — vcov = ~psu_uid — lands within a few percent of the design. Figure 3 shows every shortcut’s SE as a ratio to the design-based truth.

SE too small ← → SE conservative B3 · PHQ-9 total · Low–High gap B2 · logit · Low–High gap B1 · LPM · Low–High gap A2 · prevalence · High income A2 · prevalence · Middle income A2 · prevalence · Low income A1 · prevalence (overall) 0.6 0.7 0.8 0.9 1.0 1.1 1.2 Standard error relative to the full survey design (V3 = 1.0) V0 · naive iid V1 · hetero (HC1) V2 · cluster @ PSU Naive (V0) SEs sit well below 1.0; cluster-robust (V2) hugs the design; dashed line = design SE How far each shortcut's SE lands from the design-based truth
Figure 3. How far each shortcut’s SE lands from the design. Ratio to the full-design SE (dashed at 1.0) for six estimands. Naive (V0) sits well below 1; hetero-robust (V1) recovers part of the gap for regressions; cluster-robust (V2) hugs the design from just above.

For the three regression coefficients the cluster-robust SE is 1.05×, 1.11×, and 1.13× the design SE — slightly conservative, which is the safe direction to err. What still separates V2 from V3 decomposes into three pieces. (i) Stratification is a precision gain the cluster-robust estimator leaves on the table: guaranteeing balanced coverage of every region×urbanicity cell removes a whole dimension of sampling noise, so V3 sits just below V2. (ii) Degrees of freedom differ — fixest uses $n_{\text{cluster}}-1 = 262$, the survey estimator uses design df = 134, and the naive regimes pretend they have 38,232. (iii) Random domain size: for subgroup means the survey machinery keeps a component that an intercept-only regression within the subgroup drops.5

5. The single most dangerous shortcut is clustering on the raw SDMVPSU, which takes values 1–3 and recycles across strata. That would collapse 42,463 respondents into three fake mega-clusters. Always cluster on a globally-unique psu_uid = interaction(stratum, psu) — here 263 genuine PSUs.

The same story reads off the plain overall prevalence. Its design effect is a substantial 2.41 against a simple random sample of the same size:

A1 · weighted prevalence of PHQ-9 ≥ 10, overall
Variance regimeEstimateSEdfDEFF (srvyr)
V0 · naive iid0.08340.0018138,245
V2 · cluster @ PSU0.08340.00246262
V3 · full survey design0.08340.002191342.41

Notice that not every naive SE errs downward. For the highest-income group the design SE is actually smaller than the naive iid SE — there, stratification’s precision gain outweighs clustering’s penalty.6 The design does not merely inflate; it corrects in whichever direction the sampling scheme demands.

6. This is visible in Figure 3: the High-income prevalence cell’s naive point sits to the right of 1.0. Ignoring strata is conservative on this margin; you would be understating your own precision.

5Effective sample size across subgroups


Clustering’s deepest practical consequence is that a big survey buys a much smaller effective sample. Positively correlated observations within a PSU carry less information than their headcount suggests, so the design-effective $n$ is $n/\text{DEFF}$. Across the 18 income×age prevalence cells, design effects run from 1.22 to 2.51 (median 1.67).

Low Middle High 1.0 1.5 2.0 2.5 1.0 1.5 2.0 2.5 1.0 1.5 2.0 2.5 70-80 60-69 50-59 40-49 30-39 20-29 Design effect (DEFF, survey vs. simple random sample) Age group Effective n (= n / DEFF) 1000 1500 2000 PHQ-9 ≥ 10 prevalence in 18 Income × Age cells · point size = design-effective n A big survey, a much smaller effective sample
Figure 4. A big survey, a much smaller effective sample. Design effect (x) for each of the 18 income×age cells; point size is the design-effective $n = n/\text{DEFF}$. The worst cell (Middle, ages 60-69) has a raw $n$ of 2,558 but a DEFF of 2.51, an effective $n$ of only 1,020.

This is why some income×age contrasts are noisier than their raw counts promise, and why power calculations for subgroup comparisons should use $n/\text{DEFF}$, not $n$. It also produces an honest wrinkle worth reporting rather than hiding: in 8 of the fine age×income cells the cluster-robust SE actually comes in below the naive one — a near-zero or slightly negative within-PSU correlation at that granularity. The design effect is an average tendency, not a law that binds every cell.

6Practical translation


  1. Use plain weighted group-bys for point estimates. They are exactly right, fast, and convenient for building tables — the estimate is design-unbiased regardless of the variance machinery.
  2. Never attach a naive SE, CI, or significance star to them. Anything inferential must come from the declared design or its replicate weights. Here the naive interval ran 32% too narrow.
  3. If you live in fixest, weight and cluster at the PSU. That recovers the SE to within a few percent (here 1.05–1.13× the design) — erring slightly conservative. Cluster on a globally-unique psu_uid, never raw SDMVPSU.
  4. Use the full design when stratification or degrees of freedom matter. The between-stratum gain and the design df (134, not 38,232) are exactly what svyglm/survey_mean get right and the shortcuts do not.
  5. Always report DEFF and think in effective $n$. A DEFF of 2.41 on the headline prevalence, and up to 2.51 in subgroups, means a “large” survey supports far fewer subgroup comparisons than $n$ suggests.

The one-paragraph version: weights answer “who does each observation represent?” and so fully determine the estimate; standard errors answer “how would this estimate move across repeated draws of the same design?” and depend on features weights do not encode. Declaring the design once fixes the second question without touching the first.

Reproducibility appendix

Estimands. Family A: weighted prevalence of PHQ-9 ≥ 10, overall (A1), by income (A2), and by income×age group (A3). Family B, all with the right-hand side Income + Sex + factor(CycleShort) + poly(Age, 3) and income releveled so High is the reference: B1 linear probability model for PHQ-9 ≥ 10, B2 logistic regression, B3 linear model for the PHQ-9 total score. The headline coefficient is IncomeLow, the Low–High gap.

Naive weighted-mean SE (Eq. 1)

The V0 standard error of a weighted mean is the iid linearization with normalized weights $\tilde w_i = w_i/\sum_j w_j$: $\;\widehat{\mathrm{SE}} = \sqrt{\sum_i \tilde w_i^{\,2}\,(y_i-\hat{\bar y})^2}\,$. It knows nothing about strata or PSUs. The V2 cluster-robust mean is fit as a weighted intercept-only regression with vcov = ~psu_uid, so Families A and B share the same machinery.

Pooled weight

$\text{MEC\_wt} = \text{MEC\_wt}_{\text{raw}} \times (\text{years}/17.2)$, with WTMECPRP for the combined 2017–March 2020 file and WTMEC2YR otherwise; 17.2 = total pooled analytic years across the eight cycles. Design declared on the full file (all rows with positive weight, 81,820) and subset afterwards, per CDC practice for domain variance.

Environment

R 4.5.1 · fixest 0.13.2 · survey 4.5 · srvyr 1.3.1 · arrow 21.0.0.1. options(survey.lonely.psu = "adjust"); nest = TRUE in as_survey_design. Every fixest call sets vcov explicitly. Run July 7, 2026.

Assertion log (all gates)

=== SE-compare assertion log ===
design df (n_PSU - n_strata) = 134
[PASS] POINT-A: srvyr means == closed-form weighted means -- max|V0-V3| = 0.000e+00 over 22 cells
[PASS] POINT-B1: feols == svyglm (LPM) -- max|dcoef| = 3.331e-14
[PASS] POINT-B3: feols == svyglm (linear) -- max|dcoef| = 1.805e-12
[PASS] POINT-B2: feglm == svyglm (logit) -- max|dcoef| = 1.258e-12
[INFO] ORDER se_V0<=se_V2: 8 of 25 cells violate (negative-ICC domains; reported not failed)
        violating cells: A3/Low:50-59, A3/Low:60-69, A3/Low:70-80, A3/Middle:40-49, A3/Middle:50-59, A3/High:20-29, A3/High:40-49, A3/High:50-59
[PASS] CLUSTER-B1: se_V2/se_V3 in [0.85,1.15] -- ratio = 1.052
[PASS] CLUSTER-B2: se_V2/se_V3 in [0.85,1.15] -- ratio = 1.110
[PASS] CLUSTER-B3: se_V2/se_V3 in [0.85,1.15] -- ratio = 1.129
[PASS] SANITY-DEFF: A1 implied DEFF (se_V3/se_V0)^2 in [1.2,6] -- implied = 1.470 ; srvyr deff = 2.409

TOTAL FAILS: 0

References

  1. Lumley, T. (2010). Complex Surveys: A Guide to Analysis Using R. Wiley.
  2. Centers for Disease Control and Prevention. NHANES Analytic and Reporting Guidelines. National Center for Health Statistics.
  3. Cameron, A. C., & Miller, D. L. (2015). A practitioner’s guide to cluster-robust inference. Journal of Human Resources, 50(2), 317–372.
  4. Moulton, B. R. (1990). An illustration of a pitfall in estimating the effects of aggregate variables on micro units. Review of Economics and Statistics, 72(2), 334–338.
  5. Bertrand, M., Duflo, E., & Mullainathan, S. (2004). How much should we trust differences-in-differences estimates? Quarterly Journal of Economics, 119(1), 249–275.
  6. Kish, L. (1965). Survey Sampling. Wiley.
  7. Liang, K.-Y., & Zeger, S. L. (1986). Longitudinal data analysis using generalized linear models. Biometrika, 73(1), 13–22.

BibTeX

@book{lumley2010complex,
  title     = {Complex Surveys: A Guide to Analysis Using R},
  author    = {Lumley, Thomas}, publisher = {Wiley}, year = {2010}}
@article{cameron2015practitioner,
  title   = {A Practitioner's Guide to Cluster-Robust Inference},
  author  = {Cameron, A. Colin and Miller, Douglas L.},
  journal = {Journal of Human Resources}, volume = {50}, number = {2},
  pages   = {317--372}, year = {2015}}
@article{moulton1990illustration,
  title   = {An Illustration of a Pitfall in Estimating the Effects of Aggregate Variables on Micro Units},
  author  = {Moulton, Brent R.},
  journal = {Review of Economics and Statistics}, volume = {72}, number = {2},
  pages   = {334--338}, year = {1990}}
@article{bdm2004,
  title   = {How Much Should We Trust Differences-in-Differences Estimates?},
  author  = {Bertrand, Marianne and Duflo, Esther and Mullainathan, Sendhil},
  journal = {Quarterly Journal of Economics}, volume = {119}, number = {1},
  pages   = {249--275}, year = {2004}}

Generated programmatically from results_master.csv; every statistic in this article is injected from the pipeline output, none hand-typed.