I have a question about the meaning of the p-values when testing an interaction between a continuous and a categorical variable (with more than 2 categories).
When I do that in a glm model using R, I obtain a p-value for each class of the categorical variable vs. continuous one. However, I would like to get the p-value for the interaction itself using R, and to understand what the meaning of this p-value is.
An example of the code and results:
model_glm3=glm(cog~lg_hag+race+pdg+sex+as.factor(educa)+(lg_hag:as.factor(educa)),
data=base_708)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 21.4836 2.0698 10.380 < 2e-16 ***
lg_hag 8.5691 3.7688 2.274 0.02334 *
raceblack -8.4715 1.7482 -4.846 1.61e-06 ***
racemexican -3.0483 1.7073 -1.785 0.07469 .
racemulti/other -4.6002 2.3098 -1.992 0.04687 *
pdg 2.8038 0.4268 6.570 1.10e-10 ***
sexfemale 4.5691 1.1203 4.078 5.15e-05 ***
as.factor(educa)2 13.8266 2.6362 5.245 2.17e-07 ***
as.factor(educa)3 21.7913 2.4424 8.922 < 2e-16 ***
as.factor(educa)4 19.0179 2.5219 7.541 1.74e-13 ***
as.factor(educa)5 23.7470 2.7406 8.665 < 2e-16 ***
lg_hag:as.factor(educa)2 -21.2224 6.5904 -3.220 0.00135 **
lg_hag:as.factor(educa)3 -19.8083 6.1255 -3.234 0.00129 **
lg_hag:as.factor(educa)4 -8.5502 6.6018 -1.295 0.19577
lg_hag:as.factor(educa)5 -17.2230 6.3711 -2.703 0.00706 **
I would like to have the p-value of the interaction and its meaning (i.e., just one p-value for the whole interaction, not one for each category)