Why categorical coding matters
A PD parameter may differ across groups defined by a categorical covariate, such as formulation, genotype class, or sex. The model needs a numerical representation of those categories, but the representation is a coding choice: it does not change the underlying group comparison when used correctly. What does change is the meaning of each coefficient. In particular, a coefficient is generally a value or contrast on the model’s linear-predictor scale, not automatically a PD parameter or a difference in PD parameters.
The link function determines how to translate from that scale to the parameter scale. This matters in practice: with an identity link, a reference-level coefficient is a difference in parameters; with a log link, it is a log ratio. Careful translation keeps the reported effect aligned with the model.
This fixed-effects expression describes the covariate relationship for the typical parameter. A model may also include between-subject random effects, but their structure and scale must be specified separately. When an individual random effect is set to zero, the resulting covariate-specific parameter is the model’s typical value; for a lognormal random-effects model, this is generally a median, not an arithmetic mean.
The indicators are mutually exclusive: for any subject, no more than one of the \(K-1\) non-reference indicators is 1. The reference level has all those indicators equal to 0. Thus the reference-level intercept is the linear predictor for that reference group, while each \(\beta_k\) is the difference between level \(k\) and the reference on the linear-predictor scale. This coding does not assume that the categories have a natural order.
Translating coefficients through the link
For the reference group, the linear predictor is \(\beta_0\), so its typical parameter is \(g^{-1}(\beta_0)\). For category \(k\), the predictor is \(\beta_0+\beta_k\), and the typical parameter is \(g^{-1}(\beta_0+\beta_k)\). Therefore, the category coefficient alone is not generally the category-specific parameter.
The log-link result follows directly. The reference parameter is \(\exp(\beta_0)\), and category \(k\)'s parameter is \(\exp(\beta_0+\beta_k)\). Dividing gives
The common intercept cancels, which is why exponentiating a log-link contrast yields a ratio. This is a ratio of typical PD parameters, not necessarily a ratio of observed responses at every concentration: the response model may transform that parameter nonlinearly.
Worked Example: A Log-Link Contrast for EC50
Suppose a hypothetical PD model uses a log link for EC50, measured in mg/L. Category A is the reference and category B is the comparison. The fitted coefficients are \(\beta_0=1.3863\) and \(\beta_1=0.4055\), where \(\beta_1\) multiplies \(I(C_i=\mathrm{B})\). Interpret the modeled typical EC50 values.
For category A, the indicator is 0, so its linear predictor is \(1.3863\). Applying the inverse log link gives
For category B, the indicator is 1. Its linear predictor is \(1.3863+0.4055=1.7918\), giving
The coefficient is a log ratio. Exponentiating it gives \(\exp(0.4055)=1.500\), which agrees with the direct calculation \(6.000/4.000=1.500\). In this hypothetical model, category B has a typical EC50 1.5 times that of category A, or 50% higher. The coefficient itself, 0.4055, is not an EC50 difference in mg/L.
Worked Example: An Identity-Link Contrast for Emax
Suppose a hypothetical model uses an identity link for Emax, measured in response units. Category A is the reference. The estimated coefficients are \(\beta_0=80\) response units and \(\beta_1=-12\) response units for category B.
For category A, \(I(C_i=\mathrm{B})=0\), so its typical Emax is \(80+(-12)(0)=80\) response units. For category B, the indicator is 1, so
The category coefficient is the difference \(68-80=-12\) response units. The negative sign indicates a lower typical Emax in category B under this coding. Both predictions are positive, so these hypothetical values are at least consistent with a parameter that must be positive. Identity-link models do not enforce positivity automatically; if plausible covariate values could produce nonpositive Emax, the model form needs reconsideration.
Indicator coding and cell-means coding
A second common representation uses one indicator for every category and no separate intercept. For \(K\) levels, write
Because exactly one indicator equals 1, \(\alpha_k\) is the category-specific value on the linear-predictor scale. Applying \(g^{-1}\) gives the category’s typical parameter. With an identity link, \(\alpha_k\) itself is the typical parameter. With a nonlinear link, such as the log link, \(\alpha_k\) is not the parameter: the inverse link must be applied. The cell-means and reference-level representations describe the same fitted category values when their coefficients are related consistently.
Worked Example: Three Categories and Equivalent Contrasts
Consider a hypothetical three-category covariate, with A as the reference, and a log-link model for a positive PD parameter measured in mg/L. Under cell-means coding, suppose the linear-predictor coefficients are \(\alpha_A=0.6931\), \(\alpha_B=1.0986\), and \(\alpha_C=1.7918\).
The typical parameters are obtained by applying the inverse link: \(\exp(0.6931)=2.000\) mg/L for A, \(\exp(1.0986)=3.000\) mg/L for B, and \(\exp(1.7918)=6.000\) mg/L for C. The cell-means coefficients are log parameters, not the parameters themselves.
To express the same values using A as the reference, the intercept is \(\beta_0=\alpha_A=0.6931\). The B-versus-A contrast is
The C-versus-A contrast is
Thus C's typical parameter is about three times A's. A direct B-versus-C comparison is also possible: \(\alpha_C-\alpha_B=0.6932\), which exponentiates to approximately 2.000, consistent with \(6.000/3.000=2.000\). Small discrepancies in the last digit arise from rounding the supplied log values.
Choosing and checking a coding scheme
Reference-level coding is useful when a scientifically meaningful comparison group exists, because its coefficients directly describe contrasts with that group on the linear-predictor scale. The choice of reference changes the coefficients, but not the category-specific fitted values. A different reference simply expresses the same set of group values using different contrasts.
Cell-means coding is often convenient when the main goal is to estimate or report each category's linear-predictor value. It uses \(K\) category coefficients instead of an intercept plus \(K-1\) contrasts. Neither representation is inherently more biological or more correct. Effect coding is another alternative: its coefficients compare categories with a chosen overall or weighted center, depending on the convention. It is useful for different questions, but the coefficient meanings must be stated explicitly. In all schemes, transformed-scale coefficients require the inverse link for group-specific parameter values.
A reference-level model requires the category indicators and intercept to be identifiable. With an intercept, including an indicator for every category creates exact redundancy because the indicators sum to one. Use \(K-1\) indicators with a reference level, or use all \(K\) indicators without a separate intercept. Also verify that category labels and indicator definitions match the data; a reversed or incorrectly assigned indicator reverses the interpretation.
The model assumes that the listed levels are exhaustive and mutually exclusive for the observations being modeled. A reference category must have data support, and estimates for rare categories may be imprecise or unstable. The chosen link must also be suitable for the parameter: a log link requires positive parameters, while an identity link can predict values outside a scientifically admissible range. Finally, a single categorical main effect imposes the specified contrast across the model’s other covariates; if group differences vary across another predictor, that simpler model may not capture the pattern.
Write down each level and confirm that every modeled subject belongs to exactly one level.
State which PD parameter varies by category and whether its linear predictor uses, for example, an identity or log link.
Name the reference level, or state that a cell-means representation has no separate intercept.
Calculate category-specific predictors, apply the inverse link, and then report a parameter difference or ratio with units as appropriate.
Diagnostics, limitations, and a common mistake
Check the design matrix and fitted values rather than relying only on coefficient labels. Confirm that the reference category has all contrast indicators set to zero, each non-reference category activates the intended indicator, and the number of independent coefficients matches the coding. Then calculate the implied typical parameter for every category. This last check can reveal implausible values, an incorrect inverse-link calculation, or a coding error even when model fitting completed successfully.
Sparse categories can yield uncertain category-specific estimates, and a coding scheme cannot create information absent from the data. The resulting group contrast is a model-based association; it does not by itself show that category membership causes a parameter difference. Further, conclusions about a PD parameter should not be overstated as conclusions about the full concentration-response curve unless that relationship has also been evaluated.
Common mistake: “The log-link coefficient is 0.4055, so the parameter is 0.4055 units higher in category B.” This is wrong because 0.4055 is a contrast on the log scale. The correction is to exponentiate it to obtain a ratio, \(\exp(0.4055)=1.500\), and, if an absolute parameter difference is wanted, compute the group-specific parameters first. In the EC50 example, that difference is \(6.000-4.000=2.000\) mg/L.
Check Your Understanding
Work each question by identifying the coding and link before interpreting its coefficient. Solutions follow the questions.
- A log-link model has a reference typical parameter of 5 mg/L and a comparison coefficient of \(\log(0.8)\). What is the comparison group's typical parameter and its ratio to the reference?
- Under an identity link, the reference typical value is 30 response units and a category coefficient is 7 response units. What is the category's typical value and the contrast direction?
- In cell-means coding with a log link, a category coefficient is \(\log(10)\). Is the category's typical parameter 10, \(\log(10)\), or another quantity? Explain.
- Why is it not appropriate to include an intercept and one indicator for every level of a categorical covariate?
Solutions. (1) The ratio is \(\exp(\log(0.8))=0.800\). The typical parameter is \(5(0.800)=4.000\) mg/L, which is 20% lower than the reference. (2) With an identity link, the coefficient is the difference: the category value is \(30+7=37\) response units, 7 units higher than the reference. (3) The coefficient is on the log linear-predictor scale, so the typical parameter is \(\exp(\log(10))=10\) in the parameter's units. (4) The indicators for all levels sum to 1, exactly reproducing the intercept column; the design is redundant and the coefficients are not separately identifiable. Use one fewer indicator with an intercept, or all category indicators without an intercept.