Announcement

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

  • ivreg2 warning that covariance matrix is not of full rank. But can't figure out why

    I am running fixed-effect instrumental variable panel regression. The data is unbalanced panel. The cross-sectional unit is bond. I run regression in daily frequency. The variable on the left hand side is bond yield. Instead of running xtivreg, I use ivreg2 and manually add fixed effect terms for bonds (i.bond_id). It is because I want to use the post-estimation command "weakivtest". I cannot use "weakivtest" after xtivreg.

    I am having hard time figuring out why I am getting the warning message below. Could you help?

    code:

    set matsize 10000
    eststo clear

    bysort bond_id: drop if _N <= 2
    ivreg2 yield x1 i.bond_id x2 (x3 = z), cluster (bond_quarter_id)
    weakivtest


    Then I get the following warning message:

    Warning: estimated covariance matrix of moment conditions not of full rank.
    overidentification statistic not reported, and standard errors and
    model tests should be interpreted with caution.
    Possible causes:
    number of clusters insufficient to calculate robust covariance matrix
    singleton dummy variable (dummy with one 1 and N-1 0s or vice versa)
    partial option may address problem.


    I tried to fix problems on my own.

    (1) I do not have any singleton dummy. As you can see in my code, I drop all bonds that appear no more than 2 times in the data. Hence, any i.bond_ID cannot be singleton.

    (2) I cannot use partial out option, unfortunately. If I do that, then I have a problem with "weakivtest". I get the message that "weakivtest" cannot be used with noconstant option.

    (3) number of clusters: this is why I am clustering at the bond-month level, instead of bond-level. I have about 3000 bonds. I have about 30,000 unique pairs of bond and quarters. The number of clusters is far larger than the number of indicator variables.

    I want to use "weakivtest" because the usual rule-of-thumb (F statistic should be greater than 10) holds only for homoskedastic errors without auto-correlation. I am following the NBER SI http://conference.nber.org/confer/20...18/ML/Note.pdf.

    At this point, I have no idea where the problem is coming from. Any suggestions?





  • #2
    You'll increase your chances of a useful answer by following the FAQ on asking questions. It is very hard to identify a data-related problem if we cannot replicate the problem.

    I don't know if your handling of singletons works - if there are any other missing observations, you could have singletons in the estimable sample. Since it appears that problem is in xtivreg2, I would see if it appears for xtivreg also. I'd also look at the estimation results (both stages) - do they look odd?

    Comment


    • #3
      Phil Bromiley

      Thank you for your answer. I was able to reproduce my problem using STATA dataset. Because I am using confidential commercial dataset, I can't post it here.

      The code is below. There aren't any singleton dummies, but I am seeing a warning message. Could you help me understand why I am getting this warning message?

      Code:
      net from http://www.stata-press.com/data/mus
      net install mus
      net get mus
      use mus08psidextract.dta, clear
      set matsize 10000
      ivreg2 lwage exp exp2 i.id (wks = ms), cluster(id)
      weakivtest

      Comment


      • #4
        Add the partial option at the end of your ivreg2 command
        ivreg2 lwage exp exp2 i.id (wks = ms), cluster(id) partial(i.id)

        Note that you can also use:
        xi: xtivreg2 lwage exp exp2 (wks = ms), fe cluster(id)
        xtivreg2 does not allow factor variables: you have to use xi:
        Last edited by Eric de Souza; 14 Dec 2018, 02:02. Reason: Last line added

        Comment


        • #5
          Eric de Souza

          Thank you for your feedback. Yes, I considered that "partial" option as well. The "parital" option will remove constant from my regression. However, if I do that, then I cannot use the post-estimation command "weakivtest". I get the message that weakivtest is not compatible with nonconstant option.

          I hope I can use xtivreg. Unfortunately, again, "weakivtest" command is compatible only with ivregress or ivreg2.

          Do you have any other suggestion to resolve this challenge?

          Comment


          • #6
            There is the possibility to use -weakiv- .
            weakiv ivreg2 lwage exp exp2 i.id (wks = ms), cluster(id) partial(i.id)

            I do not know what weakivtest does since I have never used it.

            You could also use
            xi: weakiv xtivreg2 lwage exp exp2 i.id (wks = ms), fe cluster(id)
            Last edited by Eric de Souza; 14 Dec 2018, 11:43.

            Comment


            • #7
              Eric de Souza

              Thanks. That would be an alternative route. But I am having hard time figuring out how to get point estimate for coefficients using this weakiv command. Could you help? I get confidence interval from AR statistic, but I am not quite sure I can just take the midpoint and claim that is the point estimate.

              Comment


              • #8
                The confidence intervals provided are for the endogenous regressors estimated using the xtivreg2 command.

                Comment

                Working...
                X