How to interpret multiple linear regression results that don't match graph I have a scenario where the multiple linear mixed model is outputting a significant main effect of my task variable (which is a factor with 2 levels). However, the visual graph does not suggest a main effect of task. The main effect has a p value of .0000008 but the difference between the two slopes looks very small.
Can someone help me figure out why this would be the case? I do notice that the nearFC is set as a numeric value and when I change it to integer the p value changes. Should the continuous variable be numeric or integer? Is the DF wrong (it's huge! why?)?
(Note: the nearFC is a continuous variable). Also note that I changed the name of the x axis but it is the correct variable in the model (i.e., nearFC = clutter). The means for focNear and focFar are 6.9 s and 7.4 s, respectively.
m3<-lm(respTime~task*nearFC, dvsAdj)
summary(m3)

a<-aggregate(respTime~task+nearFC, dvsAdj, mean) 
#finding the mean here because each person did more than 1 trial for each condition. 

ggplot(a,aes(y=respTime,x=nearFC, group=task, color=task))+
  geom_point()+geom_smooth(method="lm", aes(fill=task))  +
  theme_bw() + theme( panel.grid.major = element_blank(), strip.background = element_blank(), panel.border=element_blank(),
        panel.grid.minor = element_blank(),axis.line = element_line(colour = "black"),axis.text = element_text( size = 12),
         axis.text.x = element_text( size = 12 ), axis.title = element_text( size = 12 ))+
  scale_x_continuous(name="\n nearFC", breaks=seq(1,4,1))+ expand_limits(x=c(1,4))+ 
  scale_y_continuous(name="Response Time (s) \n", breaks=seq(0,15,3))+ expand_limits(y=c(0,15))




 A: Edit: Per @James Stanley's suggestion, let me add a tl;dr at the top. The basic issue is that interacted regression models are somewhat complex/subtle to interpret, so the counterintuitive "difference" you see likely arises from the coefficient not corresponding to the comparison you actually want to make.
I am guessing from context that what concerns you is that the coefficient for taskfocNear is highly significant even though the averages of the blue and red dots seem very close to one another. The highly significant result is not necessarily a statistical error so much as it is an indication that the interpretation of the coefficient in front of taskfocNear is highly non-intuitive and probably not what you think it means. Specifically, you need to think carefully about the model you estimated. The regression formula is
$$y = \beta_0 + \beta_1 taskfocNear + \beta_2nearFC + \beta_3 taskfocNear\times nearFC + \epsilon$$
Let us begin by trying to understand what $\beta_0$, the intercept means. In this case, it should correspond to the predicted value of $y$ when $taskfocNear=nearFC=0$. Given the distribution of nearFC in your data, you should note that this is a very strange prediction to try to make. Even though your lowest value of nearFC is greater than 1, you are trying to ask the model what it predicts for nearFC=0, which may not even make sense in your context.
Now, let us move on to the interpretation of $\beta_1$. For this, note that $\beta_1 +\beta_0$ corresponds exactly to your predicted value of $y$ when taskfocNear=1, but nearFC=0. Thus, $\beta_1$ corresponds to the predicted difference in $y$ when taskfocNear=1 vs when taskfocNear=0 for observations when nearFC=0. Again, because you never see values of nearFC=0 in your data, this is a very odd prediction to be asking of your model and may not even be a coherent question to ask given the context of your data. Looking at the plot, you can also see why this difference is so large. Because there is an evident difference in the slope of the red vs blue line, when you try to extrapolate these different slopes from values of the nearFC in your data (ranging from 1-4) all the way down to when nearFC=0, these differences get greatly amplified, which ultimately leads to the estimate of $\beta_1$ highly statistically different from 0.
So what should you do to correct this? The answer to this question depends on what question you really want to ask of your data (that is a question you will need to answer for yourself), but here is one possibility. Perhaps what you really want $\beta_1$ to reflect is something like the answer to the question "for typical values of nearFC, what is the predicted average difference in $y$ if taskfocNear=0 vs when taskfocNear=1. In that case, if you were willing to operationalize the word "typical" to mean "average", then one possibility would be to instead estimate the slightly modified model
$$\begin{aligned}y=\beta_0+\beta_1 taskfocNear &+ \beta_2(nearFC-\overline{nearFC}) \\&+ \beta_3taskFOCnear\times(nearFC-\overline{nearFC})+\epsilon\end{aligned}$$
where here, $\overline{nearFC}$ is the average value of nearFC in your sample. In this case, $\beta_2$ and $\beta_3$ will continue to have the same interpretation (namely, $\beta_2$ will be the slope of the best fit line for $y$ and nearFC for taskfocNear=0 while $\beta_2+\beta_3$ will be the slope of the best fit line for taskfocNear=1. However, $\beta_1$ will now have the interpretation of "what is the predicted difference in $y$ between taskfocNear=0 vs taskfocNear=1 when nearFC is fixed at its average value within the sample.
