Tutorials › Marginal Structural Models › Influence-Curve Standard Errors

Longitudinal Targeted Maximum Likelihood · Tutorial 378 of 501

Influence-Curve Standard Errors

Use the full subject-level efficient influence function to estimate variance for longitudinal TMLE means and contrasts, while checking the assumptions and calculations that make those standard errors reliable.

Advanced 12 min read

What You'll Learn

  • Compute a longitudinal TMLE standard error from the empirical variance of subject-level EIF values.
  • Distinguish the standard error of a mean estimate from the estimated variance of its EIF.
  • Preserve within-subject covariance when estimating standard errors for treatment contrasts.
  • Derive influence-function standard errors for risk differences and risk ratios.
  • Assess the conditions needed for asymptotic and variance-estimation validity.
  • Identify diagnostics and common errors that can make EIF standard errors misleading.

Why the Influence Curve Gives a Standard Error

A longitudinal TMLE produces a point estimate, but the estimate alone does not indicate how much it would vary across repeated samples. Its efficient influence function (EIF) provides the subject-level contributions used to estimate that sampling variability. The calculation is subject-level even when each subject contributes measurements at several treatment and covariate times: the repeated observations are combined into one EIF value per subject.

For a regime \(d\), write \(\psi_d\) for the regime-specific mean and \(D_d^*(P)(O)\) for its EIF, evaluated at the true data distribution \(P\) for a subject's full observed data \(O\). The EIF has mean zero and, under the usual regularity conditions, describes the first-order sampling variation of a regular estimator. In practice \(P\) is unknown, so we evaluate the corresponding EIF expression using the fitted nuisance functions, targeting updates, and plug-in estimate.

Definition: Let \(O_1,\ldots,O_n\) be independent, identically distributed subjects. Let \(\hat D_{d,i}\) be the estimated EIF for subject \(i\), calculated using the complete longitudinal EIF expression for regime \(d\). Define \(\bar{\hat D}_d=n^{-1}\sum_{i=1}^n\hat D_{d,i}\) and $$ \hat\sigma_d^2=\frac{1}{n-1}\sum_{i=1}^n(\hat D_{d,i}-\bar{\hat D}_d)^2. $$ The estimated variance of the TMLE is \(\hat\sigma_d^2/n\), and its estimated standard error is \(\hat\sigma_d/\sqrt n\).

The division by \(n\) is essential: \(\hat\sigma_d^2\) estimates the variance of one subject's influence value, while the variance of the sample mean of those contributions is approximately \(\operatorname{Var}(D_d^*)/n\). Centering by the empirical mean is appropriate even if the fitted EIF values do not sum to exactly zero.

Conditions and Justification

Two claims are involved in using this standard error. First, the estimator must have an asymptotically linear representation. Second, the empirical variance of its estimated EIF values must consistently estimate the variance of the true EIF. The first claim does not follow merely from computing an EIF; it depends on the estimator, nuisance estimation, and regularity conditions.

Theorem: Suppose the subjects are independent and identically distributed, \(\psi_d\) is a regular parameter, and \(D_d^*(P)(O)\) is its mean-zero EIF with \(0<\sigma_d^2=\operatorname{Var}\{D_d^*(P)(O)\}<\infty\). If $$ \hat\psi_d-\psi_d=\frac{1}{n}\sum_{i=1}^n D_d^*(P)(O_i)+o_p(n^{-1/2}), $$ then \(\sqrt n(\hat\psi_d-\psi_d)\xrightarrow{d}N(0,\sigma_d^2)\). If, in addition, the estimated EIF values satisfy $$ \frac{1}{n}\sum_{i=1}^n\left\{\hat D_{d,i}-D_d^*(P)(O_i)\right\}^2\xrightarrow{p}0, $$ then \(\hat\sigma_d^2\xrightarrow{p}\sigma_d^2\), so \(\hat\sigma_d/\sqrt n\) consistently estimates the estimator's standard error to first order.

Proof of the distributional claim. The asymptotic linear representation gives $$ \sqrt n(\hat\psi_d-\psi_d)=\frac{1}{\sqrt n}\sum_{i=1}^nD_d^*(P)(O_i)+o_p(1). $$ The summands are independent and identically distributed, have mean zero, and have finite variance \(\sigma_d^2\). The central limit theorem therefore gives convergence of the sum to \(N(0,\sigma_d^2)\). Slutsky's theorem allows the \(o_p(1)\) remainder without changing that limit.

Proof of variance consistency. Abbreviate \(D_i=D_d^*(P)(O_i)\), \(e_i=\hat D_{d,i}-D_i\), and let \(A_n=n^{-1}\sum_i e_i^2\) and \(B_n=n^{-1}\sum_iD_i^2\). By assumption \(A_n\xrightarrow{p}0\), and by the law of large numbers \(B_n\xrightarrow{p}\sigma_d^2\). Cauchy–Schwarz gives $$ \left|\frac{1}{n}\sum_{i=1}^n\hat D_{d,i}^2-\frac{1}{n}\sum_{i=1}^nD_i^2\right| \leq A_n+2\sqrt{A_nB_n}\xrightarrow{p}0. $$ Also, \(n^{-1}\sum_iD_i\xrightarrow{p}0\), and $$ \left|\frac{1}{n}\sum_i e_i\right|\leq \sqrt{A_n}\xrightarrow{p}0, $$ so \(\bar{\hat D}_d\xrightarrow{p}0\). The empirical variance using divisor \(n\) is \(n^{-1}\sum_i\hat D_{d,i}^2-\bar{\hat D}_d^{\,2}\), which thus converges to \(\sigma_d^2\). Replacing divisor \(n\) by \(n-1\) multiplies it by \(n/(n-1)\to1\). This proves consistency of \(\hat\sigma_d^2\). \(\square\)

The conditions in this theorem are substantive. In particular, asymptotic linearity and convergence of the estimated EIF values require appropriate behavior of the fitted nuisance functions and targeting procedure. They are not guaranteed by a small empirical mean of the EIF values alone.

Worked Standard Errors for Means and Contrasts

Worked Example: Standard Error for a Regime-Specific Mean

Suppose a longitudinal TMLE estimates a regime-specific mean as \(\hat\psi_d=0.42\). For five subjects, suppose the fitted full EIF values are \(0.20,-0.10,0.30,-0.20,-0.20\). They sum to zero, as can occur when the empirical targeting equations are solved exactly.

The sum of their squared deviations from their mean, zero, is $$ 0.20^2+(-0.10)^2+0.30^2+(-0.20)^2+(-0.20)^2 =0.04+0.01+0.09+0.04+0.04=0.22. $$ Thus \(\hat\sigma_d^2=0.22/(5-1)=0.055\). The estimated variance of the mean is \(0.055/5=0.011\), and its standard error is $$ \widehat{\operatorname{SE}}(\hat\psi_d)=\sqrt{0.011}\doteq0.105. $$ The quantity \(0.055\) is the estimated variance of subject-level EIF values; it is not the estimated variance of the TMLE itself.

For a contrast, estimate the influence value on each subject by applying the same contrast to that subject's EIF values. This preserves the dependence between regime-specific estimates, because both are calculated from the same subjects.

Result: If \(\theta=\psi_1-\psi_0\), its EIF is \(D_\theta^*=D_1^*-D_0^*\). Estimate it for subject \(i\) by \(\hat D_{\theta,i}=\hat D_{1,i}-\hat D_{0,i}\), then calculate the sample variance of these \(n\) paired values and divide by \(n\) to estimate the variance of \(\hat\theta\).

Worked Example: Risk-Difference Standard Error and Pairing

Suppose the estimated means are \(\hat\psi_1=0.60\) and \(\hat\psi_0=0.45\), so the estimated risk difference is \(0.15\). For four subjects, let the EIF values for the two means be:

Subject\(\hat D_{1,i}\)\(\hat D_{0,i}\)\(\hat D_{1,i}-\hat D_{0,i}\)
10.200.100.10
2-0.10-0.200.10
30.300.200.10
4-0.40-0.10-0.30

The paired differences have mean zero. Their sample variance is $$ \hat\sigma_\theta^2= \frac{0.10^2+0.10^2+0.10^2+(-0.30)^2}{3} =\frac{0.12}{3}=0.04. $$ Therefore the estimated variance of the risk difference is \(0.04/4=0.01\), and its standard error is \(0.10\).

For comparison, the separate sample variances are \(s_1^2=0.30/3=0.10\) and \(s_0^2=0.10/3=0.0333\). Ignoring their pairing would give \((s_1^2+s_0^2)/4=0.0333\), not \(0.01\). The difference arises because the sample covariance is \(0.14/3=0.0467\), and the variance of a difference subtracts twice that covariance: $$ s_\theta^2=s_1^2+s_0^2-2s_{10}=0.10+0.0333-2(0.0467)=0.04. $$

For a risk ratio, it is often convenient to work on the log scale. The delta method says that if a differentiable transformation \(g\) is applied to an asymptotically linear estimator of a vector of means, its EIF is the derivative of \(g\) applied to the vector of EIFs. For \(g(\psi_1,\psi_0)=\log(\psi_1/\psi_0)\), this gives \(D_{\log RR}^*=D_1^*/\psi_1-D_0^*/\psi_0\). This requires \(\psi_1,\psi_0>0\) and regular estimation of both means. Applying the derivative of \(\exp\) gives the EIF for the risk ratio itself, \((\psi_1/\psi_0)(D_1^*/\psi_1-D_0^*/\psi_0)\).

Worked Example: Risk-Ratio Standard Error

Let \(\hat\psi_1=0.30\) and \(\hat\psi_0=0.20\), so the estimated risk ratio is \(1.5\). Suppose four subjects have \(\hat D_1=(0.06,-0.03,0.02,-0.05)\) and \(\hat D_0=(0.02,-0.01,0.03,-0.04)\). Each set sums to zero. The log-risk-ratio EIF values are $$ \frac{\hat D_{1,i}}{0.30}-\frac{\hat D_{0,i}}{0.20} =(0.10,-0.05,-0.0833,0.0333). $$ These values also sum to zero. Their sample variance is $$ \hat\sigma_{\log RR}^2 =\frac{0.10^2+(-0.05)^2+(-0.0833)^2+0.0333^2}{3} \doteq\frac{0.02056}{3}=0.00685. $$ The standard error on the log scale is \(\sqrt{0.00685/4}\doteq0.0414\). Multiplying by the estimated risk ratio gives the delta-method standard error on the ratio scale: \(1.5(0.0414)\doteq0.0621\).

Diagnostics, Alternatives, and Limitations

Several checks help detect mistakes or unstable estimates. Confirm that there is one EIF value per independent subject and that each value includes all longitudinal contributions in the EIF, not only the terminal outcome residual. Check the empirical mean of the fitted EIF values: a large value can signal an implementation or targeting problem, although a mean near zero does not prove that the nuisance estimates or asymptotic approximation are adequate. Inspect the distribution of the values, especially unusually large magnitudes. A few extreme values can dominate the empirical variance and indicate unstable estimation; the resulting standard error may then be imprecise or poorly approximated by its large-sample justification.

The empirical EIF standard error is a nonparametric, first-order estimate of sampling variability. It differs from a model-based standard error that relies on a specified parametric covariance model. A bootstrap is another alternative, but it must resample independent subjects and repeat the complete estimation procedure, including nuisance fitting and targeting. Treating the repeated rows within a subject as independent is not an alternative valid calculation: it changes the sampling unit and generally understates or otherwise misrepresents uncertainty.

The calculation can be unreliable when the EIF has very large or infinite variance, when the sample is too small for a first-order approximation to be useful, or when the estimator lacks the required asymptotic linearity. The plug-in variance formula does not fix such problems. Nor does it by itself determine an appropriate confidence interval, particularly when the parameter is near a boundary.

  • Common mistake: Calculate a variance for each regime separately and add the two estimated variances to obtain the risk-difference variance. This silently assumes zero covariance between estimates.
  • Correction: Subtract the two regimes' EIF values within each subject, then calculate the sample variance of those paired differences. This automatically retains their covariance.
  • Common mistake: Divide the sample variance of EIF values by \(n\), then report its square root as the standard error.
  • Correction: Divide by \(n\) to estimate the estimator's variance; take the square root only afterward. Equivalently, the standard error is the EIF sample standard deviation divided by \(\sqrt n\).
Key takeaway: For a longitudinal TMLE, form one complete estimated EIF value per subject. Estimate a mean's standard error from the sample standard deviation of those values divided by \(\sqrt n\); for a contrast, first combine the subject-level EIF values according to the contrast.

Check Your Understanding

Work through each question, then compare with the solutions.

  1. For \(n=100\), the sample variance of a regime's estimated EIF values is \(0.25\). What are the estimated variance and standard error of its TMLE?
  2. Two regime means use the same subjects. What subject-level values should be used to estimate the standard error of their risk difference?
  3. For a risk ratio with \(\hat\psi_1=0.40\) and \(\hat\psi_0=0.20\), write the subject-level estimated EIF for the log risk ratio.
  4. Why is a small empirical mean of the fitted EIF values not sufficient evidence that the standard error is reliable?

Solutions. (1) The estimated variance is \(0.25/100=0.0025\), and the standard error is \(\sqrt{0.0025}=0.05\). (2) Use \(\hat D_{1,i}-\hat D_{0,i}\) for each subject \(i\), then calculate the sample variance of those paired values and divide by the sample size. (3) The value is \(\hat D_{1,i}/0.40-\hat D_{0,i}/0.20\). (4) The empirical mean is only one diagnostic. It does not establish asymptotic linearity, accurate nuisance estimation, convergence of the fitted EIF values to the true EIF, or finite and stable EIF variance.

Clinical Biostats