1

I've run a glm (gaussian family) with a*b as independent variables. At first, I ran two separate models (like glm(y~a) and glm(y~b)), in which the a was not significant and the b was. Then, I combined them together in glm(y~a*b). Combining them, I have both the independent variables significant, even if a less significant than b. How is it possible? Does it have anything to do with the intercept? Shall I try to remove the intercept from the interaction model?

I attached the scripts of the model with just a (ci$TOT), the model with just b (ci$salinity), the model with interaction and the same model with interaction but without intercept.

enter image description here

User1865345
  • 8,202
  • 1
    This has probably nothing to do with the intercept. Some similar questions: https://stats.stackexchange.com/questions/70158/negative-binomial-glm-with-2-factor-variables-adding-interaction-completely-cha, https://stats.stackexchange.com/questions/415793/glm-categorical-iv-predictor-vs-group-by-analysis, https://stats.stackexchange.com/questions/282047/can-interaction-be-statistically-significant-while-only-one-of-two-main-effect-a and many others ... search this site – kjetil b halvorsen Dec 16 '19 at 01:50
  • There are many FAQs related to this question. See https://stats.stackexchange.com/search?tab=votes&q=regression%20significant%20not. – whuber Sep 05 '22 at 16:20

1 Answers1

0

You could have a situation roughly like this:

Scatterplot with marginal histograms for fake data

I make up a rather trite fictional $x$ and $y$. There is also a factor variable in play (I hope red and blue circles are OK). If you look at the margins of this plot, it might be difficult to distinguish the two groups of $x$ or of $y$. Maybe $y$ just looks (to an hypothesis test) like a univariate sample, however, when you consider both $x$ and the factor variable (coloured dots) together in a model, it's very clear that you have two intercepts (as it happens I gave them both the same slope).

If you have an interaction, you also have one slope slightly steeper than the other. But because of confounding you don't get that reported in your single variable regressions.

Paul Hewson
  • 1,601