Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: RE: Estout and predicted signs - new questions


From   "Herve STOLOWY" <stolowy@hec.fr>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: RE: Estout and predicted signs - new questions
Date   Sat, 05 Mar 2005 10:31:54 +0100

Dear Ben:

I tried and it worked for three out of four of my estout outputs. However, I have a fourth and more complex table which generates a conformability error. In summary, it has the following structure:

Model 1: regress y var1 var2
Model 2: regress y var1 var2 var3
Model 3: regress y var1 var2 var4
Model 4: regress y var1 var2 var3 var4
Model 5: regress y var5 var6
Model 6: regress y var5 var6 var7
Model 7: regress y var5 var6 var8
Model 8: regress y var5 var6 var7 var8

I get a conformability error message after the following command: 
 matrix `b'[1,6] = -999   //neg. sign for legal enforcement

Here are the commands:

regress  em_leuz rank_investor rank_legal, cluster(name) robust
est store m7, title(Model 1)
regress  em_leuz rank_investor rank_legal rank_absence1, cluster(name) robust
est store m8, title(Model 2)
regress  em_leuz rank_investor rank_legal rank_divergence1, cluster(name) robust
est store m9, title(Model 3)
regress  em_leuz rank_investor rank_legal rank_absence1 rank_divergence1, cluster(name) robust
est store m10, title(Model 4)
regress  em_leuz investor legal_enforcement, cluster(name) robust
est store m11, title(Model 5)
regress  em_leuz investor legal_enforcement absence1, cluster(name) robust
est store m12, title(Model 6)
regress  em_leuz investor legal_enforcement divergence1, cluster(name) robust
est store m13, title(Model 7)
regress  em_leuz investor legal_enforcement absence1 divergence1, cluster(name) robust
est store m14, title(Model 8)

tempname b
matrix `b' = e(b)
matrix `b'[1,1] = -999   //neg. sign for rank of investor protection
matrix `b'[1,2] = -999   //neg. sign for rank of legal enforcement
matrix `b'[1,3] = +999   //pos. sign for rank of absence
matrix `b'[1,4] = 998    //? for rank of divergence
matrix `b'[1,5] = -999   //neg. sign for investor protection
matrix `b'[1,6] = -999   //neg. sign for legal enforcement
matrix `b'[1,7] = +999   //pos. sign for absence
matrix `b'[1,8] = 998    //? for divergence
matrix `b'[1,9] = 998    //? for _cons
eret2 matrix signs = `b'
local e_scalars: e(scalars) //get the names of the scalars in e()
foreach e of local e_scalars { 
 eret2 local `e' , replace  //replace the scalars by empty macros
 //or: eret2 scalar `e' = .z , replace //set the scalars to missing
}
estimates store pred

estout pred m7 m8 m9 m10 m11 m12 m13 m14 using using estout_table6_V3, replace substitute(-999.000 - 999.000 + 998.000 ?) cells ("signs(pat (1 0 0 0 0 0 0 0 0)) b(fmt(%9.3f) pat(0)) p(fmt(%9.3f) pattern(0))") stats (N F p r2 r2_a, fmt(%9.0f %9.3f %9.3f %9.3f %9.3f) labels ("Number of observations" "F" "Prob>F" "R-square" "Adjusted R-square")) label  varlabels(_cons Constant)

Maybe the problem arises from the structure of the table which mixes two basic models (with var1 to var4 and then with var 5 to var 8). 

I can add that in the three other tables, the solution you proposed works perfectly. But they are all based on the accumulation of the same variables (from x1 to x8 for the more complex table).

Sorry again to bother you but I promise it's the last table.

Best regards

Hervé





***********************************************************
Professeur/Professor
Coordinateur du Département/Head of Department
HEC Paris
Département Comptabilité Contrôle de gestion / Dept of Accounting and Management Control
1, rue de la Liberation
78351 - Jouy-en-Josas
France
Tel: +33 1 39 67 94 42 - Fax: +33 1 39 67 70 86
stolowy@hec.fr
http://campus.hec.fr/profs/stolowy/perso/home.htm
>>> ben.jann@soz.gess.ethz.ch 03/04/05 9:36 PM >>>
Hervé wrote:
> It worked and I am very close to the end result. There is 
> still a little problem. In the utput, under each column of 
> coefficients, for each model, I get the general stats (N, 
> F...). Surprisingly, in the column "predicted signs", instead 
> of getting blanks on the ligns corresponding to the general 
> stats, I obtain the general stats of the last model.

Hm, I didn't think about this. That the general stats of the
last model are displayed in the "predicted signs" column is not 
surprising at all because these are the stats which are stored
with the "pred" estimates. In order to supress the stats in the 
estout table, the stats should first be removed from the "pred" 
estimates (or set to ".z"). Your code should thus be:

 tempname b
 matrix `b' = e(b)
 matrix `b'[1,1] = -999   //neg. sign for common
 matrix `b'[1,2] = +999   //pos. sign for ownership
 matrix `b'[1,3] = .z     //no sign for finance_aggregate
 matrix `b'[1,4] = 998    //? for _cons
 eret2 matrix signs = `b'
 local e_scalars: e(scalars) //get the names of the scalars in e()
 foreach e of local e_scalars { 
  eret2 local `e' , replace  //replace the scalars by empty macros
  //or: eret2 scalar `e' = .z , replace //set the scalars to missing
 }
 estimates store pred

ben

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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