# Variable selection and interpretation of coefficients

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!

• What was your expected outcome when you performed the three model calls? Jan 5, 2022 at 0:11
• I expected that the beta and p-values of snpA and snpB in ③ are the same as the ones in ① and ②, respectively. I have difficulty interpreting the differences. Jan 5, 2022 at 0:17