How to Use VSTACK and LAMBDA to Author Dynamic Tsui-Wang Polarization Index Models in Microsoft Excel

While the Wolfson Polarization Index provides a single formulation for measuring the decline of the middle class, Kai-yuen Tsui and You-qiang Wang (1998) expanded polarization theory by deriving an axiomatic class of polarization indices grounded in median-preserving spreads and identity clustering. The Tsui-Wang Polarization Index ((TW)) incorporates a flexible sensitivity parameter ((r in (0, 1))) that allows researchers to adjust the weight assigned to income disparities relative to median living standards. In Microsoft Excel, dynamic array formulas utilizing LAMBDA, LET, MAP, and VSTACK enable automated calculation of Tsui-Wang polarization models without VBA macros.

Mathematical Foundations of the Tsui-Wang Indices

Let (Y = {y_1, y_2, dots, y_N}) represent an ordered vector of individual incomes with median (m). Tsui and Wang derived two generalized polarization indices:

[ TW_1 = rac{1}{N} sum_{i=1}^N left| rac{y_i – m}{m} ight|^r ] [ TW_2 = rac{2}{N} sum_{i=1}^N left| rac{y_i – m}{m} ight| cdot ext{sgn}(y_i – m) ]

Key properties of the Tsui-Wang class:

  • Normalized Distance to Median: Measures how far individual living standards depart from the median benchmark (|y_i – m| / m).
  • Sensitivity Parameter (r): When (r = 1.0), the index measures linear mean relative deviation from the median. When (0 < r < 1) (e.g., (r = 0.5)), the index places greater sensitivity on subtle transfers away from the middle class toward the margins.
  • Decreased Middle Class Axiom: Any median-preserving spread that shifts income from middle earners toward the distribution tails strictly increases the Tsui-Wang polarization index.

Authoring the Dynamic Tsui-Wang Model in Microsoft Excel

Place your raw household income data in column range B2:B50. In cell D2, enter this dynamic array formula:

=LET(
    incomes, B2:B50,
    clean_data, FILTER(incomes, ISNUMBER(incomes) * (incomes > 0)),
    n_count, ROWS(clean_data),
    
    /* Central Distribution Moments */
    med_val, MEDIAN(clean_data),
    mean_val, AVERAGE(clean_data),
    
    /* Calculate Normalized Relative Deviations: |y - m| / m */
    dev_vec, MAP(clean_data, LAMBDA(y, ABS(y - med_val) / med_val)),
    
    /* Tsui-Wang Index at parameter r = 0.5 (Subtle Spreads) */
    tw_r05, (1 / n_count) * SUM(dev_vec^0.5),
    
    /* Tsui-Wang Index at parameter r = 1.0 (Linear Spread) */
    tw_r10, (1 / n_count) * SUM(dev_vec^1.0),
    
    /* Benchmark: Gini Coefficient */
    sorted_y, SORT(clean_data, 1, 1),
    ranks, SEQUENCE(n_count),
    gini_val, (2 / (n_count * mean_val)) * SUM(ranks * sorted_y) - (n_count + 1) / n_count,
    
    /* Middle Class Density (Share within 25% of median) */
    is_middle, (clean_data >= 0.75 * med_val) * (clean_data <= 1.25 * med_val),
    mid_share, SUM(--is_middle) / n_count,
    
    /* Assemble Spilled Report Dashboard */
    headers, HSTACK("Tsui-Wang Polarization Metric", "Calculated Score", "Interpretation"),
    r1, HSTACK("Sample Size (N)", TEXT(n_count, "#,##0"), "Total active observations"),
    r2, HSTACK("Median Income (m)", TEXT(med_val, "£#,##0.00"), "Middle-class anchor point"),
    r3, HSTACK("Mean Income (mu)", TEXT(mean_val, "£#,##0.00"), "Arithmetic central tendency"),
    r4, HSTACK("Tsui-Wang TW (r = 0.5)", TEXT(tw_r05, "0.0000"), "Concave spread index (sensitive to middle erosion)"),
    r5, HSTACK("Tsui-Wang TW (r = 1.0)", TEXT(tw_r10, "0.0000"), "Linear mean relative deviation from median"),
    r6, HSTACK("Gini Coefficient (Benchmark)", TEXT(gini_val, "0.0000"), "Standard overall inequality index"),
    r7, HSTACK("Middle Class Population Share", TEXT(mid_share, "0.0%"), "Workforce earning 75%-125% of median"),
    
    param_head, HSTACK("Sensitivity Analysis (r)", "TW Score", "Dispersion Impact"),
    p1, HSTACK("r = 0.25 (Extreme Sensitivity)", TEXT((1 / n_count) * SUM(dev_vec^0.25), "0.0000"), "Heavy weight on initial departure from median"),
    p2, HSTACK("r = 0.50 (Standard Concave)", TEXT(tw_r05, "0.0000"), "Standard axiomatic Tsui-Wang specification"),
    p3, HSTACK("r = 0.75 (Moderate Concave)", TEXT((1 / n_count) * SUM(dev_vec^0.75), "0.0000"), "Balanced tail and middle weighting"),
    p4, HSTACK("r = 1.00 (Linear Metric)", TEXT(tw_r10, "0.0000"), "Proportional distance to median"),
    
    VSTACK(headers, r1, r2, r3, r4, r5, r6, r7, HSTACK("", "", ""), param_head, p1, p2, p3, p4)
)

Core Advantages of the Formulaic Implementation

  1. Flexible Sensitivity Testing: Allows researchers to test multiple values of (r in (0, 1)) simultaneously to confirm whether polarization trends are robust across concave specifications.
  2. Instant Dynamic Recalibration: Modifying or pasting new census, survey, or compensation records immediately refreshes all deviations and polarization scores across the spilled report.
  3. Zero External Dependencies: Operates seamlessly in modern Excel across Windows, macOS, and Excel Online without requiring third-party plugins.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.