Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: RE: re: 3sls and fixed effects

From   "Biljana Dlab" <[email protected]>
To   <[email protected]>
Subject   st: RE: re: 3sls and fixed effects
Date   Sat, 16 Oct 2010 20:31:21 +0200

Hi Kit,

The size is following:

Number of unique values of gvkey_n is  615
Number of records is  6492

I have totally 6492 firm-year observations.

The time period is 30 years (fyears)

That gives me matrix of:

2*((G-1) + (T-1))


Is that too large?

Thank you for your patience.



-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Christopher
Sent: 16 October 2010 19:53
To: [email protected]
Subject: st: re: 3sls and fixed effects

Biljana said

I have some lagged values in regression - could that be the problem?

This is what I have & get:

. xi: reg3 (DeltaDebt CashFlow dQ size DeltaCashHold debt_lag1 i.gvkey_n
i.fyear) (DeltaCashHold CashFlow dQ size DeltaDebt cashhold_lag2
i.gvkey_n i.fyear), endog(DeltaDebt DeltaCashHold)

i.gvkey_n         _Igvkey_n_1017-103307(naturally coded; _Igvkey_n_1017
i.fyear           _Ifyear_1971-2001   (naturally coded; _Ifyear_1971
1st stage failure.
    Equation:  DeltaDebt CashFlow dQ size debt_lag1 _Igvkey_n_1056 
         _Igvkey_n_1058 _Igvkey_n_1093 _Igvkey_n_1124 _Igvkey_n_1234 
         _Igvkey_n_1248 _Igvkey_n_1283 _Igvkey_n_1284 _Igvkey_n_1327 
         _Igvkey_n_1350 _I

Stata doesn't know that those are lagged variables, so that can't be a
problem. I think what you may be running into is a constraint arising
because of the number of regressors. How many values of gvkey_n are
there in the estimation sample? (You can use -levelsof- to get a list,
and an extended macro function to count the number). If you are
estimating two equations, each with a full set of firm and time dummies,
the covariance matrix is of the order 2*((G-1) + (T-1)) where G=number
of firms and T=number of periods. if the number of firms is large, you
may be running up against a matsize constraint (I've never seen the
error message '1st stage failure').  

As you do not have a dynamic system, you could manually demean each of
the variables via the within transformation and run the regression on
the within-transformed variables. I believe Ben Jann's -center- on SSC
will do the centering transformation under by-group control (by
gvkey_n), which would be cleaner than using egen, mean() with by.


Kit Baum   |   Boston College Economics & DIW Berlin   |
                              An Introduction to Stata Programming  |
   An Introduction to Modern Econometrics Using Stata  |

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index