# classification using logistic regression model = glm(factor(membership) ~ Freshwater + Marine, data = dataset.factor, family = 'quasibinomial') bhat = model$coefficients yhat = model$fitted.value p = p + geom_abline(aes(intercept = -bhat[1]/bhat[3], slope = -bhat[2]/bhat[3], colour = 'Logistic Regression'), size = 1 )
Out model is logit(Membership) = 3.92484 + 0.12605*Freshwater - 0.04854*Marine.
So the slope of the threshold is 0.12605/0.04854 and the intercept is 3.92484/0.04854.
The resultant threshold is a little bit different from the previous one:
No comments:
Post a Comment