Answers for "fitting logistic regression in r"

R
0

logistic regression curve fit R

fit = glm(vs ~ hp, data=mtcars, family=binomial)
newdat <- data.frame(hp=seq(min(mtcars$hp), max(mtcars$hp),len=100))
newdat$vs = predict(fit, newdata=newdat, type="response")
plot(vs~hp, data=mtcars, col="red4")
lines(vs ~ hp, newdat, col="green4", lwd=2)
Posted by: Guest on March-31-2021

Code answers related to "fitting logistic regression in r"

Browse Popular Code Answers by Language