Announcement

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

  • Help with variance matrix of all zeros

    Hello! I am brand-new to stata, so please forgive a possibly badly posed question.

    I have a 2SLS regression with two-way fixed effects and clustered standard errors, written as follows:

    Code:
    xi: ivregress 2sls Drcapout (Drcapspend  = i.statenum*Drcapspend_nat) i.year i.statenum, vce(cl statenum)
    Drcapout is the change in output. Drcapspend is the change in government spending by state, instrumented by national spending. I add state and year fixed effects, and cluster by state. However, this gives a variance matrix of all zeros, which results in a "warning: variance matrix is nonsymmetric or highly singular" warning.

    Oddly, the regression works just fine without clustered standard errors. The following regression also works fine:
    Code:
    xi: ivregress 2sls Drcaprout2 (Drcapspend  = i.statenum*Drcapspend_nat) i.year i.statenum, vce(cl statenum)
    Where Drcapout2 is Drcapout deflated by a measure of local prices.

    I genuinely have no idea what the problem is, and would appreciate any pointers.


  • #2
    Hi,
    to better understand the issue I would need to reproduce your problem.
    Could you copy and paste, making sure that such command reproduces your error?

    Code:
    dataex Drcapout Drcapspend statenum Drcapspend_nat year statenum

    Comment


    • #3
      Hi Jo
      perhaps two points
      1. Your command line is incorrect. if drcapspend_nat is continuous, it should be written as
      Code:
      ivregress 2sls Drcaprout2 (Drcapspend = i.statenum#c.Drcapspend_nat) i.year i.statenum, vce(cl statenum)
      Notice the "c." in front of Drcapspend_nat. By default Stata assumes that interactions with "#" all variables are discrete (i.) rather than continuous (c.)
      the other point. While I know why you may want to add year and state fixed effects, you always need to go back and think about how much variation is left.
      If you are interacting Statenum by drcap, adding fixed effects, and clustering. Unless you have multiple observations per State, it will not work (you are absorbing most if not all the interesting variation that way.
      HTH
      F

      Comment

      Working...
      X