Announcement

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

  • combining ivreghdfe and psacalc

    I am using.the package ivreghdfe and now I want to use the package psacalc from Olster (link). The package essentially calculates treatment effects and relative degree of selection under proportional selection of observables and unobservables.

    The instructions are crystal clear as it states that if I want to use fixed effects then I could do something along these lines:


    Use after fixed effects model with individual effects taken as nuisance parameters
    . xtreg ln_w grade age c.age#c.age ttl_exp c.ttl_exp#c.ttl_exp tenure c.tenure#c.tenure 2.race not_smsa south, fe
    . psacalc beta south
    The problem is that the same does not seem to be possible when using ivreghdfe (or even reghdfe). I presume there's a smart way to go around this, but I am missing it as I am relatively new to Stata. Any thoughts and/or suggestions are very welcome!



  • #2
    If your question is: “is there a way to use reghdfe from Correia (http://scorreia.com/software/reghdfe/) with psacalc from Oster (https://ideas.repec.org/c/boc/bocode/s457677.html).”

    The short answer is no.

    However, it may be appropriate to take advantage of the two like this:

    Code:
    * run the regression with reghdfe
    reghdfe ln_wage grade age agesq ttl_expt tl_expsq tenure tenuresq not_smsa south, cluster(id) absorb(id race)
    * save the sample in case reghdfe dropped singletons
    g thissample = e(sample)
    * run with areg for use with psacalc
    areg ln_w grade age agesq ttl_expt tl_expsq tenure tenuresq not_smsa south i.race if , cluster(id) absorb(id) // moved race out of absorb because areg’s absorb() only takes one argument
    * run psacalc
    psacalc beta south
    (note that I don’t have an actual dataset or model in mind here. This is just an example of syntax, I’m assuming that there are several races and a panel of individuals constructed such that areg is appropriate)

    The assumption of this approach is that reghdfe and areg calculate similar differences in R2 from the model without controls to the model with controls.
    This is likely a strong assumption, so the results of this method should be interpreted with caution. However, I think this approach will allow users to at least get a sense of the magnitude of the relative degree of selection that they are facing.

    I’m actually quite curious to know what other Statalisters do in this situation as well.
    Last edited by Arthur Morris; 30 Jan 2020, 23:35.

    Comment


    • #3
      For those who are interested, I've put together a version of psacalc that supports reghdfe. https://github.com/ArthurHowardMorri...pports_reghdfe

      Comment

      Working...
      X