Why Estimated Weights Change the Variance
A weighted pooled logistic model uses treatment weights to estimate a marginal discrete-time hazard model. When those weights are estimated from the study data, their values vary across repeated samples. A variance calculation that treats them as fixed captures variability in the outcome-model score but omits the way changes in the fitted treatment models change the weights—and therefore the outcome estimate.
This distinction concerns uncertainty, not the definition of the weighted estimator. The point estimate remains the solution to the weighted outcome score equation. The question is whether inference also accounts for estimation of the treatment-model parameters used to construct its weights. Robust variance for pooled logistic survival MSMs allows for within-person dependence in the outcome contributions; by itself, it does not automatically account for estimated weights.
The sum over intervals makes \(u_i\) a subject-level contribution. Variance calculations should preserve that clustering: intervals from one subject are not independent observations. The same subject-level principle applies to the treatment-model score. If several models are used to form stabilized weights, \(\alpha\) collects the parameters from all of them.
Joint Estimating Equations and the Influence Function
For clarity, suppose first that the treatment nuisance parameter solves \(n^{-1}\sum_i v_i(\alpha)=0\). Define \(\eta=(\theta^{\mathsf T},\alpha^{\mathsf T})^{\mathsf T}\), and suppose the population equations have a unique solution \((\theta_0,\alpha_0)\). Use the following blocks of the negative expected derivative matrix, evaluated at that solution:
The nuisance equations do not depend on \(\theta\), so the full negative derivative matrix is block lower triangular. Assume independent and identically distributed subjects; finite second moments for the score contributions; differentiable estimating functions in a neighbourhood of the solution; nonsingular diagonal derivative blocks; and consistent roots. Sufficient regularity for the Taylor expansions below includes locally bounded derivatives and a uniform law of large numbers for those derivatives. These conditions yield the following first-order result.
Derivation. A first-order Taylor expansion of the empirical nuisance equation around \(\alpha_0\) gives \(0=n^{-1}\sum_i v_i(\alpha_0)-H_{\alpha\alpha}(\hat\alpha-\alpha_0)+o_p(n^{-1/2})\). Thus $$ \sqrt n(\hat\alpha-\alpha_0) = H_{\alpha\alpha}^{-1}\frac{1}{\sqrt n}\sum_i v_i(\alpha_0)+o_p(1). $$ Expanding the outcome equation around \((\theta_0,\alpha_0)\) gives $$ \sqrt n(\hat\theta-\theta_0) = H_{\theta\theta}^{-1} \left\{ \frac{1}{\sqrt n}\sum_i u_i(\theta_0,\alpha_0) - H_{\theta\alpha}\sqrt n(\hat\alpha-\alpha_0) \right\} +o_p(1). $$ Substitution yields the stated subject-level influence contribution. The multivariate central limit theorem applies to the sum of these independent, mean-zero contributions with finite covariance, proving the distributional result. \(\square\)
The term involving \(v_i\) is the adjustment for estimated weights. It incorporates both the sensitivity of the outcome score to \(\alpha\) and the sampling variability of the treatment-model score. Its covariance with the outcome score matters: the adjustment can increase or decrease the variance. It is not generally correct to calculate the fixed-weight variance and then add a separate variance for \(\hat\alpha\).
Worked Example: The Adjustment Can Reduce the Variance
Consider a scalar outcome parameter and a scalar weight-model parameter. Suppose the derivative blocks are \(H_{\theta\theta}=2\), \(H_{\theta\alpha}=0.6\), and \(H_{\alpha\alpha}=3\). Suppose also that \(\operatorname{Var}(u_i)=4\), \(\operatorname{Var}(v_i)=1\), and \(\operatorname{Cov}(u_i,v_i)=0.5\).
If the weights are treated as fixed, the influence contribution is \(u_i/2\), so its variance is \(4/2^2=1\). With estimated weights, the theorem gives $$ \operatorname{IF}_{\theta,i} = \frac{1}{2}\left(u_i-\frac{0.6}{3}v_i\right) = \frac{1}{2}(u_i-0.2v_i). $$
Using \(\operatorname{Var}(aU+bV)=a^2\operatorname{Var}(U)+b^2\operatorname{Var}(V)+2ab\operatorname{Cov}(U,V)\), $$ \operatorname{Var}(\operatorname{IF}_{\theta,i}) = \frac{1}{4}\{4+0.2^2(1)-2(0.2)(0.5)\} = \frac{3.84}{4} = 0.96. $$ Thus the joint-estimation variance is \(0.96/n\), compared with \(1/n\) from the fixed-weight calculation. Here the positive covariance makes the correction reduce variance. This is a feature of these particular derivative and covariance values, not a general rule.
Estimating the Joint Sandwich Variance
In practice, replace population derivatives and covariances by sample estimates. At the fitted values, let \(\hat\phi_i\) be the estimated version of the theorem’s influence contribution. The sandwich covariance estimate is $$ \widehat{\operatorname{Var}}(\hat\theta) = \frac{1}{n^2}\sum_{i=1}^n (\hat\phi_i-\bar{\hat\phi})(\hat\phi_i-\bar{\hat\phi})^{\mathsf T}, \qquad \bar{\hat\phi}=\frac{1}{n}\sum_i\hat\phi_i. $$
Equivalent computation uses the full joint estimating-equation vector and its empirical derivative and score covariance matrices, then extracts the \(\theta\) block of the sandwich. The joint formulation is especially useful when weights involve several treatment models, normalization steps, or other estimated nuisance parameters. Each parameter that is estimated from the same sample and enters the outcome estimating equation must be represented in the joint calculation, with its appropriate estimating equation and derivative blocks.
Worked Example: A Joint Variance That Is Larger
Keep \(H_{\theta\theta}=2\), \(H_{\theta\alpha}=0.6\), and \(H_{\alpha\alpha}=3\), but suppose \(\operatorname{Var}(u_i)=4\), \(\operatorname{Var}(v_i)=1\), and \(\operatorname{Cov}(u_i,v_i)=-0.5\). The fixed-weight variance is still \(1/n\). Now $$ \operatorname{Var}(\operatorname{IF}_{\theta,i}) = \frac{1}{4}\{4+0.2^2(1)-2(0.2)(-0.5)\} = \frac{4.24}{4} = 1.06. $$
The joint estimate therefore has asymptotic variance \(1.06/n\), larger than the fixed-weight value \(1/n\). The negative covariance reverses the direction of the adjustment. Both this example and the preceding one show why the effect of estimating weights cannot be inferred from the fact that weights are estimated alone; the derivative and score covariance determine the result.
Subject-Level Bootstrap
A bootstrap offers another way to account for weight estimation without deriving every derivative analytically. Resample the independent sampling units, not the person-period rows, and repeat the complete estimation procedure in every replicate. If subjects are sampled within clusters, resample the independent clusters instead. In a replicate, refit all treatment models, reconstruct the weights, and refit the weighted pooled logistic model. For a target such as a treatment coefficient or a contrast of fitted regime risks, recalculate that target from the replicate’s fitted parameters.
Draw \(n\) subjects with replacement from the observed independent subjects, retaining each selected subject’s full follow-up record.
Refit every treatment model and reconstruct the treatment weights using the replicate’s fitted parameters.
Fit the weighted pooled logistic model using the replicate weights and compute the target estimate.
Use the empirical spread of the replicate estimates for a standard error, or construct an interval using an appropriate bootstrap method.
Worked Example: Bootstrap Standard Error for a Treatment Coefficient
Suppose five illustrative subject-level bootstrap replicates, each with weights refitted, produce treatment-coefficient estimates \(0.18, 0.22, 0.20, 0.15,\) and \(0.25\). Their mean is $$ \bar\theta^*=\frac{0.18+0.22+0.20+0.15+0.25}{5}=0.20. $$
The squared deviations from \(0.20\) are \(0.0004, 0.0004, 0, 0.0025,\) and \(0.0025\). Their sum is \(0.0058\), so the sample standard deviation of these replicates is $$ \sqrt{\frac{0.0058}{5-1}} = \sqrt{0.00145} \approx 0.0381. $$ This is a miniature illustration of the calculation, not a recommended replicate count: real analyses generally use many more replicates so that standard errors and interval endpoints are stable. If the weights had been held at their original values in each replicate, this procedure would not capture the sampling variability from re-estimating the treatment models.
Choosing and Checking an Approach
The joint sandwich and the subject-level bootstrap target the same underlying issue but have different practical demands. A joint sandwich can be computationally efficient and makes the source of the adjustment explicit, but requires correct estimating equations and derivatives, including those for all weight-estimation steps. A bootstrap is often easier to implement when the full pipeline is available as reproducible code, but can be computationally expensive and may behave poorly when the estimator is unstable or nonregular. Neither approach repairs a misspecified treatment model, a failure of positivity, or an invalid causal identification strategy.
| Approach | What it accounts for | Practical caution |
|---|---|---|
| Fixed-weight robust sandwich | Subject-level outcome-score variability with the fitted weights held fixed | Does not generally include weight-estimation variability |
| Joint estimating-equation sandwich | Outcome and treatment-model estimating variability, including their covariance | Requires the complete set of equations and derivative blocks |
| Subject-level bootstrap | Repeated-sample variation from refitting weights and outcome model | Must resample the independent units and rerun every estimation step |
Diagnostics should accompany either method. Check whether the treatment models converge in the original sample and in bootstrap replicates; inspect extreme weights and the distribution of weights across follow-up; and examine whether a small number of subjects dominate the weighted score. A large fraction of failed bootstrap fits, highly unstable standard errors as the replicate count increases, or frequent separation signals that the usual smooth, approximately normal inference may be unreliable. Weight truncation may reduce the influence of extreme values, but changes the estimator and does not make the original uncertainty calculation automatically valid; any truncation rule used in the analysis must be applied within each bootstrap replicate.
For a smooth scalar target \(g(\theta)\), the joint sandwich also supports derived quantities. If \(g\) is differentiable at \(\theta_0\), a first-order Taylor expansion gives $$ \sqrt n\{g(\hat\theta)-g(\theta_0)\} = \nabla g(\theta_0)^{\mathsf T}\sqrt n(\hat\theta-\theta_0)+o_p(1), $$ so its asymptotic variance is \(\nabla g(\theta_0)^{\mathsf T}\Omega\nabla g(\theta_0)/n\). For example, for \(g(\theta)=\exp(\theta_j)\), the gradient has \(j\)th component \(\exp(\theta_j)\) and zero in the other components. The same target can be recomputed in each bootstrap replicate.
Common Mistake
A common mistake is to say, “The weights were estimated once, so the robust outcome sandwich already includes their uncertainty because the fitted weights appear in every subject’s score.” The correction is that the fixed-weight sandwich uses those fitted values as constants when forming the outcome-score variability. It does not account for how the fitted treatment parameters would change across repeated samples, or how that change would alter the weighted outcome estimate. Use a joint estimating-equation sandwich or refit the weights in every subject-level bootstrap replicate when inference is intended to include weight estimation.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- What source of variability is omitted by a robust outcome sandwich that treats estimated weights as fixed?
- In the scalar influence-function formula, which quantities determine whether weight estimation raises or lowers the variance?
- In a bootstrap of a pooled logistic MSM, what should be resampled, and which models must be refitted?
- Suppose \(H_{\theta\theta}=1\), \(H_{\theta\alpha}=0\), and \(H_{\alpha\alpha}\) is nonsingular. How does the weight-estimation adjustment affect the first-order influence function?
Solutions. (1) It omits the repeated-sample variability in the estimated treatment-model parameters and the resulting change in the weights and outcome estimate. (2) The derivative blocks, the variances of both score contributions, and their covariance determine the adjustment; there is no universal direction of change. (3) Resample independent subjects, or independent clusters when appropriate, retaining full follow-up records; refit all treatment models, reconstruct weights, and refit the outcome model. (4) The adjustment term is zero because \(H_{\theta\alpha}=0\), so the first-order influence function is \(u_i\). This does not rule out higher-order effects or other sources of uncertainty not represented in the stated equations.