Announcement

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

  • Using weakiv with ivreghdfe (ivreg2 based command)

    Hi, I would like to use the package and command weakiv with the ivreghdfe command. weakiv works with ivreg2, in which ivreghdfe is based. However, when I try using it I keep getting the error message "weakiv not supported for command ivreghdfe". Does anyone know a work around for this? Thanks!

  • #2
    ivreg2 is from SSC and ivreghdfe is from https://github.com/sergiocorreia/ivreghdfe (FAQ Advice #12). Go to weakiv.ado and add ivreghdfe as a legal command.

    Code:
    local cmd `1'
            local legalcmd  "ivregress ivreg2 ivreg2h xtivreg xtivreg2 ivprobit ivtobit xtabond2"
            local legal             : list cmd in legalcmd
            if `legal' {
                    di as text "Estimating model for Wald tests using `cmd'..."
            }
    Down the line, you may need to add a few more lines of code for ivreghdfe, but these should align exactly with the code for ivreg2. You have something like:

    Code:
     if "`cmd'" == "ivreg2" { 
           something something something
    and you'll need to add

    Code:
     if "`cmd'" == "ivreghdfe" {
          [same something as ivreg2]  [same something as ivreg2] [same something as ivreg2]

    Comment

    Working...
    X