Tutorials › Marginal Structural Models › Categorical Treatments And Argmax Decisions

Dynamic Treatment Regimes · Tutorial 414 of 501

Categorical Treatments And Argmax Decisions

Learn to compare fitted Q-values across categorical actions and identify which action is optimal in each covariate region.

Advanced 10 min read

What You'll Learn

  • Define a Q-model for a finite set of categorical actions.
  • Interpret action indicators, reference categories, and treatment-covariate interactions.
  • Derive decision regions from pairwise comparisons of predicted Q-values.
  • Recognize when an action is never optimal over the covariate range.
  • Diagnose common coding, extrapolation, and model-interpretation errors.

From a Categorical Q-Model to a Decision Rule

When treatment has more than two possible actions, the decision is not described by a single treated-versus-untreated contrast. At each history, we need to compare the conditional value of every available action. A fitted Q-model provides those action-specific predictions; an argmax decision selects an action with the largest predicted value.

Suppose the current history or covariate vector is \(H\), the available actions are the finite set \(\mathcal{A}=\{0,1,\ldots,K-1\}\), and larger outcomes are preferred. At a single decision point, write \(Y^a\) for the outcome under action \(a\). In a multistage setting, the same definitions apply to the outcome under action \(a\) followed by a specified continuation strategy.

Definition: The Q-function for action \(a\) is \(Q(h,a)=E[Y^a\mid H=h]\), the conditional mean outcome if action \(a\) is taken at history \(h\). An optimal action at \(h\) is any member of \(\operatorname{argmax}_{a\in\mathcal{A}}Q(h,a)\). A decision rule \(d\) assigns an available action to each history; an argmax rule selects an action with the largest Q-value at that history.

For a causal interpretation of the observed-data regression, assume consistency, conditional exchangeability \(Y^a\perp A\mid H\), and positivity \(P(A=a\mid H=h)>0\) for each action and each history in the target population. These conditions give \(Q(h,a)=E[Y\mid H=h,A=a]\) wherever the conditional expectations are defined. If these conditions do not hold, a regression can still predict observed outcomes, but its predictions need not represent the outcomes under interventions.

Fitting and Interpreting a Model With Several Actions

A categorical action should be represented as a factor, not as a numerical dose, unless its numerical spacing and trend are scientifically justified. One common model uses action indicators and their interactions with covariates. For a scalar covariate \(X\), action 0 as the reference, and three actions, one example is:

$$ Q_\beta(x,a)=\beta_0+\beta_x x+ \beta_1 I(a=1)+\beta_2 I(a=2) +\gamma_1 xI(a=1)+\gamma_2 xI(a=2). $$

The reference-action prediction is \(Q_\beta(x,0)=\beta_0+\beta_x x\). The other action predictions are \(Q_\beta(x,1)=\beta_0+\beta_x x+\beta_1+\gamma_1x\) and \(Q_\beta(x,2)=\beta_0+\beta_xx+\beta_2+\gamma_2x\). Thus each \(\beta_j\) is a contrast at \(x=0\), not necessarily a constant contrast across histories. The interaction coefficients allow the relative value of an action to vary with \(x\).

A fitted conditional-mean model can be estimated by regression appropriate to the outcome and sampling design. For example, least squares estimates conditional means for a continuous outcome under the usual model-fitting conditions; a correctly specified binary-outcome mean model can use a link function, with predictions returned to the outcome scale before comparing actions. Whatever estimator is used, decisions compare predicted Q-values on the same outcome scale.

Worked Example: Fitting Action Means in Covariate Strata

Suppose \(X\) has two strata, low and high, and the observed mean outcome in each action-by-stratum cell is as follows. Assume the causal identification conditions stated above, and consider a saturated Q-model for these two strata.

History stratumAction 0 meanAction 1 meanAction 2 mean
Low465
High769

In the low stratum, the fitted predictions are \(Q(\text{low},0)=4\), \(Q(\text{low},1)=6\), and \(Q(\text{low},2)=5\). Since \(6>5>4\), action 1 is selected. In the high stratum, the predictions are \(7,6,9\), respectively; since \(9>7>6\), action 2 is selected. The resulting rule is \(d(\text{low})=1\), \(d(\text{high})=2\).

This example also shows why an overall treatment ranking can be misleading: the best action changes with history. The table gives a complete saturated fit for these two strata, but it does not by itself establish that estimates are precise or that the model extrapolates well beyond them.

Decision Regions From Pairwise Comparisons

The decision region for action \(a\) is the set of histories at which its predicted value is at least as large as that of every other action. For a fitted model, define this region by intersecting the pairwise inequalities:

$$ \widehat{\mathcal{R}}_a= \{h:\widehat Q(h,a)\geq \widehat Q(h,b) \text{ for every }b\in\mathcal{A}\}. $$

When the fitted Q-model is linear in a scalar covariate, each pairwise difference is linear, so each comparison gives a threshold inequality. Intersecting these inequalities identifies the region; checking only comparisons against the reference action is not enough. An action must beat all the alternatives to be selected.

Worked Example: Three Actions and a Threshold Rule

Let \(X=x\) lie between 0 and 4, and suppose the fitted Q-values are \(Q(x,0)=10+2x\), \(Q(x,1)=13+x\), and \(Q(x,2)=8+4x\). Find the maximizing action over this range.

Compare actions 1 and 2: \(Q(x,1)\geq Q(x,2)\) exactly when \(13+x\geq 8+4x\), or \(x\leq 5/3\). For \(x<5/3\), action 1 also beats action 0 because \(13+x\geq10+2x\) is equivalent to \(x\leq3\), which holds throughout that interval. Therefore action 1 is best for \(0\leq x<5/3\).

For \(x>5/3\), action 2 beats action 1. It also beats action 0 when \(8+4x\geq10+2x\), or \(x\geq1\), which holds for \(x>5/3\). Therefore action 2 is best for \(5/3<x\leq4\). At \(x=5/3\), actions 1 and 2 tie: both equal \(44/3\), while action 0 equals \(40/3\). With a fixed tie-breaking convention, the rule assigns that boundary to one of actions 1 or 2. Action 0 is never selected on this covariate range.

Theorem: For a finite action set and finite conditional values \(Q(h,a)\), an action \(a^\star\) maximizes conditional value at history \(h\) if and only if \(Q(h,a^\star)\geq Q(h,b)\) for every \(b\in\mathcal{A}\). Consequently, the argmax rule maximizes the conditional mean outcome at each history.

Proof. By definition, \(a^\star\) belongs to \(\operatorname{argmax}_{a\in\mathcal{A}}Q(h,a)\) exactly when its value is at least every value in the finite set. To see the decision implication directly, any other choice \(b\) has conditional mean \(Q(h,b)\leq Q(h,a^\star)\). Thus choosing an argmax gives a conditional mean no smaller than choosing any alternative at that same history. A maximum exists because a finite, nonempty set of finite real numbers has a largest member. \(\square\)

Why the Pointwise Comparison Matters

For a target distribution of histories, the value of a rule is the mean outcome under the action it assigns. If the causal Q-function is identified and integrable, this value is \(E[Q(H,d(H))]\). The pointwise comparison above explains why maximizing Q at each history is appropriate: it avoids choosing a lower-valued action for any history.

Derivation: Let \(d^\star(h)\) maximize \(Q(h,a)\) at every \(h\), and let \(d\) be any other rule. If the conditional means are integrable, then \(Q(H,d^\star(H))\geq Q(H,d(H))\) for every history where the rules are defined. Taking expectations preserves the inequality, so \(E[Q(H,d^\star(H))]\geq E[Q(H,d(H))]\).

This derivation assumes both rules assign available actions and that their Q-values are integrable under the target distribution. It is a population statement about the true Q-function. Replacing \(Q\) by a fitted model creates an estimated rule, and the fitted rule need not maximize the true value.

Worked Example: Interactions Change the Selected Action

Consider three actions and a binary covariate \(Z\in\{0,1\}\), with fitted values \(Q(z,0)=5+2z\), \(Q(z,1)=6-z\), and \(Q(z,2)=4+4z\). Calculate the decision for each covariate value.

At \(z=0\), the predictions are \(5,6,4\), so action 1 is selected. At \(z=1\), they are \(7,5,8\), so action 2 is selected. Action 0 is an intermediate option at \(z=1\), but it is not the maximum. The rule is \(d(0)=1\) and \(d(1)=2\).

The coefficients show why comparing only treatment main effects can fail: the action-2 prediction increases by 4 as \(Z\) changes from 0 to 1, while action 1 decreases by 1. The relevant decision comes from evaluating all fitted action predictions at the history, not from interpreting a single coefficient in isolation.

Diagnostics, Alternatives, and Limitations

Useful checks focus on whether the action predictions and comparisons are meaningful in the histories where the rule will be used. Check that every action is coded correctly, that the model produces one prediction per action on a common outcome scale, and that comparisons are made across all actions. Examine action-specific sample sizes and covariate overlap: sparse action-history combinations make conditional predictions unstable, while histories with no observed support violate positivity for causal identification. Plotting fitted Q-values against continuous covariates can reveal implausible crossings or extrapolation beyond the observed data.

A common alternative is to fit separate outcome models by action and compare their predictions. This can be sensible, but may use data less efficiently and does not automatically solve sparse-data problems. A reference-action model instead estimates contrasts relative to one action; it is algebraically equivalent to action-specific predictions when the model is parameterized equivalently. For \(K\) actions, it requires \(K-1\) contrasts, and interactions are needed when contrasts vary across covariates.

A frequent mistake is to code actions 0, 1, and 2 as a single numeric predictor and interpret its slope as a treatment effect. That imposes a particular linear trend and treats the spacing between category labels as meaningful. Unless that structure is justified, use categorical indicators and compare the resulting action-specific predictions. Another mistake is to select the action with the largest coefficient: coefficients are generally contrasts against a reference, not the predicted values themselves.

Finally, decision regions inherit the limitations of the Q-model and the observed treatment support. Predictions may be unreliable for rare histories, and a region derived from a misspecified model may not reflect the best action under the true conditional means. The calculations here define how to make the comparison; they do not remove uncertainty in the fitted model or guarantee that the selected rule has high value.

Check Your Understanding

For each question, work from the stated Q-values. Solutions follow the questions.

  1. At a history \(h\), three actions have Q-values \(2.1\), \(2.8\), and \(2.5\). Which action is selected?
  2. If \(Q(x,0)=4+x\) and \(Q(x,1)=7\), for what values of \(x\) does action 0 have at least as large a Q-value as action 1?
  3. Why is a coefficient for action 2 in a reference-action model not necessarily the difference in predicted value between actions 2 and 0 at every history?
  4. What causal identification problem arises if one action is never observed for a history occurring in the target population?

Solutions. (1) Select action 1, since \(2.8\) is larger than \(2.1\) and \(2.5\). (2) Solve \(4+x\geq7\), giving \(x\geq3\); equality occurs at \(x=3\). (3) If the model includes an action-by-covariate interaction, the contrast is \(\beta_2+\gamma_2x\), not just the action coefficient \(\beta_2\), so it varies with history. (4) Positivity fails: the observed data provide no treated observations at that history for the missing action, so its conditional causal mean is not identified there by the observed conditional outcome regression.

Clinical Biostats