Statistical Methods
Use Weight-Based Effective Sample Size as a Diagnostic
Identify what the weights represent
Before calculating anything, record whether the values are survey sampling weights, nonresponse adjustments, calibration weights, or another type. Identify the intended population and analysis sample. Frequency counts and inverse-probability weights are not interchangeable simply because both appear in a column called weight.
Preserve the original weight variable and its documentation. Check missing, zero, negative, and non-finite values, and resolve unexpected values with the analyst responsible for the weighting procedure. A demonstration calculation should not silently repair them or decide who belongs in the analysis population.
Calculate the weight-variation summary
A common weight-based effective sample size is the square of the sum of weights divided by the sum of squared weights. The SciPy documentation states this formula for weighted observations. It summarizes weight concentration; its use here is a diagnostic, not a complete survey variance estimate.
The survey package documentation separately describes design-based summaries and design effects for complex surveys. Clustering, stratification, the estimator, and the relationship between weights and outcomes can matter beyond the unequal-weight calculation.
Recalculate fictional weights
Consider four fictional observations with weights 1, 1, 2, and 2. Their sum is 6 and their squared-weight sum is 10, giving effective n = 36/10 = 3.6. Equal weights would produce effective n = 4.
Multiplying every weight by ten gives 10, 10, 20, and 20. The new calculation is 60²/1,000 = 3.6, unchanged. This scale invariance is a useful check: the diagnostic responds to relative weight variation rather than the chosen normalization. Use the weight effective-n tool to reproduce the example with synthetic inputs. It accepts nonnegative weights with at least one positive value; zero-weight entries remain in its entered count.
Investigate concentration without deleting it
Use the survey-weight audit worksheet to record the weight source, sample definition, range, and diagnostic output. Inspect whether a small number of observations account for a large share of the total weight. That pattern may reflect the design or a data problem; the formula alone cannot decide which.
Do not trim large weights merely to improve effective n. Trimming or recalibration changes the estimator and can affect bias as well as variance. Any change needs a justified method and a documented comparison with the intended weighting plan.
Report the actual observation count beside the diagnostic, with the formula and its limitations. Do not substitute 3.6 for the number of recruited participants or use it automatically in an ordinary confidence-interval formula. Complete inferential analysis should retain the appropriate survey design information and evaluate uncertainty for the specific outcome and estimator.
Sources checked on 1 November 2026; fictional weight calculations independently recalculated.