# interpreting R lm(..) output when a variable is used as a factor [duplicate]

Below is a print screen of a summary(lm(..)).

I called the response variable response explained by a continuous variable X and a factor Y. I'm trying to understand (not to the point of understanding the algorithms used to compute these results) the meaning of this output. My questions might be duplicates, but I haven't found the answer anywhere or if I did, I couldn't understand it!

• The model is response = -4.461010 + blabla... What does the p.value for this intercept mean? Does it mean that the predicted line of my data significantly does not pass by the Origin?

• factor(Y)2 is significant. Does it mean that for the subset of data2 where Y equals 2, the values of response are significantly different than in the subset where Yequals 1 (which is taken as a reference)?

• Imagine a graph where the lines for subset(data2,Y==1) and subset(data2,Y==2) look alike but the line for subset(data2,Y==3) is totally different. If factor(Y)3 is taken as a reference, we'll get the two others to be significant and if factor(Y)1 is taken as a reference, factor(Y)3 will be significant but not factor(Y)2. Is it correct?

• For the interactions X:Y2 and X:Y3. Does the low p.values mean that for both the subset Y==2 and Y==3, the variable X acts differently than it does for the subset Y==1?

Thanks a lot for your help!

• You might want to clarify what your data are and what your question is. I suspect that you want to know if there are main effects of $X$ and $Y$ and an interaction between the two, in which case you might want to run anova(lm(..)). Aug 30, 2013 at 16:44
• No, I don't want to use the anova function. I think I understand the results of the anova. I just don't understand the output of the summary(lm(..)). Do my above questions make sense? It is really the meaning of each line in the output example that interests me. Aug 30, 2013 at 17:37
• Because you ask multiple questions I can only identify one official "duplicate." The meaning of poly is explained at stats.stackexchange.com/questions/66280. The interpretation of interactions is explained in many threads: do a search. Interpreting regression coefficients is explained in many threads; this one also explains the p-values and R's output: stats.stackexchange.com/questions/5135.
– whuber
Aug 30, 2013 at 18:08
• @whuber I know what poly means. And I found the last link you gave me. I don't think, it provides the answer to my questions concerning the meaning of the p.values when using factors. Or if it does, I don't get it. Aug 30, 2013 at 20:39
• In that case reading about p-values may help. If it doesn't, then consider editing this question to focus on whatever you are specifically struggling with that is not addressed in any of those other answers.
– whuber
Aug 30, 2013 at 20:41