0

I ran three IV regressions with the ivreg command. I am trying to save the results of the diagnostic tests so I can then add them to a stargazer table:

summ.reg <- summary(iv_reg, vcov. = function(x) vcovHC(x, type="HC0"), diagnostics=T)

The only difference between the IV regressions is the outcome variable. For two of the regressions, the above command works fine. But for the third, it gives me an error message:

Error in solve.default(vcov.hyp) : 
  system is computationally singular: reciprocal condition number = 1.16738e-21

I ran command summary(iv_reg, diagnostics = TRUE) and the diagnostics tests look fine to me:

Diagnostic tests:
                  df1  df2 statistic p-value   
Weak instruments    7 1602     2.955 0.00444 **
Wu-Hausman          1 1607     0.028 0.86798   
Sargan             13   NA     2.270 0.99954 

So I really don't understand why the error message is coming up. My best guess is that it has something to do with the fact that the Sargan test has NA degrees of freedom, but I don't understand what this means or how to fix it. Any help would be greatly appreciated!

0 Answers0