Why Factor Coding Matters
A categorical predictor can have several levels, such as payment method, product tier, or geographic region. A GLM cannot use those labels directly as numerical quantities. Instead, the model represents category membership with indicator variables. The resulting coefficients describe comparisons between categories, and those comparisons depend on which category is used as the reference.
The key interpretation is on the model’s link scale. A factor coefficient is not automatically a difference in probabilities, counts, or other responses. In a logistic GLM, it is a change in log odds relative to the reference category; in a log-link GLM, it is a change in log mean. The intercept has a related but distinct role: it gives the linear predictor for the reference category when any other predictors in the model are zero.
The Model and the Meaning of Its Coefficients
Consider a GLM with a factor \(G\), no interaction terms, and no other predictors for the moment. Let category 0 be the reference and let categories 1 through \(K-1\) have indicator variables \(I_1,\ldots,I_{K-1}\). The linear predictor is
Here \(\mu\) is the conditional mean of the response, \(g\) is the link function, and the \(\beta\) values are model coefficients. For the reference category every indicator is zero, so \(g(\mu_0)=\beta_0\). For category \(j\), only its own indicator is 1, giving \(g(\mu_j)=\beta_0+\beta_j\). Therefore,
This is the general interpretation: with no interactions, the coefficient is the difference between the category’s linear predictor and the reference category’s linear predictor. If other predictors are present, compare the categories while holding those predictors fixed. The intercept remains the linear predictor for the reference category when the other predictors are zero; it is not necessarily an overall average.
For a factor with \(K\) levels, including a separate indicator for every level as well as an intercept would create redundant columns: the indicators sum to 1 for every observation. Using \(K-1\) indicators avoids this redundancy and gives the reference category a clear interpretation.
Link-Scale Comparisons and Response-Scale Meaning
The response-scale interpretation follows from the link function. In a logistic GLM, \(g(\mu)=\operatorname{logit}(\mu)=\log\{\mu/(1-\mu)\}\), where \(\mu\) is the event probability. A factor coefficient is then a log-odds difference. Exponentiating it gives the odds ratio for that category relative to the reference, at the same values of any other predictors.
This odds ratio is not a probability difference. The probability associated with a given odds ratio depends on the starting probability in the reference category. With a log link, \(g(\mu)=\log(\mu)\), exponentiating a factor coefficient instead gives a ratio of conditional means. These statements require the specified link and the stated model structure; they should not be transferred to a different link without checking its inverse.
Worked Examples
Worked Example: Logistic Factor Coefficients for Three Channels
A hypothetical insurer models whether a prospective customer completes an online quote. The factor “contact channel” has three categories: Agent is the reference, while Online and Broker have indicators \(I_O\) and \(I_B\). Suppose the fitted logistic model is
Find the completion probability in each channel, interpret both factor coefficients, and compare Broker with Online in odds. The method is to first calculate the reference odds, then apply the indicator terms on the log-odds scale. The common mistake to avoid is treating a coefficient as a probability-point change.
Agent, the reference. Both indicators are zero, so \(\operatorname{logit}(p_A)=\log(1/4)\). The reference odds are \(\exp\{\log(1/4)\}=0.25\), and therefore
Online. Here \(I_O=1\) and \(I_B=0\), so the log odds are \(\log(1/4)-0.40\). The coefficient \(-0.40\) is the Online-versus-Agent difference in log odds. Its odds ratio is \(\exp(-0.40)\approx0.6703\). Thus the Online odds are \(0.25(0.6703200)\approx0.1675800\). Converting those odds to a probability gives
Broker. The log odds are \(\log(1/4)+\log 2=\log(1/2)\). The Broker odds are therefore \(0.50\), and
The Broker coefficient \(\log 2\) means Broker has twice the odds of Agent, not twice the probability. To compare Broker directly with Online, subtract their linear predictors: \(\log 2-(-0.40)=1.093147\). The corresponding odds ratio is \(\exp(1.093147)=2\exp(0.40)\approx2.9836\). This also agrees with the odds calculation \(0.50/0.1675800\approx2.9836\).
Check. Agent odds \(0.25\) give probability \(0.2000\); Online odds \(0.1675800\) give probability approximately \(0.1435\); and Broker odds \(0.50\) give probability \(0.3333\). The direct Broker-to-Online odds ratio agrees with the coefficient difference.
Worked Example: Interpreting a Factor in a Log-Link Count Model
A hypothetical service team models the number of incidents per policy period using a Poisson GLM with a log link. The factor “support tier” has Standard as its reference, with indicators \(I_P\) for Priority and \(I_B\) for Basic. Suppose
Calculate the fitted mean for each tier and compare Priority with Basic. The model assumes the conditional incident count has a Poisson distribution with the stated mean and that the log link relates this mean to the linear predictor. The method is to set the indicators for each category and then apply the inverse link, the exponential function. The common mistake to avoid is reporting a log-mean coefficient as an additive change in the count mean.
Standard. Both indicators are zero. Thus \(\log(\mu_S)=\log 2\), so \(\mu_S=\exp(\log 2)=2\) incidents per policy period. The intercept is the log of the reference mean.
Priority. Set \(I_P=1\) and \(I_B=0\). Then
The Priority coefficient is \(\log 1.5\), so the Priority mean is \(1.5\) times the Standard mean: \(3/2=1.5\).
Basic. Set \(I_P=0\) and \(I_B=1\). Then
The Basic mean is \(0.5\) times the Standard mean. The Priority-to-Basic mean ratio is \(3/1=3\). Equivalently, subtract the factor coefficients: \(\log 1.5-\log 0.5=\log 3\), and exponentiate to obtain 3.
Check. The fitted means are 2, 3, and 1, respectively. Their ratios satisfy \(3/2=1.5\), \(1/2=0.5\), and \(3/1=3\), as implied by the coefficients.
Worked Example: Intercept with a Centered Numeric Predictor
A hypothetical renewal model estimates the probability that a customer renews. The factor Plan has Monthly as its reference and Annual as the other category. Let \(z\) equal customer tenure in years minus 5, so \(z=0\) represents five years of tenure. The fitted model is
Find the Monthly probability at five years of tenure, then the probabilities for both plans at seven years. Interpret the Annual coefficient. The method is to identify the zero-indicator case for the intercept, then substitute \(z=2\) for seven years. The common mistake to avoid is interpreting the intercept as the probability for a customer with zero years of tenure: because tenure was centered, \(z=0\) means five years.
Intercept case. At five years, \(z=0\); for Monthly, \(I_A=0\). Hence the reference log odds are \(-1\), the odds are \(\exp(-1)\approx0.3678794\), and
This probability is the inverse-logit of the intercept. It refers specifically to Monthly customers with five years of tenure.
Seven years, Monthly. Now \(z=7-5=2\) and \(I_A=0\). The linear predictor is \(-1+0.20(2)=-0.60\). The odds are \(\exp(-0.60)\approx0.5488116\), so
Seven years, Annual. Set \(z=2\) and \(I_A=1\). The linear predictor is \(-0.60-\log 2\). Its odds are \(\exp(-0.60)/2\approx0.2744058\), giving
At the same tenure, the Annual coefficient \(-\log 2\) means the Annual odds are half the Monthly odds. Indeed, \(0.2744058/0.5488116=0.5\). The probabilities are not in a ratio of one-half: \(0.2153/0.3543\) is not \(0.5\).
Check. The intercept case uses \(z=0\), which is five—not zero—years of tenure. At seven years, the two predictors differ by \(-\log 2\), so their odds ratio is exactly one-half.
Reading Factor Coefficients Carefully
In software output, a coefficient name often combines the factor name and a category label. For example, a row labelled “PlanAnnual” commonly refers to the Annual indicator relative to an omitted Plan category. The label alone is not enough to guarantee the reference: check the factor levels and contrast coding used to fit the model. Under treatment coding with an intercept, the omitted level is the reference category.
When a model includes other predictors, the factor comparison is conditional on their values. For an additive logistic model without interactions, the factor’s odds ratio is the same at every value of the other predictors. For an additive log-link model, its mean ratio is likewise constant. If the model includes interactions, that simple interpretation may not hold; a factor’s effect can depend on the interacting predictor.
The intercept also needs context. If a model contains a continuous predictor \(x\), then its intercept corresponds to \(x=0\) and the reference level of each factor. If \(x=0\) is outside the observed range or has no practical meaning, the intercept may be a poor summary of a typical observation. Centering a predictor can make the intercept describe a more relevant value, but it does not change the rule: the intercept is evaluated at the predictor’s coded value of zero.
Find the factor’s levels, the reference category, and which indicator corresponds to each estimated coefficient.
Set the category indicators to 0 or 1 and substitute the stated values of any other predictors.
State the factor coefficient as a comparison with the reference, holding other predictors fixed.
For a logit link, exponentiate a coefficient to obtain an odds ratio; for a log link, exponentiate it to obtain a mean ratio. Use the inverse link to calculate a response-scale prediction.
Common Exam Trap
Suppose the reference probability is \(0.2000\) and a logistic factor coefficient is \(-0.40\). The incorrect calculation \(0.2000-0.40=-0.2000\) treats the coefficient as a probability-point change and even produces an impossible probability. The correction is to work on the log-odds scale: the odds ratio is \(\exp(-0.40)\approx0.6703\), the reference odds are \(0.2000/0.8000=0.25\), and the new odds are \(0.25(0.6703)\approx0.1676\). The corresponding probability is \(0.1676/(1+0.1676)\approx0.1435\). The change in probability is about \(-0.0565\), not \(-0.40\).
A second frequent error is to call the intercept the “average response.” It is not generally an average. It is the linear predictor at the reference category and zero values of the other predictors, transformed to the response scale if a predicted mean or probability is wanted. State those conditions explicitly whenever interpreting an intercept.
Check Your Understanding
For each problem, identify the reference comparison before calculating a response-scale quantity.
- A logistic model has Reference as the baseline, with reference odds \(1/3\). The coefficient for App is \(\log 2\). Find the App odds and probability. (Answer: odds \(2/3\); probability \(0.4000\).)
- A log-link model has a reference-category mean of 4. The coefficient for Remote is \(\log(0.75)\). Find the Remote mean and its ratio to the reference mean. (Answer: mean \(3\); ratio \(0.75\).)
- A logistic model has reference category A, intercept \(-2\), and category C coefficient \(-\log 2\). Find the reference probability and the probability for C. (Answer: reference probability \(0.1192\); C probability \(0.0634\).)
- A logistic model has reference category X and factor coefficients \(0.20\) for Y and \(\log 2\) for W. With no interactions, find the odds ratio for W versus Y. (Answer: \(\exp(\log 2-0.20)\approx1.6375\).)
- A log-link model has reference category Core with intercept \(\log(1.5)\), and coefficients \(\log 2\) for Plus and \(\log(1/3)\) for Lite. Find all three means and the Plus-to-Lite mean ratio. (Answer: Core \(1.5\), Plus \(3\), Lite \(0.5\); Plus-to-Lite ratio \(6\).)