Tutorials › Marginal Structural Models › Weight Clipping, Winsorization, and Deletion

Weight Stabilization and Truncation · Tutorial 140 of 501

Weight Clipping, Winsorization, and Deletion

Learn how clipping and winsorization alter inverse probability weights, and why keeping a record with a capped weight is not the same as deleting it.

Advanced 10 min read

What You'll Learn

  • Define upper clipping and winsorization for nonnegative inverse probability weights.
  • Identify when clipping and winsorization produce the same transformed weights.
  • Calculate transformed weights, weighted totals, and weighted means.
  • Distinguish capping a weight from removing its observation.
  • Check a transformed data set for common implementation errors.

Why the Operation Matters

Inverse probability weights can vary greatly across individuals. A very large weight can make one record contribute much more to a weighted analysis than other records. Clipping and winsorization limit such contributions by changing weight values. Deletion takes a different action: it removes records from the analysis. The distinction is simple in a formula, but consequential in data processing and in the weighted estimating equation.

The earlier material on stabilized weights establishes how weights are constructed and used in marginal structural models. Here, take the weights as given. The aim is to define the transformations and compare their arithmetic consequences, not to choose a cutoff or assess the resulting bias.

Definitions and Terminology

Let \(w_i\) be the nonnegative inverse probability weight for record \(i\), for \(i=1,\ldots,n\). For this tutorial, consider an upper boundary \(c>0\). The weight list may be unstabilized or stabilized; the operations below act on the supplied weights.

Definition: Upper clipping at \(c\) replaces each weight by \(w_i^{\mathrm{clip}}=\min(w_i,c)\). Thus a weight at or below \(c\) is unchanged, and a weight above \(c\) is replaced by \(c\). Upper winsorization replaces each weight above a chosen upper boundary by that boundary while retaining its record. When the same boundary \(c\) is used, winsorization gives \(w_i^{\mathrm{win}}=\min(w_i,c)\), the same numerical transformation as upper clipping.

Terminology is not completely uniform across applied writing. Some authors use “clipping” and “winsorization” interchangeably; others use “winsorization” for replacing tail values with a boundary determined from the sample. The essential distinction in this tutorial is between replacing a weight value while retaining its record and deleting the record. Whenever reporting an analysis, state what was done and how the boundary was set rather than relying on the label alone.

If an analysis uses a winsorization rule that supplies a boundary \(c\), its resulting weights can be written with the same minimum operation above. The details of how a boundary is chosen are a separate issue. Clipping or winsorization does not, by itself, imply that observations have been deleted.

Definition: Under deletion above \(c\), records with \(w_i>c\) are excluded; records with \(w_i\leq c\) remain with their original weights. Equivalently, a calculation that retains all \(n\) rows can represent this deletion by setting the weights of excluded records to zero. The positive weights of the retained records are not capped.

Worked Calculations

Worked Example: Transforming a List of Weights

Suppose five records have weights \(0.5, 1, 1.5, 2,\) and \(8\), and use the upper boundary \(c=3\). Calculate the clipped weights and compare them with deletion above the boundary.

For clipping, apply \(\min(w_i,3)\) to each value:

$$ (0.5,1,1.5,2,8) \longmapsto (0.5,1,1.5,2,3). $$

The total weight before clipping is \(0.5+1+1.5+2+8=13\). After clipping it is \(0.5+1+1.5+2+3=8\). There are still five records, and the last record still has positive weight.

Under deletion above \(3\), the record with weight \(8\) is removed. The remaining list is \((0.5,1,1.5,2)\), with total weight \(5\) and four records. The deletion result is not the clipped list: clipping keeps the fifth record with weight \(3\), whereas deletion gives it no contribution.

Worked Example: Effect on a Weighted Mean

Consider four records with weights \((1,2,4,9)\) and outcomes \((0,1,0,1)\). For a weighted mean, use \(\sum_i w_iY_i/\sum_i w_i\). Compare the original value, clipping at \(c=3\), and deletion of records with weights above \(3\).

The original numerator is \(1(0)+2(1)+4(0)+9(1)=11\), and the denominator is \(1+2+4+9=16\). Thus the original weighted mean is \(11/16\).

Clipping gives weights \((1,2,3,3)\). The numerator becomes \(1(0)+2(1)+3(0)+3(1)=5\), and the denominator becomes \(1+2+3+3=9\). The clipped weighted mean is \(5/9\).

Deletion removes records three and four, whose original weights are \(4\) and \(9\). The remaining numerator is \(1(0)+2(1)=2\), and its denominator is \(1+2=3\). The deleted-sample weighted mean is \(2/3\). Each calculation uses a different set of contributions; neither the clipped result nor the deleted-sample result can be substituted for the original without changing the calculation.

Worked Example: Checking a Winsorized List

Suppose a stated upper boundary is \(c=2\), and the six weights are \((0.8,1,1.2,2,7,10)\). Calculate the upper-winsorized list and its total. Then compare that total with deletion above \(2\).

The first four weights are at or below \(2\), so they remain unchanged. The last two exceed \(2\), so each is replaced by \(2\). The winsorized list is \((0.8,1,1.2,2,2,2)\), with total \(0.8+1+1.2+2+2+2=9\).

The original total is \(0.8+1+1.2+2+7+10=22\). Deleting weights above \(2\) leaves \((0.8,1,1.2,2)\), with total \(5\). The last two records remain in the winsorized data with positive weights; they are absent under deletion.

What the Transformations Preserve

Clipping is an element-by-element map. It preserves the number and identity of records, and it does not increase any weight. With nonnegative starting weights and \(c>0\), the resulting weights are nonnegative and no larger than \(c\).

Result: For any finite list of nonnegative weights \(w_1,\ldots,w_n\) and \(c>0\), upper clipping produces \(w_i^{\mathrm{clip}}=\min(w_i,c)\), with \(0\leq w_i^{\mathrm{clip}}\leq c\). It leaves every record in the list. If winsorization uses the same upper boundary and replacement rule, its transformed list is identical to the clipped list.

To verify the bound, fix any \(i\). If \(w_i\leq c\), then \(\min(w_i,c)=w_i\), which is nonnegative and no greater than \(c\). If \(w_i>c\), then \(\min(w_i,c)=c\), which is positive and equals the boundary. These two cases cover every \(i\). The record index \(i\) is unchanged in either case, so no record is removed. Applying the same case definition to winsorization with boundary \(c\) gives the same value for each index. Therefore the full lists agree. \(\square\)

This result is an arithmetic statement, not a claim that clipping and deletion have the same statistical consequences. A weighted total or score equation makes the difference explicit. For fixed values \(g_i\), define the original weighted sum \(S=\sum_{i=1}^n w_i g_i\). Clipping gives

$$ S_{\mathrm{clip}} =\sum_{i=1}^n \min(w_i,c)g_i =\sum_{i:w_i\leq c}w_i g_i +c\sum_{i:w_i>c}g_i. $$

Deletion above \(c\), represented with zero weights for excluded records, gives

$$ S_{\mathrm{delete}} =\sum_{i:w_i\leq c}w_i g_i. $$

Subtracting the expressions shows exactly which terms differ:

$$ S_{\mathrm{clip}}-S_{\mathrm{delete}} =c\sum_{i:w_i>c}g_i. $$

Thus the clipped calculation retains a contribution from each record above the boundary; deletion does not. The difference may happen to be zero for particular values of \(g_i\), but the operations are not generally interchangeable.

Common Mistakes, Diagnostics, and Limits

  • Calling a cap deletion. A record with an original weight above \(c\) still contributes under clipping, with weight \(c\). Check that the row remains in the data and has the intended positive replacement weight.
  • Capping the weight but retaining a deletion flag. If a record is removed as well as capped, the analysis is deletion, not ordinary clipping. Check both the transformed weight column and the rows included in the analysis.
  • Assuming the two labels always specify different formulas. With the same boundary and replacement rule, upper clipping and upper winsorization give the same value for every record. Report the operation and boundary rule precisely.
  • Forgetting that weighted totals change. Clipping lowers every weight above \(c\) to \(c\); it does not automatically rescale the resulting list back to its original total. Any additional rescaling is another operation.
  • Checking only the largest transformed weight. A maximum no greater than \(c\) is necessary, but it does not confirm that the correct rows were retained or that all weights were transformed as intended. Compare original and transformed values record by record.

These operations limit the influence of large weights in the arithmetic, but they do not establish that the resulting analysis targets the same quantity as an analysis using the original weights. Nor does a valid list transformation establish that the weight model is correct. The consequences of truncation, cutoff selection, and changes to weighted estimating equations require separate analysis; the mechanics here do not settle those questions.

The practical alternatives are therefore distinct: retain original weights, replace large weights by a boundary, or exclude records according to a rule. Clipping and winsorization retain the full record set but alter some weight values. Deletion changes which records contribute at all. A reproducible report should make clear which option was used, what boundary or deletion rule was applied, and how many values or records it affected.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. For weights \((1,3,6)\), what are the upper-clipped weights at \(c=4\), and how many records remain?
  2. For weights \((1,3,6)\), what list remains after deleting weights above \(4\)? How does it differ from clipping?
  3. Suppose \(w_i>c\). What is its contribution to \(\sum_i w_i g_i\) after clipping, and after deletion?
  4. Can clipping and winsorization produce different numerical lists when they use the same upper boundary and replacement rule?

Solutions. (1) The clipped list is \((1,3,4)\); all three records remain. (2) The retained list is \((1,3)\); the record with weight \(6\) is absent, rather than retained at weight \(4\). (3) Clipping contributes \(cg_i\); deletion contributes \(0\). (4) No. Under the stated convention both replace each weight by \(\min(w_i,c)\), so every resulting entry is identical.

Clinical Biostats