I'm interested in understanding if the interaction of a categorical variable (group A or B) and a continuous one (X1) can predict reaction time.
I started by testing the main effects plus the interaction using fitglm
in Matlab.
modelspec = 'RT ~ group*X1'; % test interaction and individual factors
% Logistic regression model
mdl1 = fitglm(data,modelspec,'Distribution','binomial','CategoricalVars',[1])
With this model the interaction term is not significant, although when I plot the data it seem like there is an interaction. Model output:
Estimated Coefficients:
Estimate SE tStat pValue
________ ________ _______ _________
(Intercept) -0.80295 0.15055 -5.3336 9.631e-08
group 0.31 0.23212 1.3355 0.18171
X1 0.1202 0.056139 2.1412 0.032261
group:X1 0.13312 0.085264 1.5613 0.11846
1369 observations, 1365 error degrees of freedom
Dispersion: 1
Chi^2-statistic vs. constant model: 58.7, p-value = 1.12e-12
Next I looked at the interaction only and the interaction is significant:
modelspec = 'RT ~ group:X1'; % test interaction only
% Logistic regression model
mdl2 = fitglm(data,modelspec,'Distribution','binomial','CategoricalVars',[1])
Estimated Coefficients:
Estimate SE tStat pValue
________ ________ ______ __________
(Intercept) -0.52461 0.071806 -7.306 2.7524e-13
group:X1 0.26365 0.036835 7.1576 8.2125e-13
1369 observations, 1367 error degrees of freedom
Dispersion: 1
Chi^2-statistic vs. constant model: 54.1, p-value = 1.94e-13
I'm a bit lost and don't really know how to interpret these results, particularly from the first model (mdl1 = main effects and interactions). As I said, my main interest is the interaction. Should I report the model with the interaction only? What would be the correct way forward?
Any input is welcome!