[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error message: estimates post: matrix has missing values

From   Robert L Ostergard <>
To   "" <>
Subject   Re: Error message: estimates post: matrix has missing values
Date   Mon, 15 Feb 2010 20:19:34 -0800


Thanks for being willing to take a look at this. After running the mat list Vmatrix command, it was obvious that there was a problem, given the whole matrix is missing values. But now I'm at a loss as to why. I'm guessing there is something wrong with the code now. Given my limited knowledge of matrix, I tried to follow the procedure set out in the webpage: . But obviously, I missed something.

Thanks for anything you can help with here.  Bob.

This is the code:

**second stage equation
xtreg Y2 Y1hat X1lag1 X2lag1 X3lag1 X4lag1, re
rename Y1hat Y1hold
rename Y1lag1 Y1hat      */original Y1 replacing predicted Y1
predict double res , e
rename Y1hat Y1lag1
rename Y1hold Y1hat
replace res = res^2
summarize res
scalar realmse = r(mean)*r(N)/e(df_r)
matrix bmatrix = e(b)
matrix Vmatrix=e(V)
matrix Vmatrix = e(V)*realmse/e(rmse)^2
ereturn post bmatrix Vmatrix, noclear

       Y1hat       X1lag1           X2lag1        X3lag1       X4lag1         _cons
y1  3.1597052  1.6225073  -3.9195477   729.46403   .06494996     -459.83919

symmetric Vmatrix[6,6]
              Y1hat          X1lag1      X2lag1      X3lag1      X4lag1       _cons
   Y1hat           .
   X1lag1          .           .
   X2lag1           .           .               .
   X3lag1           .           .               .                 .
   X4lag1           .            .              .                  .                 .
    _cons            .          .              .                   .                  .           .

On 2/15/10 6:33 PM, "Stas Kolenikov" <> wrote:

Please post your code. From your description, it is not possible to
disentangle what's going on. You would also want to

mat list bmatrix
mat list Vmatrix

to find out who's the culprit of the error message.

On Mon, Feb 15, 2010 at 5:06 PM, Robert L Ostergard <> wrote:

> Hi,
> I'm hoping somebody can help me with this problem.
> I'm running a 2sls random effects panel model. Because there of the way
> data
> are reported and the social phenomena involved, we have lags in the first
> and second stage, such that the model looks like this
> Y1(t-1) = a + b1Y2(t-2) + b2X1(t-2) + e
> Y2 = a + b1Y1(t-1) + b2X1(t-1) + e
> Because we think Y1 is weekly endogenous, we are not using the xtivreg
> procedure in stata and are using the separate two stage format needed.
> We are using the basic procedure spelled out in the Stata post for this:
> .
> However, when we get to the final step, ereturn post bmatrix Vmatrix,
> noclear, we get the estimates post: matrix has missing values.
> I have a basic understanding of matrix and the general rules, but the data
> themselves contain no zeroes and there are no missing data. Is this being
> caused by the panel design (we are using xtreg to estimate the equations).
> The basic question is: how do I solve the problem so we can get the correct
> standard errors?
> Any help is certainly appreciated.
> Bob
> *
> *   For searches and help try:
> *
> *
> *

Stas Kolenikov, also found at
Small print: I use this email account for mailing lists only.

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index