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

st: -outreg- after -ml-. Reply to Matias Barenstein and possible tiny bug to be confirmed


From   "Renzo Comolli" <[email protected]>
To   <[email protected]>
Subject   st: -outreg- after -ml-. Reply to Matias Barenstein and possible tiny bug to be confirmed
Date   Mon, 9 Jun 2003 02:08:52 -0400

Dear Matias,

-outreg- works for me after -ml- (example below).
Possible causes of your problem
1. -outreg- must follow -ml maximize- and NOT -ml model-

2. I believe there may be a small bug for which I would be grateful if there
were independent confirmation when the option -append- is specified and the
file path contains a blank space e.g. 
outreg using "C:\My Documents\outreg_and_ml.txt", append bracket se 3aster
coefastr addstat("Prob > chi2" , e(p)) 
Returns
invalid 'Documents' 
Same problem if compounds quotes are used.
Strangely enough, it seems to work great when the option -replace- is
specified regardless of blanks.
As a temporary fix, it does work when there is no blank in the path e.g.
outreg using "c:\data\outreg_and_ml.txt", append bracket se 3aster coefastr
addstat("Prob > chi2" , e(p)) 

3. It might work for my ml and not for yours. I have no idea of what -ml
model- you are using. I could not test them all :)

. which outreg
c:\ado\stbplus\o\outreg.ado
*! version 3.0.6  27nov00  by [email protected]  (STB-59:
sg97.3)
. about
Intercooled Stata 8.0 for Windows
Born 03 Jun 2003

Separately, I want to thank Nick Cox for his canned solution for better
lables for dummy variables
http://www.stata.com/statalist/archive/2002-10/msg00036.html
His canned solution can be usefully employed in this situation too (provided
that you have no interaction effects)

Moreover, to complete my answer to Matias, -reformat- works too.
Both -reformat- and -outreg- have strength and weaknesses. It is certainly
possible to write something that sums the strengths of both, but I think it
would be huge work.

And now, as promised here is my example of -outreg- that works after -ml
maximize-

use mydata, clear
constraint define 1 var1=1
keep if sex=="male": sex
program define mylikelihood
	version 8.0
	args lnf theta1 theta2
	* omitted
end
char _dta[omit] prevalent
xi: ml model lf mylikelihood (exbeta: income= var1 i.var2 var3 var4 var5
i.var6 i.var7 var8 and so on) (sigma:), constraints(1)
ml check 
ml search 
ml maximize, difficult
outreg using "c:\data\outreg_and_ml.txt", replace bracket se 3aster coefastr
addstat("Prob > chi2" , e(p)) 
ml graph
ml clear
program drop mylikelihood

use mydata, clear
constraint define 1 var1=1
keep if sex=="female": sex
program define mylikelihood
	version 8.0
	args lnf theta1 theta2
	* omitted
end
char _dta[omit] prevalent
xi: ml model lf mylikelihood (exbeta: income= var1 i.var2 var3 var4 var5
i.var6 i.var7 var8 and so on) (sigma:), constraints(1)
ml check 
ml search 
ml maximize, difficult
outreg using "c:\data\outreg_and_ml.txt", append bracket se 3aster coefastr
addstat("Prob > chi2" , e(p)) 
ml graph
ml clear
program drop mylikelihood

I hope it helps.
Sincerely,
Renzo Comolli


-----Original Message-----



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