Announcement

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

  • ereturn post sets e(V) values to zero

    Dear all,

    As part of a larger program, I want to return estimated values and a variance-covariance matrix.

    Code:
    noi mat list V
    ereturn post b V, obs(`N_obs') findomitted depname("`depvar'") properties("b V")
    noi mat list e(V)
    In most cases this works well, but sometimes the e(V) matrix is completely empty, even though it shouldn't be.

    Code:
    symmetric V[4,4]
                     1o.        1o.   1.treat#           
                  treat       post     1.post      _cons
    1o.treat          0
     1o.post          0          0
    1.treat#
      1.post          0          0  .00005276
       _cons          0          0  -.0000137  3.548e-06
    
    symmetric e(V)[4,4]
                    1o.       1o.  1.treat#          
                 treat      post    1.post     _cons
    1o.treat         0
     1o.post         0         0
    1.treat#
      1.post         0         0         0
       _cons         0         0         0         0
    If the negative off-diagonal element is absent, this behavior does not occur. But, as the original matrix was created with standard Stata commands, I don't see any problem with that per se.
    What am I missing?

    Thank you very much!
    Felix

  • #2
    After further investigation, I suspect this may have something to do with the matrix V not being positive semi-definite (the one in the example is not). However, after implementing a test for this, Stata's behavior is inconsistent with this criterion. Most of the matrices I encounter have a very small negative eigenvalue, so maybe there is some threshold? Further insights would be very helpful!

    Comment

    Working...
    X