0

I recently read about poisson regression in R and also about the offset that can be set, as for example described here.

If I understand correctly, this can be used to account for continuous confounders.

What do I do if I want to account for categorical confounders?

Say I want to analyse the influence of disease a and disease b on the number of death cases in a patient population, however, I want to adjust for patient sex?

aldorado
  • 283
  • 3
  • 9

1 Answers1

2

Regardless of whether you use an offset or not, and regardless of whether you are using Poisson or other types of (generalized) linear models, categorical variables are usually handled using dummy variables. For example, a categorical with $k=3$ categories would have $k-1=2$ dummy variables. Denoting the original variable by $x$ and the two dummy variables by $x_1$ and $x_2$ respectively, the following is a typical conversion: \begin{gather} x=1 \rightarrow (x_1=0, x_2=0) \\ x=2 \rightarrow (x_1=1, x_2=0) \\ x=3 \rightarrow (x_1=0, x_2=1) \end{gather} There are of course other ways to recode $x$, and this depends on what you want your coefficients to represent. In this example, let the regression equation be $$ \log \mu_i = \beta_0 + \beta_1 x_1 + \beta_2 x_2 $$ In this case, $\beta_1$ would represent the log risk ratio between category 2 and category 1, and $\beta_3$ the log risk ratio between category 3 and 1. For log RR between 3 and 2, one needs to calculate $\beta_2 - \beta_1$. Thus, depending which are the more relevant risk ratios, you code your categorical variables accordingly.

Tim Mak
  • 1,132
  • 5
  • 14