Announcement

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

  • different directions of margins and coefficient

    Hi,

    I ran a glm model and the exp(b) of the teachereffect_A var as you can see indicates a positive relation. and FYI the range of values of the var goes from negatove to positive.

    Below is part of the output table

    Code:
    Survey: Generalized linear models
    
    Number of strata   =        31                  Number of obs      =      1520
    Number of PSUs     =       185                  Population size    = 1512.8983
                                                    Design df          =       154
    
    -----------------------------------------------------------------------------------
                      |             Linearized
            W4schatYP |     exp(b)   Std. Err.      t    P>|t|     [95% Conf. Interval]
    ------------------+----------------------------------------------------------------
          1.IndSchool |   .7057381   .0811252    -3.03   0.003       .56237    .8856557
                      |
           phaseofEdu |
                   1  |   .8929305   .0484512    -2.09   0.039     .8021672    .9939634
                   2  |   1.016741   .0275204     0.61   0.541     .9638024    1.072587
                      |
        KS4_IDACI_Z_A |    1.03057   .0153974     2.02   0.046     1.000597    1.061441
      teachereffect_A |   1.009789   .0010188     9.66   0.000     1.007778    1.011803
           Squality_A |   1.000367   .0003837     0.96   0.340     .9996093    1.001125
       KS4_CVAP3APS_Z |   1.046751    .015372     3.11   0.002      1.01682    1.077563
    However, when I calculated the margins, it shows a negative margin. I am a bit confused why the change in direction. could anyone help plz!!!

    Code:
    . margins, eyex( teachereffect_A) at((asobserved) teachereffect_A) at((mean) teachereffect_A)  vce(unconditional)
    
    Average marginal effects                        Number of obs      =      1664
    
    Expression   : Predicted mean KS4_PTSTNEWG, predict()
    ey/ex w.r.t. : teachereffect_A
    
    1._at        : (asobserved)
    
    2._at        : teachereff~A    =   -.8258727 (mean)
    
    ---------------------------------------------------------------------------------
                    |             Linearized
                    |      ey/ex   Std. Err.      t    P>|t|     [95% Conf. Interval]
    ----------------+----------------------------------------------------------------
    teachereffect_A |
                _at |
                 1  |  -.0039978   .0027474    -1.46   0.148    -.0094239    .0014284
                 2  |  -.0039978   .0012511    -3.20   0.002    -.0064687   -.0015268
    ---------------------------------------------------------------------------------
    Thx

  • #2
    In my line of work we pretty much never deal with elasticities, so I'm a little out of my depth here. But as I understand elasticities, they represent ratios of relative changes. When you have a variable that includes both negative and positive values, relative changes really don't make sense. Moreover, look at [R] margins and you will see that eyex is defined by:

    Code:
    eyex() = dy/dx * (x/y)
    So if dy/dx and y are positive, and if x is negative (as it clearly is from the output), eyex will be negative.

    I'm not really sure what these elasticities mean; my instinct is that they don't mean anything at all with variables that can change sign. But, whatever they mean (if anything), there doesn't seem to be any inconsistency between their being negative and the regression coefficient's being positive.

    Comment


    • #3
      Thanks a lot Clyde for your explanation. So to clarify then, how should i interpret the exp(b) of the var?

      Comment


      • #4
        Well, you don't actually show us the command that generated the -glm- output. But I'll assume it was the natural context for using exponentiated coefficients: you used a log link function.

        So if y is your outcome variable, and x is your predictor variable (for simplicity I'll assume there is just one, but nothing hangs on this), using a log link the fundamental equation is:

        log(E(y)) = xb, y having a distribution specified by the family() option.

        So b is the change in log(E(y)) associated with a unit increase in x. So, call the expected values of y associated with two values of x separated by one unit y0 and y1. Then

        b = log(y1) - log(y0) = log(y1/y0)..

        So exponentiating both sides:

        exp(b) = y1/y0.

        In other words exp(b) is the ratio of the difference in the expected value of the outcome associated with a unit difference in x.
        Last edited by Clyde Schechter; 05 Nov 2015, 11:49.

        Comment


        • #5
          Thx Clyde!

          Here is the command with part of the output table

          Code:
          . svy: glm KS4_PTSTNEWG  i.IndSchool ib(4).phaseofEdu  KS4_IDACI_Z_A teachereffect_A Squality_A KS4_CVAP3APS_Z i.W2heposs9YP i.W2hiqualgfa
          > m i.W2nssecfam W12incestMPMEAN_Z i.W2Hous12HH i.urbind i.W2FeFinMP0c i.W2schlifMP ib(last).W2condur6MP ib(last).W2condur5MP i.W2famtyp i
          > .W1relig1YP i.W1ethgrpYP i.W1sexYP ib(last).W2senMP KS4_AGE_START if sample1==1, family(gamma) link(log) eform
          (running glm on estimation sample)
          
          Survey: Generalized linear models
          
          Number of strata   =        31                  Number of obs      =      1664
          Number of PSUs     =       190                  Population size    = 1651.1669
                                                          Design df          =       159
          
          -----------------------------------------------------------------------------------
                            |             Linearized
               KS4_PTSTNEWG |     exp(b)   Std. Err.      t    P>|t|     [95% Conf. Interval]
          ------------------+----------------------------------------------------------------
                1.IndSchool |   1.305071   .1100754     3.16   0.002     1.104815    1.541625
                            |
                 phaseofEdu |
                         1  |   1.309673   .0877513     4.03   0.000     1.147342    1.494972
                         2  |   .9816927   .0257035    -0.71   0.481     .9322186    1.033792
                            |
              KS4_IDACI_Z_A |   1.025849   .0185612     1.41   0.160      .989838     1.06317
            teachereffect_A |   1.004852   .0015223     3.20   0.002      1.00185    1.007863
                 Squality_A |   1.001637   .0004378     3.74   0.000     1.000773    1.002502
             KS4_CVAP3APS_Z |   1.383224   .0321076    13.98   0.000     1.321243    1.448112
          The idea is that the outcome var measures test scores and the var teachereffect_A is a standardized variable (that's why it has negative and positive values).

          So would the exp(b) means the ratio of the difference in the test score is 1 with a 1 standard deviation increase in teachereffect_A? I am a bit confused how to intuitively explain it!!!

          Comment


          • #6
            Almost right.

            It says that with each 1 unit increase in teacher effect (in your case, 1 standard deviation increase) the expected measure of test scores goes up by a factor of 1.004852 (after adjustment for the other variables in your model). You could also say this as each standard deviation increase in teacher effect is associated with a 4-tenths-of-one-percent (relative) increase in the expected measure of test scores.

            You have a pretty large sample here, and I'm inferring that the outcome measure is not terribly noisy, so even though this effect is very small, it is estimated precisely enough to attain statistical significance. Whether it's large enough to matter from a practical perspective, I cannot say, as this is way outside my domain of knowledge.

            Comment


            • #7
              Thx a lot Clyde

              Comment

              Working...
              X