Why the Origin of the Weights Matters
A weighted Cox fit uses treatment weights to form its risk-set score. If those weights were estimated from the same study data, they are random too. The uncertainty in the fitted treatment-effect parameter can therefore depend on both the outcome score and the way the weight estimates vary across samples. Treating estimated weights as fixed answers a narrower question: how variable would the outcome fit be if these particular weights were held unchanged?
This distinction is about uncertainty, not a change to the fitted coefficient. For a weighted Cox estimator, the coefficient may be computed identically under either approach; what changes is its variance estimate. The discussion below assumes independent study participants, with each participant’s complete repeated-interval record treated as one sampling unit.
Here \(u_i\) is the contribution of participant \(i\) to the weighted Cox score, including that participant’s event and risk-set contributions. It is a participant-level contribution even when the data have several rows per participant. If more than one model is used to construct the weights, \(\alpha\) and \(q_i\) can collect all their parameters and estimating equations.
Joint Estimating Equations and Their Variance
Suppose the treatment-weight model has a well-defined population parameter \(\alpha_0\), satisfying \(E[q_i(\alpha_0)]=0\), and the weighted Cox target \(\beta_0\) satisfies \(E[u_i(\beta_0,\alpha_0)]=0\). Define the expected derivatives
with derivatives evaluated at \((\beta_0,\alpha_0)\) for \(A,B\), and at \(\alpha_0\) for \(C\). Assume these matrices are finite and nonsingular where required, the equations are differentiable near their targets, their sample derivatives converge to these expectations, and the participant-level scores have finite second moments. Also assume the estimating equations have consistent roots and a joint central limit theorem applies. These regularity conditions exclude, for example, a treatment-model estimate at a separation boundary or a weight model whose parameters cannot be identified.
Derivation. Expand the two sample equations around their population roots. The first-order terms are
and
The second equation gives \(\hat\alpha-\alpha_0=-C^{-1}n^{-1}\sum_i q_i+o_p(n^{-1/2})\). Substituting this into the first equation yields
The central limit theorem applied to the mean of the bracketed participant contributions gives the stated variance. In practice, estimate \(A,B,C\) by sample derivatives and estimate \(\Omega\) by the sample covariance of the fitted contributions \(u_i-\hat B\hat C^{-1}q_i\). This is a joint sandwich calculation: the same participant contributes to both equations, so their covariance is retained. The minus sign in the influence function does not affect its covariance.
By contrast, a conditional-on-weights calculation uses the outcome-score contribution \(u_i\) alone and treats the fitted \(\hat\alpha\) as nonrandom. Its first-order variance is based on \(A^{-1}\operatorname{Var}(u_i)A^{-\mathsf{T}}/n\). That calculation can be appropriate when the weights really are fixed externally and the inferential target is conditional on them. It does not, by itself, represent uncertainty from estimating the weights in the study at hand.
Worked Example: The Nuisance-Estimation Term Changes the Variance
Consider a scalar illustration with \(A=2\), \(B=1\), and \(C=2\). Suppose the participant-level scores at the target have \(\operatorname{Var}(u_i)=1\), \(\operatorname{Var}(q_i)=4\), and \(\operatorname{Cov}(u_i,q_i)=0\). The joint influence contribution is
First, \(\operatorname{Var}(u_i-\frac12q_i)=\operatorname{Var}(u_i)+\frac14\operatorname{Var}(q_i)-\operatorname{Cov}(u_i,q_i)=1+1-0=2\). Therefore \(\operatorname{Var}(\phi_i)=\frac14(2)=0.5\), and the approximate variance of \(\hat\beta\) is \(0.5/n\). If \(\alpha\) were treated as fixed, the corresponding variance would be \(\operatorname{Var}(u_i)/A^2n=1/(4n)=0.25/n\). In this example, fixing the estimated weight parameter understates the first-order variance by a factor of two. The values illustrate the formula; they are not universal properties of weighted Cox fits.
Full-Pipeline Bootstrap
A bootstrap can capture weight-estimation uncertainty without explicitly calculating \(B\) and \(C\). The essential requirement is to repeat the entire estimation procedure in every replicate: resample independent participants, fit the treatment or censoring models used for the weights, construct the weights, and refit the weighted Cox model. With repeated intervals, resample participants and carry all their intervals together. Resampling rows independently would break the within-person structure.
Draw \(n\) participants with replacement, retaining all records for each selected participant.
Refit every model that estimated a component of the weights, then reconstruct weights in the resampled data.
Fit the weighted Cox model using the replicate’s weights and record \(\hat\beta^{(b)}\).
Use the empirical spread of the replicate estimates as a bootstrap estimate of sampling variability, provided the fitting procedure is stable and the bootstrap is appropriate for the sampling design.
Under the same smoothness and sampling conditions that give the joint influence representation, the bootstrap reproduces its first-order variation. In outline, the full estimator is a smooth function of empirical averages of the outcome and weight-model contributions. Resampling participants perturbs both sets of averages together; refitting both models applies the same function to those perturbed averages. The conditional bootstrap central limit theorem therefore reproduces the joint first-order distribution, including the covariance between \(u_i\) and \(q_i\). Holding the original weights fixed instead perturbs only the outcome fit, so it cannot reproduce the \(q_i\) component or its covariance with \(u_i\). This justification does not guarantee good finite-sample behavior when the fitted procedure is unstable.
Worked Example: A Small Bootstrap Summary
Suppose an analysis reports \(\hat\beta=0.40\). For illustration, five full-pipeline bootstrap replicates give \(0.20, 0.30, 0.40, 0.50, 0.60\). Their mean is \(0.40\), and their squared deviations from the mean sum to
The usual sample variance of these five replicate estimates is \(0.10/(5-1)=0.025\), giving a bootstrap standard error of \(\sqrt{0.025}\approx0.158\). If an outcome-only calculation that holds weights fixed had instead reported a standard error of \(0.08\), the difference would signal that the two calculations represent different sources of variation. Five replicates are far too few for a reliable standard-error estimate in a real analysis; this arithmetic only demonstrates how the summary is calculated.
Worked Example: Weight Estimation Can Affect a Risk-Set Score
Consider one risk set with two participants: an event participant with covariate \(x=1\), and a non-event participant with \(x=0\). Let the event participant’s weight be \(1\), and let the other participant’s weight be \(e^\alpha\), with outcome-model coefficient \(\beta\). The weighted risk-set mean of \(x\) is \(e^\beta/(e^\beta+e^\alpha)\), so the event’s score contribution is
At \(\beta=0,\alpha=0\), this contribution is \(1-\frac12=\frac12\). Its sensitivity to the weight parameter is
Thus even this single risk set has a nonzero derivative with respect to the parameter that determines the weight. In a full analysis, such derivatives across risk sets contribute to \(B\). This calculation does not imply a particular direction for the variance change: the result also depends on the variability of the weight-model score and its covariance with the Cox score.
Choosing an Approach and Checking Stability
| Approach | What varies | When it is useful | Main caution |
|---|---|---|---|
| Outcome fit with supplied weights held fixed | Outcome score, conditional on the weight values | Weights are genuinely external and the target is conditional on them | Misses study-sample weight-estimation uncertainty when weights were estimated internally |
| Joint estimating-equation sandwich | Outcome and weight-model scores, including their covariance | Equations and derivatives can be specified and computed reliably | Requires correct participant-level contributions and stable derivative estimates |
| Full-pipeline participant bootstrap | All re-estimated steps, through the final Cox fit | The complete analysis pipeline can be refit in each replicate | May be unstable or computationally costly; failed fits must be investigated, not silently discarded |
The joint sandwich and full-pipeline bootstrap are alternatives for propagating estimated-weight uncertainty, not substitutes for sound modeling. A practical diagnostic is to compare the joint sandwich standard error and the full-pipeline bootstrap spread when both are feasible. Large disagreement can indicate finite-sample instability, an implementation error, or a distribution for which the chosen approximation is poor. Also inspect whether treatment-model fits fail, estimated weights become extreme, or bootstrap replicates have very different weight distributions. These patterns can make either variance estimate unreliable.
If weights are truncated, the bootstrap must repeat the prespecified truncation rule in each replicate. If the truncation thresholds themselves were selected from the data, that selection step should also be repeated to reflect its variability. Likewise, any estimated censoring-weight model belongs in the re-estimation pipeline. A bootstrap that refits treatment weights but leaves another estimated weight component fixed is only partially propagating uncertainty.
Neither approach repairs a misspecified treatment model, a lack of positivity, or an outcome target that is not identified under the study assumptions. Extreme weights can cause a few participants to dominate the fit, and bootstrap replicates may expose this by producing unusually large coefficients or failed fits. Report the number and handling of failed replicates and investigate their causes. Do not present the spread of successful replicates as if failures were irrelevant.
Common pitfall: “The weights are already in the data, so their estimation is irrelevant to the Cox standard error.” This confuses having weight values available with knowing them without error. If they were estimated from the same participants, their sampling variation is part of the estimator’s variation. The correction is to state the inferential target: use a conditional calculation only when conditioning on fixed supplied weights is intended; otherwise propagate the weight-estimation step using joint equations or a full-pipeline resampling procedure.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- What source of variation does an outcome fit with weights held fixed omit when those weights were estimated in the study?
- Why does the joint influence contribution include \(BC^{-1}q_i\), rather than only the Cox score \(u_i\)?
- For repeated-interval data, what should be resampled in a full-pipeline bootstrap?
- In the scalar worked example, what is the joint variance contribution per participant, and what is the fixed-weight contribution?
Solutions. (1) It omits variation in the estimated weight-model parameter and its covariance with the outcome score. (2) The weight-model equation implies \(\hat\alpha-\alpha_0\approx-C^{-1}n^{-1}\sum_i q_i\); substituting this variation into the Cox equation produces the \(BC^{-1}q_i\) term. (3) Resample independent participants, carrying each selected participant’s complete set of intervals together, then refit the weight models and Cox model. (4) The joint contribution is \(0.5/n\), while the fixed-weight contribution is \(0.25/n\), using the stated scalar values.