[R] Linear regression of 0/1 response ElemStatLearn (Fig. 2.1 the elements of statistical learning)
Denis Kazakiewicz
d.kazakiewicz at gmail.com
Mon Sep 1 12:27:22 CEST 2014
Hello
In chapter 2 ESL book authors write: Let's look at example of linear
model in a classification context
They fit a simple linear model g = 0.3290614 -0.0226360x1 + 0.2495983x2 + e,
where g is given with values 0 or 1. Then they made a decision boundary
where yhat, if yhat>0.5 then yellow.
Question: There is a separation line on the x1x2 plot. Where did
intercept and slope for this line come from?
In the ElemStatLearn R package, they simply put as abline(
(0.5-coef(x.mod)[1]
<http://i.stack.imgur.com/ANaTc.png>)/coef(x.mod)[3],
-coef(x.mod)[2]/coef(x.mod)[3]), where first term is the intercept, and
second term is slope for this line
Regards
Denis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ElemStatLearn.png
Type: image/png
Size: 115859 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20140901/bed7b4e1/attachment.png>
More information about the R-help
mailing list