Why Dependent-Variable Flags Matter
A pharmacometric data set can contain several kinds of records for one subject: a measured concentration, a covariate update, or a dose record, for example. Only some records provide an outcome that the model is intended to describe. A dependent-variable flag tells the analysis which records have such an outcome and should contribute to the outcome model. If the flag disagrees with the record content, the analysis may omit valid measurements or treat non-observations as measurements.
The earlier material on observation records and covariate records establishes that a record’s role must be determined from its content and specification, not simply from its position in a subject’s timeline. This tutorial makes that distinction operational: define the flag, check it against the dependent-variable field, and understand what it does—and does not—say about the data.
MDV is a record-level instruction about outcome participation. It is not, by itself, a complete description of why an outcome is absent or excluded. A non-observation record may have MDV=1 because it contains no outcome at all. A planned observation that was not obtained may also be represented with MDV=1, but its reason should be represented separately when that distinction matters. The same flag value can therefore cover different record circumstances.
Define the Record-Level Rules Before Fitting
A useful specification sets out expected combinations of record role, DV, and MDV before the data are analyzed. The exact fields and coding depend on the project, but the following rules express the common convention:
- An intended, usable outcome record has a recorded DV and MDV=0.
- A record without an outcome to model has MDV=1. Its DV may be blank or otherwise handled according to the data specification; a placeholder must not be mistaken for an observed value.
- A non-observation record, such as a dose or covariate record, does not become an outcome record merely because a numeric value appears in a field. Its record role and MDV must agree.
- Any exception—such as an observed outcome deliberately excluded from a particular analysis—must be documented and represented consistently.
These are data-contract rules, not a claim that every project uses identical field names or coding. If a project uses a different convention, it must define the mapping and adapt the checks accordingly. Do not assume that a software default, a blank-cell convention, or a numerical sentinel value is self-explanatory.
| Record content and role | Expected MDV under the common convention | Validation question |
|---|---|---|
| Modeled outcome is present | 0 | Is DV present, valid, and intended for this endpoint? |
| No outcome is present on this record | 1 | Is the reason clear from the record role or a separate status field? |
| Dose or covariate record, with no modeled outcome | 1 | Could a value in another field be mistaken for DV? |
| Outcome is present but intentionally excluded | 1 only if the specification says so | Is the exclusion reason documented and auditable? |
A robust validation checks both directions. First, every MDV=0 row must contain an acceptable DV and belong to the intended observation set. Second, every row that is supposed to provide a modeled outcome must have MDV=0. Checking only the first direction can miss observations accidentally excluded; checking only the second can miss non-observation rows accidentally included.
How the Flag Enters the Outcome Likelihood
For clarity, suppose the model specifies a density \(f(y_i\mid\theta)\) for the outcome \(y_i\) on each modeled observation record \(i\), conditional on model parameters \(\theta\) and any relevant model inputs. For this simple product form, assume that the outcomes are conditionally independent across records given the model inputs and parameters. Let \(O\) be the set of records with observed outcomes and MDV=0. The outcome likelihood is the product of the densities for records in \(O\).
A record with MDV=1 is not assigned a density contribution by substituting a nonexistent \(y_i\) into the outcome density. It is simply outside the product over observed outcomes. Equivalently, one can define a record contribution piecewise: \(L_i(\theta)=f(y_i\mid\theta)\) when MDV=0 and the observed \(y_i\) is defined; \(L_i(\theta)=1\) when MDV=1. The second case is a definition of the contribution for a non-contributing record, not an evaluation of a density at an undefined outcome.
The product form is justified by conditional independence: the joint density of the observed outcomes factors into the product of their individual conditional densities. If the model instead specifies dependence across outcomes, the appropriate contribution is the joint density of the observed outcomes; one must not impose an independent product merely because the data contain an MDV column. In either case, non-observation records are not outcome observations by virtue of their presence in the data file.
Worked Example: Auditing a Small Dataset
Consider the following hypothetical records for one endpoint. “Observation” means that a measurement was intended to be represented on that row. “Other” denotes a non-observation record. The project uses MDV=0 for modeled observations and MDV=1 otherwise.
| Row | Record role | DV | MDV |
|---|---|---|---|
| 1 | Observation | 2.4 | 0 |
| 2 | Other | blank | 1 |
| 3 | Observation | 1.8 | 0 |
| 4 | Observation | blank | 1 |
| 5 | Other | blank | 1 |
| 6 | Observation | 3.1 | 0 |
Rows 1, 3, and 6 contain an outcome and have MDV=0, so they are the three records in \(O\). Rows 2 and 5 are not observation records and correctly have MDV=1. Row 4 is an intended observation with no recorded DV; MDV=1 correctly prevents it from being treated as an observed outcome. Its absence should be explained or categorized using the project’s separate status information if that information is needed.
The count check is \(3\) modeled outcomes \(+\,1\) observation without an outcome \(+\,2\) non-observation records \(=6\) total rows. The likelihood contribution is therefore \(f(2.4\mid\theta)f(1.8\mid\theta)f(3.1\mid\theta)\), under the stated conditional-independence assumption. Neither the blank row nor the two non-observation rows contribute outcome densities.
A Short Justification for Using Only Observed Outcomes
For the factorized model above, each observed outcome supplies one density factor. The product is formed over \(O\), the set for which the data actually contain modeled outcomes. Thus the likelihood follows directly from the joint density of the observed values:
A non-observation row is not added to \(O\), so it supplies no \(y_i\) to this expression. This is why the correct treatment is to omit that row’s outcome contribution, rather than to evaluate an outcome density at a missing value. For a genuine missing outcome within a modeled observation process, the assumptions about the missingness mechanism determine whether likelihood inference based on observed outcomes is adequate. The flag records the analysis decision; it does not prove those assumptions.
Worked Example: Finding Flag-Content Disagreements
Suppose a hypothetical extract has 10 rows: 6 intended observations and 4 non-observation records. Among the 6 intended observations, 5 have recorded DVs and one has a blank DV. Among the 4 non-observation records, all DVs are blank. The file marks 5 rows with MDV=0 and 5 with MDV=1. A row-by-row audit finds that one of the 5 MDV=0 rows is actually a non-observation record, while one of the observation rows with a recorded DV has MDV=1.
The count totals alone do not expose the errors: the file has 5 zero flags and 5 one flags, matching the five observations with recorded outcomes. But the identities of the flagged rows are wrong. The non-observation record marked MDV=0 must be corrected to MDV=1, and the observed-outcome record marked MDV=1 must be corrected to MDV=0, assuming both records’ roles and DV values are verified.
After correction, the six intended observations comprise five records with DV present and MDV=0, plus one record with DV blank and MDV=1. The four non-observation records have MDV=1. The corrected totals are therefore \(5\) rows with MDV=0 and \(5\) with MDV=1, the same totals as before—but now each flag agrees with its row content. This illustrates why validation must check record-level agreement rather than only aggregate counts.
Practical Validation and Failure Modes
A reproducible data-preparation workflow should implement explicit checks before model fitting. A useful audit reports both the number of violations and the row identifiers needed to inspect them. In a data set with multiple endpoints, perform the checks separately for each endpoint or define precisely how each endpoint’s dependent-variable field is represented.
Record the meaning and permitted values of MDV in the data specification. Under the common convention, check that each value is either 0 or 1.
Use the documented record role and endpoint definition, not the presence of an arbitrary numeric field, to decide which rows are meant to carry outcomes.
Flag MDV=0 rows with absent or invalid DVs, and flag intended observations with recorded DVs but MDV=1. Inspect non-observation rows marked MDV=0.
Summarize modeled outcomes, observations without recorded outcomes, and non-observation rows. Review documented exceptions individually rather than silently changing flags.
Retain the source status and reason for a missing or excluded outcome when available, and record any transformation that changes the analysis flag.
Common failure modes include defaulting every row to MDV=0, deriving MDV from whether any field on the row is numeric, or assigning MDV=1 to every blank DV without checking the record role. Such shortcuts can be wrong in either direction. A numeric dose or covariate is not necessarily a dependent-variable observation; conversely, an intended observation may have a recorded DV that was accidentally flagged out.
A further limitation is that a single binary flag cannot preserve every reason for non-contribution. It can say that a row does not contribute an observed outcome under the analysis convention, but it cannot distinguish, by itself, an event that has no outcome from a planned sample that was not obtained or a value intentionally excluded. Use a separate, defined status or reason field where those distinctions are needed. The interpretation of missing values and true zeros, and the handling of below-quantification observations, require their own data rules; MDV should not be used as a substitute for those rules.
Worked Example: Building the Likelihood From Flags
For a hypothetical subject, assume three modeled observation records have observed values \(y_1=0.80\), \(y_2=1.10\), and \(y_3=0.90\) mg/L. A fourth row is a covariate record with MDV=1. For illustration, suppose the fitted model’s conditional densities at the three observed values are \(f(y_1\mid\theta)=0.30\), \(f(y_2\mid\theta)=0.25\), and \(f(y_3\mid\theta)=0.40\), in the appropriate inverse outcome units.
The fourth row is not in \(O\), because it has no modeled outcome. Under conditional independence, the likelihood contribution of these records is
The covariate row contributes no extra density factor. The product is a likelihood value, not a probability that the parameter is correct. If the fourth row were instead an intended observation with no outcome, its MDV=1 would still keep an undefined outcome out of the product; the reason for that absence would need separate interpretation. This calculation assumes the three observed outcomes have the stated conditional-independence factorization.
Choosing and Interpreting the Flag Correctly
A dependent-variable flag is a compact and useful link between a prepared data set and the model’s outcome records. Its reliability depends on a clear convention, correct row classification, and checks against the DV field. It does not replace the record key, endpoint definition, or a missingness description. Nor does a correct MDV column guarantee that the model is appropriate: it only helps ensure that the intended outcome records, and not unrelated records, enter the outcome likelihood.
The main alternative to a single binary flag is to represent record roles and outcome status with separate, more descriptive fields, then derive the analysis flag from those fields. This can improve traceability when several reasons for non-contribution must be distinguished. A direct MDV field is simpler for model input; a richer status scheme is often more informative for review. Either approach is sound only if its mapping to the modeled outcome set is explicit and reproducible.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- Under the common convention, what should MDV be for a covariate record that contains no modeled outcome? Why?
- A data set has 12 rows. Four are non-observation records, two are intended observations with blank DVs, and six are intended observations with recorded DVs. If flags are consistent, how many rows should have MDV=0 and how many MDV=1?
- Why is it not valid to write an outcome density at a nonexistent DV and then rely on MDV=1 to remove it by exponentiation?
- A file has the correct total number of MDV=0 rows, but one is a non-observation record and one observed outcome is marked MDV=1. What does this show about count-only checks?
- Does MDV=1 establish that missing outcomes are ignorable for inference? Explain briefly.
Solutions. (1) MDV=1, because the row has no modeled outcome; the covariate’s presence does not make it an observation. (2) Six rows have MDV=0, and six have MDV=1: the six recorded outcomes are modeled, while the two blank observations and four non-observation records do not contribute outcomes. (3) The density requires a defined outcome. An undefined value does not become a valid likelihood contribution through exponentiation; define non-contributing rows piecewise or form the product only over observed outcomes. (4) Aggregate counts can match even when individual flags are assigned to the wrong rows, so checks must compare each row’s role, DV, and MDV. (5) No. MDV records whether the outcome contributes under the coding convention; it does not establish assumptions about the mechanism producing missing outcomes.