Announcement

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

  • Create weighted least squares regression (WLS) where weights are inverse standard errors dummy variables

    Dear Stata-Community,

    I am running a regression to explore the role of specific variables to explain estimators of dummy coefficients. To account for bias estimation caused by unobserved heterogeneity in the estimations of dummy coefficients, I need to adjust for measurement error. i would like to do so with WLS, where the weights are the std. errors of dummy variables from a previous regression, whose constant are now the dependent variables.

    Is there a neat way how to include the weights in a regression. Something comparable to [aweight=std.-errors of var ^(-1)]

    I hope you can help me out here!

    Many thanks, Kaspar

  • #2
    Weighted least squares is indeed accomplished with Stata -aweights-. But the normal use of weighted least squares weights an observation in inverse proportion to its variance. So assuming that the standard errors you refer to are in the right general direction, I would think you would actually want to weight by the inverse of their squares.

    Now, I probably don't understand correctly what you want to do, but I've interpreted your question as saying that the figures you are trying to use as weights are the standard errors of the coefficients of these variables when they were used as predictors in an earlier regression analysis. But the standard errors that come out of a regression refer to the sampling variation in the coefficients, and have nothing to do with the precision of the variables themselves. So I don't quite get why using these standard errors (or their squares) is the way to go here.

    Moreover, in a weighted regression, weights apply at the level of the observation and different observations will, in general, have different weights (though they may be constant with some clusters or groups). But the standard error of a coefficient from a regression output is a single number. Applying it as a weight (regardless how transformed) to every single observation in the regression is the same as doing an unweighted analysis. I don't understand how you will get variation in weights among observations here.

    I have no idea what you mean when you say "whose constant are now the dependent variables."

    From "[aweight=std.-errors of var ^(-1)]" I take it that you want to apply several weights at one time. You cannot do that in Stata: only one weight variable can be specified in any analysis. Sometimes it is sensible to multiply desired weights together and use the product as the -aweight- . Given that I don't really understand what you're trying to do, it's hard for me to comment whether that makes any sense or not in your case--but I will make the general case that that's typically only appropriate for -pweight-s.

    Comment


    • #3
      thank you Clyde,

      Yes. you are right my explanatino is not very straightforward. I might be better off using the normal -aweights-. Would you happen to know the syntax for it and how to specify the weights? I cannot find a reliable explanation online. Might be my mistake that i do not search for it correctly.
      Thanks in advance,
      Kaspar

      Comment


      • #4
        The normal syntax for specifying -aweights- in a regression is just

        Code:
        regress depvar list_of_indep_vars [aweight=varname]
        where you replace varname by the name of the variable that specifies the weight of each observation.

        Comment


        • #5
          Thank you very much! i expected it to be more complicated ... Cheers, Kaspar

          Comment

          Working...
          X