Announcement

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

  • ebalfit: New command for entropy balancing

    A new command for entropy balancing is now available from SSC. Type

    Code:
    . ssc install ebalfit
    to install the command. The latest update of moremata is required; type

    Code:
    . ssc install moremata, replace
    The goal of entropy balancing is to find weights that balance data between groups, for example in treatment effect estimation. It is similar to inverse probability weighing (IPW), but unlike regular IPW, entropy balancing achieves perfect balance (if feasible). Entropy balancing can also be used, for example, to adjust a sample to known population distributions.

    The new command called ebalfit estimates an entropy balancing model (similar to a logit model) and displays its coefficients along with standard errors. predict can then be used to generate the balancing weights or the propensity score implied by the model. Variance estimation is based on influence functions, which can be stored for further usage (e.g. to correct standard errors of statistics computed using the balancing weights).

    The heavy lifting is done in Mata; see the new mm_ebalance() function in moremata.

    ben


  • #2
    Sorry, the SSC version does not yet support predicting the propensity score. I added this after sending the files to Kit. Until an update becomes available, the propensity score can be generated as follows:

    Code:
    ebalfit ...
    _predict xb // note the underscore
    generate pscore = invlogit(xb)

    Comment


    • #3
      ebalfit has now been updated on SSC. The predict routine now has options w (balancing weights; the defaul), pr (propensity score), and xb (linear predictions). I also improved support for factor variables when option targets() is specified, and fixed some minor issues. Both ebalfit and moremata need to be updated; type

      Code:
      . ssc install ebalfit, replace
      . ssc install moremata, replace
      or use the adoupdate command.
      ben

      Comment


      • #4
        I am having an error while running this. Below is the code I run
        ebalfit cash diversity controls, by( dummy)
        The error is "variable in by() must identify exactly two groups" however, when i specify both the sub-sample variables, it give me another error as "by(): too many variables specified"

        Comment


        • #5
          Hi, the error means that, apparently, variable dummy identifies just one group or identifies more than two groups (i.e. has just one distinct value or has more than two distinct values). Type tabulate dummy to inspect the variable. Maybe the problem is that only one group is left in dummy once missings on cash, diversity and controls have been removed from the estimation sample. Type, for example, regress cash diversity controls followed by tabulate dummy if e(sample) to find out. ben

          Comment


          • #6
            Hi Ben,

            Could you just tell me what Entropy Balancing does? Is it similar to PSM ? I went though Hainmueller, J., & Xu, Y. (2013). Ebalance: A Stata package for entropy balancing. Journal of Statistical Software, 54(7). They calculate weights in their example (_webal). For what these weights can later be used ? Can you see the average treatment effect through these weights and how ?

            Comment


            • #7
              Maybe have a look at the following paper: https://ideas.repec.org/p/bss/wpaper/39.html
              It also contain an example that shows how to estimate treatment effects using the balancing weights.
              ben

              Comment

              Working...
              X