1

Related my earlier question here. Having "mastered" linear regression, I'm trying to learn everything I can about logistic regression and am having issues turning largely "useless" coefficients into meaningful information.

I asked in my previous question about graphing the probability curve for every permutation of a logit model. However, I was working on just plotting the main curve and was having some issues.

If I was running a logit with just one predictor, I'd run the following:

mod1 = glm(factor(won) ~ as.numeric(bid), data=mydat, family=binomial(link="logit"))

all.x <- expand.grid(won=unique(won), bid=unique(bid))
y.hat.new <- predict(mod1, newdata=all.x, type="response")
plot(bid<-000:250,predict(mod1,newdata=data.frame(bid<-c(000:250)),type="response"), lwd=5, col="blue", type="l")

However, what about with multiple predictors? I tried to use the mtcars data set to mess around and couldn't get it.

Any suggestion on how to plot the main probability curve for the logit model.

head(mtcars)

m1 = glm(vs ~ disp + wt, data=mtcars, family=binomial(link="logit"))
summary(m1)

all.x <- expand.grid(vs=unique(mtcars$vs), disp=unique(mtcars$disp), wt=unique(mtcars$wt))

y.hat.new <- predict(m1, newdata=all.x, type="response")
plot(disp<-000:250,predict(m1,newdata=data.frame(disp<-c(000:250), wt<-c(0,250)),type="response"), lwd=5, col="blue", type="l")

EDIT = OR is my previous question what I need to do. Since Y = B0 + B1X1 + B2X2, a one unit change in X1 is associated with a exp(B1) change in Y, regardless of the value of B2. Then would it be possible that my original question is really all that should be done.

My appologies on my stupidity if that is indeed the case.

ATMathew
  • 2,165
  • 11
  • 28
  • 42
  • What do you mean by the "main probability curve" for a logistic model? – whuber Jul 05 '12 at 22:33
  • My "main probability curve," I was thinking there was a single curve similar to that where there is one predictor. I don't know if that is correct or if it'd actually be some weird dimensional surface plot. – ATMathew Jul 05 '12 at 22:41
  • 2
    A curve, by definition, portrays how one quantity (the expected log odds in this case) depends on a *single* additional numerical value. To depict fully the variation of a dependent variable on $p$ independent variables requires a $p$-dimensional surface embedded in a $p+1$-dimensional space. – whuber Jul 06 '12 at 13:16

0 Answers0