Announcement

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

  • Weighted regression using iweight

    Hello all,
    For my meta analysis I need to do a regression that is weighted by standard errors (SE). For that all variables should be divided by SE. For weighting I use the command aweight, is this appropriate? Do I need to take SE as my weight or 1/SE? I am just not sure how stata is treating the command. Thanks in advance!

    PS: Title says iweight, but I'm using aweight. Please correct me if I am wrong.
    Last edited by Janik Kaden; 12 Oct 2020, 09:23.

  • #2
    Well, if it is supposed to be weighted by standard errors, then you would use the SE as the -aweight-. But that would be very unusual, in fact, bizarre: that would attach the most importance to the most imprecise estimates. Probably you actually need to weight by 1/SE: that gives the most importance to the most precise estimate, which makes sense. You can't specify an expression in [aweight = ...], so you'll have to calculate a new variable to contain 1/SE and then use that as the aweight variable.

    Comment


    • #3
      Clyde is right about everything of substance--in principle aweights are more appropriate here, and the weighting should be by 1/something.

      One can use expressions in the weights, see below:

      Code:
      . sysuse auto
      (1978 Automobile Data)
      
      . reg price mpg headroom [aw = 1/length]
      (sum of wgt is .3993990438891825)
      
            Source |       SS           df       MS      Number of obs   =        74
      -------------+----------------------------------   F(2, 71)        =     10.09
             Model |   131414418         2  65707208.9   Prob > F        =    0.0001
          Residual |   462256513        71  6510655.11   R-squared       =    0.2214
      -------------+----------------------------------   Adj R-squared   =    0.1994
             Total |   593670930        73   8132478.5   Root MSE        =    2551.6
      
      ------------------------------------------------------------------------------
             price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
               mpg |  -239.4573   55.14623    -4.34   0.000    -349.4158   -129.4989
          headroom |  -273.2898   391.0353    -0.70   0.487    -1052.992    506.4124
             _cons |   12053.86   1996.145     6.04   0.000     8073.662    16034.06
      ------------------------------------------------------------------------------
      I cannot remember though whether one has to weight with 1/var_i, or 1/se_i. Original Poster will have to read this thing himself. Weighting is probably the most opaque and badly documented thing in Stata, it is a real pain. Every time when I need to weight, I read for hours various sources, and then once I am done nothing is left in my head.

      Here is a starter:

      https://www.stata.com/support/faqs/s...ar-regression/

      Comment


      • #4
        Joro Kolev makes good points. I was not aware that you can put an expression into [aweight = ...]. That's good to know and sometimes very convenient.

        He also raises a good question as to whether one should weight with 1/var or 1/se. Normally 1/var is preferred. So O.P. should clarify which is actually needed in his situation.

        Comment


        • #5
          OK, that was my suggestion but I was a little bit confused. Thanks a lot!

          Comment

          Working...
          X