Announcement

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

  • Understanding GLM link(log)

    I am trying to understand how GLM with link(log) option changes by depend and indipendent variables when it runs the regression? Is it the same as runnign a OLS via reg but transform the dependent and ind variables with a log() fucntion?

  • #2
    No. First of all, GLM doesn't in any way modify anything on the independent variable side.

    But it is also not equivalent to log-transforming the dependent variable. If you log transform the independent variable you are estimating a model that says:

    E(log y) = b0 + b1X1 + ...
    In particular, this kind of model cannot be used if y can be zero or negative, because then log y is undefined.

    When you use GLM with the log link, you are estimating a model that says:
    log(E(y)) = b0 + b1X + ...
    Note that this kind of model can still be applied when y takes on zero or negative values, though the model necessarily constrains E(y) to be positive.

    [In the above, E denotes expectation.]

    Comment


    • #3
      Not at all the same.

      First, a link applies only to the response (dependent variable, in your terms) and has nothing at all to do with the covariates. If you wished to transform those, then that's a separate matter. It's not implied logically by using any particular link.

      Second, OLS implies Gaussian error; what assumptions you make about error structure, or more generally the stochastic part of your model, in a GLM follow from which distribution family you choose, and with the log link the Gaussian is only one of various possibilities. Often it's a poor choice.

      Third, there is quite a difference between E[y] = exp(Xb) and E[ln y] = Xb if only because ln() is not linear.

      That's only a start. Although it starts from a different direction http://blog.stata.com/2011/08/22/use...tell-a-friend/ is illuminating here (and in any case).

      I have found http://onlinelibrary.wiley.com/doi/1...440.x/abstract most helpful as a pedagogic introduction, although I can't guarantee that you can access the .pdf without payment.
      Last edited by Nick Cox; 29 Oct 2015, 10:02.

      Comment


      • #4
        Thank you Clyde

        Comment

        Working...
        X