[R] How to interpret lm's coefficients?
Matti Viljamaa
mviljamaa at kapsi.fi
Thu Sep 8 14:43:55 CEST 2016
I’m trying to understand how to interpret the return values, specifically “Coefficients:”, of R’s lm function. I’m using it with a dichotomic predictor (mom_hs).
lm(data$kid_score ~ data$mom_hs) returns
Coefficients:
# (Intercept) data$mom_hs
# 77.55 11.77
I read that the (Intercept) value is the “y-intercept” value b, i.e. the y value where the line intercept the y-axis.
The second value is the value of the term m (or “slope”) in the equation of a line y=mx+b.
However,
These two numbers also have the following interpretations:
b or (Intercept) value is the same as:
The mean of those data$kid_score that have data$mom_hs == 0.
Why is this a valid interpretation?
m or data$mom_hs value is the same as:
The difference of means between those data$kid_score that have data$mom_hs == 1
and those data$kid_score that have data$mom_hs == 0.
Why is this a valid interpretation?
Can someone explain?
More information about the R-help
mailing list