I'm doing linear mixed model with an interaction between the time and my exposure. The fixed effects look like this :

Y ~ T + T*GRP + X

with T the time, GRP the exposure and X the adjustements factors.

I wondering how to see the average effect of my exposure (categorical variable) on my outcome at all times ? How can I say that there is an effect at any time (or at some time) of my expositio on the outcome ?

By removing the interaction, what can I say ?

Thanks for the help,


Interactions between categorical variables and continuous variables behave a little differently from other types of interactions (say an interaction of a continuous variable with a continuous variable). In a linear model like the one you shared, categorical variables are divided into indicator variables where the number of indicator variables is equal to the number of categories minus one (we subtract one category to keep the model indentifiable). In your case, the actual model would look something like this: $$ Y = T + T*GRP_1 + T * GRP_2 + ... + T*GRP_{p-1} + X$$ where $p$ is number of categories in $GRP$. $GRP_x$ equals 1 whenever an observation belongs to category $x$, and 0 otherwise. The coefficient for $T$ that is not included in the interaction is, in effect, the estimate of $T$ for the category that was left out. The coefficients for each of the interaction terms would be an estimate of the difference in the effect of $T$ for that category versus the left-out category. This might answer your second question, albeit indirectly, since you would really be testing whether there are differences between your exposures. But maybe that is the question of interest?

If you want to know the average effect of each exposure on your response, I think a model like this would do the trick: $$ Y = T + GRP + X $$ Without the interaction, you are simply testing the impact of exposure, regardless of the value of time, while controlling for time. I think this is equivalent to the average effect of your exposures (first question), and possibly speaks to your third question as well, though I'm not entirely sure.

Of course, if exposure is simply a categorical version of time, then everything I say can probably be disregarded. I'm assuming that exposure has to do with intensity and not with duration. Just thought I would double-check on that.

  • $\begingroup$ There actually is probably another way to specify the interaction in your model: Y ~ T + GRP1*T +... GRPp*T + X (no category left out). In this case, you would be comparing the effect of T for each group with the average effect of T. Not entirely sure about this, so maybe someone else could chime in. $\endgroup$ – dante Apr 25 '19 at 21:58
  • $\begingroup$ Thanks a lot for your answer Dante. I was wondering in fact, when I take the interaction, I could say if the effect of my exposure is significantly diferent in this one group compared to another. But, how could I say that there are an effect of my exposure to Y ? Because maybe it's different by group but if the effect is'nt significant for all of the groups ... it's not really interesting. I don't know if I'm clear enough ... $\endgroup$ – Klmce Apr 26 '19 at 17:51
  • $\begingroup$ Do the categories you have represent all the possible combinations of exposure? Like, do you have a category that represents "no exposure" or "zero exposure"? If so, then you would want to leave that category out. Then your estimates for each exposure would be compared to no exposure. If a coefficient estimate was significantly larger or smaller than zero for one of the exposure categories, you could say that that exposure time for a given exposure has an effect that's different from no exposure. $\endgroup$ – dante Apr 26 '19 at 19:17
  • $\begingroup$ No I haven't. I have just my X exposure composed of group 1, group 2 and group 3. $\endgroup$ – Klmce Apr 26 '19 at 19:35
  • $\begingroup$ So does that mean you don't have any data regarding the values of Y when there is no exposure? If so, I don't think you will be able to draw any conclusions about the overall effect of your groups. Categorical variables make a lot more sense when they include all possible scenarios, and usually there is a "null" scenario that we want to know how the other categories compare with. For instance, if we are wanting to study income differences by race, we might compare the incomes of different minority groups with the majority (usually white in the US). $\endgroup$ – dante Apr 26 '19 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.