Tutorials › Pattern-Mixture and Selection Models › Casewise Scores for Incomplete Longitudinal Records

Local Influence · Tutorial 145 of 499

Casewise Scores for Incomplete Longitudinal Records

Learn how to calculate each subject’s observed-data score, including the contribution from outcomes that must be integrated out and the contribution from the response-pattern model.

Advanced 12 min read

What You'll Learn

  • Write the observed-data likelihood contribution for a longitudinal record with missing outcomes.
  • Derive casewise scores using conditional expectations of complete-data scores.
  • Separate outcome-model and selection-model score components.
  • Calculate scores for monotone dropout with Bernoulli outcomes and a logistic dropout model.
  • Check score calculations using pattern probabilities, numerical derivatives, and aggregate scores.
  • Recognize why a casewise score is not itself an influence measure or a complete-data score.

Why a Casewise Score Needs the Observed-Data Likelihood

A subject’s score is the gradient of that subject’s log-likelihood contribution with respect to the model parameters. With a complete longitudinal record, this contribution is evaluated at the outcomes actually observed. With an incomplete record, the likelihood must also account for the probability of the response pattern and sum or integrate over outcomes that were not observed. Differentiating only the outcome density at the observed values would omit part of the likelihood and can give the wrong score.

The purpose here is to derive the subject-level score for a selection model and show how its components reflect three things: the outcomes observed, the missing outcomes averaged over, and the subject’s response pattern. The earlier material on subject contributions to the observed selection likelihood provides the likelihood setup; the central task now is to differentiate that contribution carefully.

Definition: For subject \(i\), let \(Y_i=(Y_{i1},\ldots,Y_{iT})\) be the full outcome vector, \(R_i\) its response pattern, and \(X_i\) the observed covariates. Let \(O_i\) and \(M_i\) index the observed and missing outcomes. In a selection model, \(f_\theta(y_i\mid x_i)\) is the full-data outcome density and \(\pi_\psi(r_i\mid y_i,x_i)\) is the probability of the response pattern given the full outcomes and covariates. The observed-data likelihood contribution is $$ L_i(\theta,\psi)=\int f_\theta(y_{i,O_i},y_{i,M_i}\mid x_i)\, \pi_\psi(r_i\mid y_{i,O_i},y_{i,M_i},x_i)\,dy_{i,M_i}. $$ For discrete missing outcomes, the integral is a sum. The casewise score is \(u_i(\eta)=\partial\log L_i(\eta)/\partial\eta\), where \(\eta=(\theta^\mathsf{T},\psi^\mathsf{T})^\mathsf{T}\).

This expression assumes that subjects are independent conditional on the modeled covariates, that the outcome and response-pattern models define valid probability distributions, and that the observed contribution is positive at the parameter value under consideration. Differentiation under the integral also requires the usual regularity conditions—for example, a parameter-independent integration domain and sufficient smoothness and integrability of the differentiated integrand. These conditions justify exchanging differentiation and integration. When missing outcomes are discrete, the corresponding requirement is that the finite or convergent sum can be differentiated term by term.

Deriving the Casewise Score

The complete-data log likelihood for one subject separates into an outcome part and a selection part: \(\log f_\theta(Y_i\mid X_i)+\log\pi_\psi(R_i\mid Y_i,X_i)\). The observed-data score is not generally that complete-data score evaluated at an imputed value. Rather, it is an average of the complete-data score over the missing outcomes, using a particular conditional distribution.

$$ q_i(y_{i,M_i}\mid y_{i,O_i},r_i,x_i;\eta) = \frac{f_\theta(y_{i,O_i},y_{i,M_i}\mid x_i) \pi_\psi(r_i\mid y_{i,O_i},y_{i,M_i},x_i)} {L_i(\eta)}. $$

This is the conditional distribution of the missing outcomes given the observed outcomes and response pattern under the fitted joint model. The pattern probability appears in its numerator: if response depends on an unobserved outcome, the distribution of that outcome among subjects with the particular pattern need not equal its distribution given the observed outcomes alone.

1
Differentiate the observed contribution.
Write \(L_i\) as the integral or sum of the outcome density times the response-pattern probability. Differentiate this product with respect to the parameter of interest.
2
Divide by the contribution.
Use \(\partial\log L_i/\partial\eta=(\partial L_i/\partial\eta)/L_i\). The ratio makes the integrand weights equal to \(q_i\).
3
Average the complete-data score.
Separate the derivatives of \(\log f_\theta\) and \(\log\pi_\psi\). The observed-data score is the conditional expectation of their sum under \(q_i\).
$$ u_i(\eta) = \mathbb{E}_{q_i}\!\left[ \begin{pmatrix} \partial\log f_\theta(Y_i\mid x_i)/\partial\theta\\ \partial\log\pi_\psi(r_i\mid Y_i,x_i)/\partial\psi \end{pmatrix} \;\middle|\; y_{i,O_i},r_i,x_i \right]. $$

To verify the result, differentiate the integrand: \(\partial(f_\theta\pi_\psi)/\partial\eta =f_\theta\pi_\psi\{\partial\log f_\theta/\partial\eta+ \partial\log\pi_\psi/\partial\eta\}\), with each term contributing only to its own parameter block. Integrating and dividing by \(L_i\) gives exactly the expectation above. This identity is often called the observed-data score identity or Fisher’s identity.

Worked Examples with Monotone Dropout

For concrete calculations, suppose there are two binary outcomes, \(Y_{i1}\) and \(Y_{i2}\), and the outcomes are independent Bernoulli variables conditional on covariates. Write \(P(Y_{it}=1)=p_t\), with \(\operatorname{logit}(p_t)=\beta_t\). Let \(D_i=1\) indicate dropout before outcome 2 is observed, and model dropout by \(\operatorname{logit}\{P(D_i=1\mid Y_{i1},Y_{i2})\} =\delta_0+\delta_1Y_{i1}+\delta_2Y_{i2}\). Thus the parameter order will be \((\beta_1,\beta_2,\delta_0,\delta_1,\delta_2)\). For a Bernoulli outcome with logit parameter \(\beta_t\), the complete-data score is \(Y_{it}-p_t\).

Worked Example: A Complete Record

Suppose a hypothetical subject has \(Y_{i1}=1\) and \(Y_{i2}=0\), with \(p_1=0.5\), \(p_2=0.7\), and dropout probability \(d_i=0.4\) for this outcome pair. The subject completed both visits, so \(D_i=0\), and the contribution is \(L_i=P(Y_{i1}=1)P(Y_{i2}=0)P(D_i=0\mid Y_i)=(0.5)(0.3)(0.6)=0.0900\).

The outcome-model scores are \(Y_{i1}-p_1=1-0.5=0.500\) and \(Y_{i2}-p_2=0-0.7=-0.700\). For the selection model, the logit dropout score for \(D_i=0\) is \((D_i-d_i)(1,Y_{i1},Y_{i2})\). Hence the selection block is \((-0.400,-0.400,0)\). The complete-record casewise score is therefore \((0.500,-0.700,-0.400,-0.400,0)\). No averaging over missing outcomes is needed in this case.

Worked Example: Dropout Independent of the Missing Outcome

Consider a hypothetical subject with \(Y_{i1}=1\), who drops out before \(Y_{i2}\) is observed. Let \(p_1=0.5\), \(p_2=0.7\), and suppose dropout does not depend on \(Y_{i2}\): set \(\delta_2=0\) and choose \(\delta_0+\delta_1=\operatorname{logit}(0.5719)\) for this subject’s \(Y_{i1}=1\). Thus \(d=P(D_i=1\mid Y_{i1}=1,Y_{i2})=0.5719\) for either possible value of \(Y_{i2}\).

The observed-data contribution is \(L_i=P(Y_{i1}=1)P(D_i=1\mid Y_{i1}=1)=0.5(0.5719)=0.28595\). The missing outcome is still summed over: its two possibilities have probabilities 0.3 and 0.7, and the dropout probability is the same for both. Conditional on this record, the weights for \(Y_{i2}=0,1\) are therefore 0.3 and 0.7.

The first outcome score is \(1-p_1=0.500\). For the second outcome score, average \(Y_{i2}-p_2\) using those weights: \(0.3(0-0.7)+0.7(1-0.7)=-0.210+0.210=0\). So the outcome-model score block is \((0.500,0)\), not a nonzero score for \(\beta_2\).

For dropout, the complete-data score in the logistic model is \((D_i-d)(1,Y_{i1},Y_{i2})\). Here \(D_i=1\), so averaging over the missing \(Y_{i2}\) gives the selection block \((1-d,\;1-d,\;(1-d)E[Y_{i2}\mid\text{record}])\). Numerically, this is \((0.4281,0.4281,0.4281\times0.7)=(0.4281,0.4281,0.2997)\). The complete casewise score, in the stated parameter order, is \((0.500,0,0.4281,0.4281,0.2997)\).

The zero score for \(\beta_2\) is specific to this setup: the outcomes are independent, and dropout is independent of \(Y_{i2}\). It does not imply that the missing outcome is known, nor that the \(\beta_2\) score must be zero under outcome-dependent dropout.

Worked Example: Dropout Depends on the Missing Outcome

Keep \(p_1=0.5\), \(p_2=0.7\), \(Y_{i1}=1\), and \(D_i=1\), but now suppose dropout probabilities are \(d_0=0.3\) when \(Y_{i2}=0\) and \(d_1=0.8\) when \(Y_{i2}=1\). These probabilities can be represented by the stated logistic selection model with \(\delta_1=0\), \(\delta_0=\operatorname{logit}(0.3)\), and \(\delta_2=\operatorname{logit}(0.8)-\operatorname{logit}(0.3)\).

The observed contribution, apart from the observed \(Y_{i1}\) factor, sums over the missing outcome: \(A=(1-p_2)d_0+p_2d_1=0.3(0.3)+0.7(0.8)=0.65\). Thus \(L_i=0.5(0.65)=0.325\). The conditional weights for \(Y_{i2}=0\) and \(Y_{i2}=1\) are \(0.09/0.65=0.1385\) and \(0.56/0.65=0.8615\), respectively.

The \(\beta_2\) score is the weighted mean of \(Y_{i2}-p_2\), equivalently \(p_2(1-p_2)(d_1-d_0)/A =0.7(0.3)(0.5)/0.65=0.1615\). It is positive because the dropout pattern makes \(Y_{i2}=1\) more likely than it was before conditioning on dropout.

For a logistic dropout probability, the selection score is \((D_i-d(Y_i))(1,Y_{i1},Y_{i2})\). Averaging each component with the conditional weights gives \(\delta_0: \{0.09(0.7)+0.56(0.2)\}/0.65=0.175/0.65=0.2692\); \(\delta_1\) has the same value because \(Y_{i1}=1\); and \(\delta_2: 0.56(0.2)/0.65=0.1723\). The first outcome score remains \(1-p_1=0.500\). The full score is \((0.500,0.1615,0.2692,0.2692,0.1723)\), rounded to four significant figures.

Interpreting and Checking the Components

The outcome block describes how the observed record, together with the response pattern, supports different values of the outcome parameters. The selection block describes how that record supports different values of the response-pattern parameters. When outcomes are missing, both blocks can depend on the selection model because the conditional weights \(q_i\) depend on the response probability. In particular, an observed dropout pattern may shift the conditional distribution of a missing outcome, which in turn changes the averaged outcome score.

For a complete record, the conditional distribution over missing outcomes collapses to a point, and the casewise score is the usual complete-data score for the joint outcome-and-selection likelihood. For an incomplete record, replacing a missing outcome with its conditional mean and evaluating a nonlinear score there is generally not equivalent to averaging the score. The required operation is the expectation of the score under \(q_i\).

Several checks help detect errors in an implementation:

  • Check the pattern likelihood. Confirm that the contribution sums or integrates over every possible missing outcome and uses the probability of the observed response pattern.
  • Check the conditional weights. They must be nonnegative and sum to one. In the outcome-dependent dropout example, \(0.1385+0.8615\) is approximately 1.
  • Check the response-model score sign. For a logistic dropout model, the score for an observed dropout is \(1-d\) times its covariate vector; for an observed non-dropout it is \(-d\) times that vector.
  • Check derivatives numerically. Compare the analytic score with finite differences of \(\log L_i\) at the same parameter values, using a step size small enough to assess local agreement without excessive rounding error.
  • Check aggregation. The total observed-data score is \(\sum_i u_i(\eta)\). At an interior maximum of the likelihood, this total should be approximately zero, subject to numerical optimization tolerance. Individual casewise scores need not be zero.

What Casewise Scores Do—and Do Not—Tell You

A casewise score is a parameter-indexed vector describing the local slope of one subject’s observed-data log likelihood. Its components can be inspected to see which parameter directions that subject’s record supports. But the score alone does not determine how much the fitted estimates would change if the subject were removed: that also depends on the curvature of the total likelihood and on the parameter direction being considered. Those are separate influence calculations.

QuantityUses missing outcomes?What it represents
Complete-data scoreRequires the full outcome vectorGradient if all outcomes and the response pattern were known
Casewise observed-data scoreAverages over missing outcomes using \(q_i\)Gradient of the subject’s observed-data log-likelihood contribution
Complete-case score onlyOmits records with incomplete outcomesNot generally the score of the stated observed-data selection likelihood

A frequent mistake is to assign a missing outcome a convenient value—often its marginal mean—and plug that value into the complete-data score. In the independent-outcome example, doing so at \(Y_{i2}=0.7\) happens to give \(0.7-0.7=0\), but that coincidence does not validate the procedure. With outcome-dependent dropout, the correct conditional weights change, and the score is the weighted average across possible outcomes. Another mistake is to use only the outcome density and ignore the response-pattern probability; that is not the observed-data likelihood for a selection model.

The calculation also depends on a correctly specified joint model and the numerical accuracy of any required summation or integration. If the selection mechanism is poorly identified, the conditional distribution of missing outcomes can be sensitive to the assumed selection parameters. A casewise score is therefore a model-based diagnostic, not an empirical measure free of assumptions. As with any likelihood calculation, boundary estimates or unstable optimization can complicate interpretation; score checks should be performed at the fitted parameter values and alongside diagnostics of the likelihood computation.

Key takeaway: For an incomplete longitudinal record, differentiate its observed-data likelihood contribution. Equivalently, average the complete-data outcome and selection scores over the missing outcomes under the conditional distribution given both the observed outcomes and the response pattern.

Check Your Understanding

Answer each question, then compare with the solutions.

  1. In a selection model, what distribution supplies the weights when averaging a complete-data score over missing outcomes?
  2. For an observed dropout with logistic dropout probability \(d\), what is the score for the dropout intercept? What is it for an observed non-dropout?
  3. With \(p_2=0.7\) and dropout independent of \(Y_{i2}\), why is the averaged \(\beta_2\) score zero for a subject who drops out before visit 2?
  4. In the outcome-dependent example, verify that the conditional weights for \(Y_{i2}=0,1\) sum to one and state why the \(\beta_2\) score is positive.
  5. Does a casewise score of zero for one subject mean that removing that subject cannot affect the fitted estimates? Explain.

Solutions. (1) Use \(q_i\), proportional to the full outcome density times the probability of the observed response pattern, conditional on the observed outcomes and pattern. (2) The intercept score is \(1-d\) for dropout and \(-d\) for non-dropout. (3) The missing outcome retains weights 0.3 and 0.7, so the mean score is \(0.3(0-0.7)+0.7(1-0.7)=0\). (4) The weights are \(0.09/0.65\) and \(0.56/0.65\), whose sum is \(0.65/0.65=1\); dropout favors \(Y_{i2}=1\), shifting its conditional mean above 0.7 and giving a positive score. (5) No. A casewise score is a local gradient contribution; the effect of deletion also depends on the curvature of the total likelihood and the parameter direction of interest.

Clinical Biostats