[R] Linear regression of 0/1 response ElemStatLearn (Fig. 2.1 the elements of statistical learning)
d.kazakiewicz at gmail.com
Mon Sep 1 12:27:22 CEST 2014
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(
-coef(x.mod)/coef(x.mod)), where first term is the intercept, and
second term is slope for this line
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 115859 bytes
Desc: not available
More information about the R-help