Why Inference Needs the Estimating Equations
G-estimation returns an estimate of a blip parameter, but a point estimate alone does not show how much it might vary across comparable samples. Inference quantifies this sampling uncertainty: it gives a standard error, an interval of plausible parameter values under the model, and a basis for testing a specified null value. This is especially important in longitudinal analyses, where a parameter may be estimated using treatment residuals, blipped-down outcomes, and nuisance models for treatment or censoring.
The variance calculation must reflect how the estimate was actually obtained. In particular, if nuisance parameters were estimated from the same data, their sampling variability can contribute to uncertainty in the blip estimate. A sandwich variance based on the full estimating system, or a bootstrap that repeats the full analysis, can account for that contribution. Neither method, by itself, repairs confounding, positivity problems, or a misspecified blip model.
Conditions for Large-Sample Inference
Write the estimating equation for the blip parameter \(\beta\) as \(U_n(\beta,\eta)=n^{-1}\sum_{i=1}^n\psi(O_i;\beta,\eta)=0\). Here \(O_i\) denotes the observed data for independent unit \(i\), \(\psi\) is the contribution to the g-estimating equation, and \(\eta\) collects nuisance parameters such as parameters in treatment or censoring models. The notation allows a longitudinal record for one person to be treated as a single unit; the contribution \(\psi\) can use all that person's observed visits.
The usual large-sample standard errors and confidence intervals require more than solving this equation. The blip model and the identifying conditions must be appropriate for the causal target. In particular, the analysis requires consistency, sequential exchangeability given the modeled history, and positivity for the treatment comparisons of interest. If censoring is present, the censoring assumptions and positivity conditions used to identify the target must also hold. The estimating procedure must use suitable nuisance models or otherwise valid nuisance estimates. For the asymptotic approximation, assume independent units, a differentiable estimating equation, finite second moments, a nonsingular derivative matrix, and a consistent root of the equation.
Under these conditions, an estimator is often approximately normal in large samples. The variance depends on both the variability of the individual estimating contributions and how sensitive the estimating equations are to changes in the parameters. That combination is the basis of the sandwich estimator.
Sandwich Variance and Its Derivation
If nuisance parameters are estimated, place the blip parameter and nuisance parameters together in \(\theta=(\beta^\mathsf{T},\eta^\mathsf{T})^\mathsf{T}\). Let \(\phi(O_i;\theta)\) stack the estimating contribution for \(\beta\) with the estimating contributions used to estimate \(\eta\). For example, the nuisance part may contain likelihood or other estimating-equation contributions for treatment and censoring models. Define \(A=E[\partial\phi(O_i;\theta_0)/\partial\theta^\mathsf{T}]\) and \(B=E[\phi(O_i;\theta_0)\phi(O_i;\theta_0)^\mathsf{T}]\), where \(\theta_0\) is the true parameter vector under the model.
Here \(\hat{A}\) is the sample derivative matrix, \(\hat{B}\) is the empirical covariance matrix of the stacked contributions, and the \(\beta\beta\) submatrix selects the blip-parameter variances and covariances. The empirical covariance can be calculated from the centered contributions; when the estimating equations are solved exactly, their sample means are zero and centering does not change the result. The standard error for a component of \(\hat{\beta}\) is the square root of its estimated variance.
The reason nuisance estimation matters follows from a Taylor expansion. For a consistent estimator \(\hat{\theta}\) solving \(n^{-1}\sum_i\phi(O_i;\hat{\theta})=0\), expand around \(\theta_0\). The remainder is negligible at the scale \(n^{-1/2}\) under the regularity conditions above:
Rearranging gives the first-order approximation \(\hat{\theta}-\theta_0\approx-A^{-1}n^{-1}\sum_i\phi(O_i;\theta_0)\). The central limit theorem gives the sample average of the contributions an approximate covariance \(B/n\). Multiplying on the left by \(A^{-1}\) and on the right by its transpose yields \(A^{-1}BA^{-\mathsf{T}}/n\). This derivation also explains why treating an estimated nuisance parameter as fixed can give an incorrect standard error: it omits the nuisance equations and their contribution to the joint variation.
A sandwich variance allows the variance of the estimating contributions to differ from the variance implied by a fully specified likelihood model. It does not make the causal assumptions unnecessary. Nor does it guarantee valid inference if the blip model is wrong or the estimating equations do not identify the intended causal parameter.
Worked Example: A Scalar Blip Estimate
Suppose a hypothetical analysis estimates a blip parameter \(\beta\), measured as the mean change in a symptom score per treatment unit. The estimate is \(0.180\) score points per treatment unit. After accounting for the fitted nuisance equations, suppose the scalar derivative estimate is \(\hat{A}=2.50\), and the empirical variance of the individual estimating contributions is \(\hat{B}=1.44\). There are \(n=400\) independent participants.
For a scalar parameter, the sandwich variance is \(\hat{B}/(n\hat{A}^2)\). Substitution gives \(\widehat{\operatorname{Var}}(\hat{\beta})=1.44/[400(2.50)^2]=1.44/2500=0.000576\). Thus the standard error is \(\sqrt{0.000576}=0.0240\) score points per treatment unit.
A 95% Wald confidence interval is the estimate plus or minus 1.96 standard errors: \(0.180\pm1.96(0.0240)=0.180\pm0.0470\), giving \((0.133,0.227)\) score points per treatment unit. Under the model and large-sample approximation, this procedure has 95% coverage over repeated samples. It does not mean there is a 95% probability that this fixed parameter lies in this particular interval.
For the two-sided Wald test of \(H_0:\beta=0\), the statistic is \(z=0.180/0.0240=7.50\). The corresponding two-sided normal-reference p-value is below 0.0001. This is evidence against a zero blip parameter under the stated model and assumptions; it is not a probability that the null hypothesis is true.
Intervals and Tests for Several Blip Parameters
When the blip function includes multiple parameters, the covariance between their estimates matters. For example, a model may include an average blip and a parameter describing how that blip varies with a baseline characteristic. Each coefficient has a marginal standard error from the diagonal of the covariance matrix, while joint contrasts require the full matrix.
For a scalar contrast \(c^\mathsf{T}\beta\), its estimated variance is \(c^\mathsf{T}\widehat{\operatorname{Var}}(\hat{\beta})c\). A Wald interval uses the contrast estimate plus or minus 1.96 times its standard error for a large-sample 95% interval. A joint Wald test of \(H_0:R\beta=r\) uses the estimated covariance of \(R\hat{\beta}\); the resulting statistic is compared with a chi-squared distribution with degrees of freedom equal to the number of independent restrictions, when the regularity conditions hold.
Worked Example: Joint Inference for Two Blip Parameters
Consider hypothetical estimates for a blip function with an intercept and a treatment-effect modifier, \(\hat{\beta}=(0.40,-1.20)^\mathsf{T}\). The first parameter is measured in symptom-score points per treatment unit for the reference group. The second is the change in that blip per one-unit increase in the modifier. Suppose \(n=100\), and the derivative and contribution-covariance matrices are \( \hat{A}=\begin{pmatrix}2&0\\0&1\end{pmatrix}\) and \(\hat{B}=\begin{pmatrix}4&1\\1&9\end{pmatrix}\).
The inverse derivative is \(\hat{A}^{-1}=\begin{pmatrix}0.5&0\\0&1\end{pmatrix}\). Therefore \(\hat{A}^{-1}\hat{B}\hat{A}^{-\mathsf{T}}=\begin{pmatrix}1&0.5\\0.5&9\end{pmatrix}\), and dividing by \(n=100\) gives \(\widehat{\operatorname{Var}}(\hat{\beta})=\begin{pmatrix}0.010&0.005\\0.005&0.090\end{pmatrix}\). The standard errors are \(\sqrt{0.010}=0.100\) and \(\sqrt{0.090}=0.300\), in the corresponding parameter units.
The 95% Wald interval for the first parameter is \(0.40\pm1.96(0.100)=(0.204,0.596)\) symptom-score points per treatment unit. For the modifier parameter it is \(-1.20\pm1.96(0.300)=(-1.788,-0.612)\) blip points per modifier unit. These intervals address each parameter separately. A joint claim about both parameters must use their covariance of \(0.005\), not treat the two estimates as independent.
Bootstrap Inference
A nonparametric bootstrap estimates sampling variability by repeatedly resampling independent units with replacement and repeating the analysis. For longitudinal data, the resampling unit is generally the person, not an individual visit, so that within-person dependence is retained. In each replicate, refit the nuisance models, reconstruct any blipped-down outcomes, apply the same censoring procedure, and solve the same g-estimating equations. This repetition is essential: holding nuisance estimates fixed would fail to reproduce their sampling variation.
The standard deviation of the bootstrap estimates can serve as a bootstrap standard error. A percentile interval uses the appropriate quantiles of the bootstrap estimates; for a 95% interval, these are commonly the 2.5th and 97.5th percentiles. Bootstrap inference still relies on the study design and identification assumptions, and can perform poorly when estimates are unstable, treatment variation is sparse, or the estimator is not regular. A bootstrap does not turn a biased or unidentified estimate into a valid causal estimate.
Worked Example: A Subject-Level Bootstrap Interval
In a hypothetical study of 120 participants, the estimated blip parameter is \(0.55\) symptom-score points per treatment unit. The analyst draws \(R=2{,}000\) bootstrap samples by resampling participants, and refits the full g-estimation procedure, including treatment and censoring models, in every sample. The mean of the bootstrap estimates is \(0.52\), and their sum of squared deviations from that bootstrap mean is \(719.64\).
The estimated bootstrap variance is \(719.64/(2{,}000-1)=0.3600\), so the bootstrap standard error is \(\sqrt{0.3600}=0.600\) symptom-score points per treatment unit. Suppose the 2.5th and 97.5th percentiles of the ordered bootstrap estimates are \(-0.62\) and \(1.72\). The percentile 95% interval is therefore \((-0.62,1.72)\) symptom-score points per treatment unit.
The interval includes zero, indicating that these bootstrap results do not rule out a zero blip at the 5% two-sided level using this interval as the inferential procedure. The bootstrap mean, \(0.52\), need not equal the original estimate, \(0.55\); the interval is formed from the bootstrap distribution, not by centering the percentile endpoints on the original estimate.
A Practical Inference Workflow
Name the blip parameter, its units, the identifying assumptions, and the treatment and censoring models required by the analysis.
Identify the g-estimating equations and all nuisance estimating equations. Keep repeated observations grouped within their independent subject.
Use the full sandwich covariance or bootstrap the independent units and repeat the complete estimation procedure.
Give the estimate, standard error, interval, and units. Explain which blip it represents and distinguish sampling uncertainty from uncertainty about the causal assumptions.
Common Pitfalls
- Ignoring nuisance estimation. The wrong reasoning is that a treatment or censoring model is only a preparatory step, so its estimates can be treated as fixed. The correction is to include its estimating equations in the sandwich calculation or refit it in every bootstrap replicate, unless a justified variance method already accounts for it.
- Resampling visits instead of people. This breaks the observed within-person dependence in longitudinal records. Resample independent participants, retaining each selected participant's full record.
- Calling a robust standard error protection against model failure. Robust variance estimation addresses certain forms of variance misspecification. It does not correct unmeasured confounding, positivity violations, or an incorrect blip model.
- Interpreting a confidence interval as a probability statement about a fixed parameter. The confidence level describes the long-run coverage of the interval procedure under its assumptions, not the probability that a particular computed interval contains the parameter.
Check Your Understanding
Use the definitions and procedures in this tutorial to answer the following questions.
- Why can a sandwich standard error that treats an estimated treatment model as fixed be too small or otherwise incorrect?
- For a longitudinal study with repeated visits per person, what should be resampled in a nonparametric bootstrap, and why?
- If a blip estimate is \(0.30\) with standard error \(0.10\), calculate its large-sample 95% Wald interval and state the units that should accompany it.
- What does a sandwich variance allow to differ from a model-based variance, and which causal assumptions does it leave untouched?
- Why does a percentile bootstrap interval not have to be centered on the original g-estimate?