0

I want to know the meaning of differences of effect sizes in the glm and interaction in R. For example, when I did as below,

glm(formula = affected ~ snpA, family = binomial)

For this, the beta of snpA is 0.37 and the p-value of 1.12e-15. Then, I did as below.

glm(formula = affected ~ snpB, family = binomial)

For this, the beta of snpB is 0.44 and the p-value of 0.0042. Then, I did as below.

glm(formula = affected ~ snpA*snpB, family = binomial)

For this, the results in R showed as below. The beta of snpA is -8.36 and the p-value of 0.83. The beta of snpB is 0.43 and the p-value of 0.0074. The beta of snpA:snpB is 8.73 and the p-value of 0.83.

I wonder why are the beta and p-values different between ⓵ and ⓷ for snpA and between ⓶ and ⓷ for snpB?

I would greatly appreciate your help.

Thanks!

Pitouille
  • 1,506
  • 3
  • 5
  • 16
user10345633
  • 103
  • 3

1 Answers1

2

It would deserve more than a simple answer... but if you think about it, it actually makes sense! Intuitively, in your first model you try to explain your outcome variable with only one independent variable, while in your third model you want to explain it with 3 variables. It cannot be the same, right?

The selection of your model (and inclusion of the relevant independent variable) must be supported by your knowledge of the subject area you are investigating. This is one of the main challenges.

Some relevant CV resources:

Pitouille
  • 1,506
  • 3
  • 5
  • 16