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!