Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why my linear model produces curve?

    Hello folks, I am running a logistic regression model and for some unknown reasons, my linear model produces a curve, which seems odd to me. Aren't linear models supposed to produce a straight line? Below are my syntax and I am using performance data (continuous) to predict a binary outcome. Is there anything wrong with my model?

    Code:
    logit outcome performance
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	27.8 KB
ID:	1424057

  • #2
    -logit- (logistic regression) is not a linear model. This kind of sigmoid curve is exactly what you should expect from this kind of model.

    Comment


    • #3
      Mathematics uses the term "linear" in a couple of different senses.
      Linear models are frequently described as "linear in the parameters." This is to say they are "linear" in the sense of "linear algebra", which is only sometimes the same as the sense of "lines in geometry." For example, any polynomial model is a "linear model", e.g. y = b0 + b1x + b2x2 is "linear" in the sense of linear algebra!
      By the time you add the link function of a generalized linear model to the equation, most glm's are non-linear in the geometric sense.

      Your model is linear in the parameters, but not linear in the geometric sense. Mathematicians have a funny way with language!
      Doug Hemken
      SSCC, Univ. of Wisc.-Madison

      Comment


      • #4
        Notice that the model you fit is
        Code:
        log(p{outcome!=0}/(1-p{outcome!=0})) = a + b*performance
        but the first two statistics shown in
        Code:
        help logit postestimation
        for the
        Code:
        predict
        command are
        Code:
        pr    probability of a positive outcome; the default
        xb    linear prediction
        In other words, you are plotting the predicted probability, which is a nonlinear transformation of the linear prediction of the log of the odds ratio, which you fit to your "linear model".

        Comment


        • #5
          Hello all, thanks a lot for your replies. I see your point. May I ask what if I need the linear specifications of the model? For instance, I can add square and cubic terms of the predictor in the model but what would be the linear specification of the logit model? Will linear specification be able to produce a straight line?

          Comment


          • #6
            Originally posted by Man Yang View Post
            Hello all, thanks a lot for your replies. I see your point. May I ask what if I need the linear specifications of the model? For instance, I can add square and cubic terms of the predictor in the model but what would be the linear specification of the logit model? Will linear specification be able to produce a straight line?
            What do you mean by the linear specification of the logic model? What you typed into Stata is the linear specification, in one sense. Stata estimates a beta, so a one-unit change in the variable performance produces a beta-unit change in log odds. Same thing if you added polynomial terms to the model.

            If you are looking for a probability model where performance has a straight-line effect on the probability, then - I say this with considerable reservation - you can fit a linear probability model:

            Code:
            regress outcome performance
            But, as Richard Williams explains, there are quite a few problems with these. I don't see these used at all in my area of research.
            Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

            When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

            Comment


            • #7
              I see. Thanks!

              Comment

              Working...
              X