*! version 6.2.8 01apr2005
program define ml_mlout
version 8
if "`e(cmd)'" == "" | "`e(opt)'"!="ml" {
error 301
}
if "`e(svyml)'" != "" {
if _caller() < 9 {
svy_dreg `0'
}
else {
_prefix_display `0'
}
exit
}
syntax [, ///
Level(cilevel) ///
PLus ///
noHeader ///
First ///
NEQ(integer -1) ///
noFOOTnote ///
TItle(string) /// not to be documented
* /// -eform/diparm- options
]
if "`plus'" != "" {
local footnote nofootnote
}
if `neq' >= 0 {
local neqopt neq(`neq')
}
// check syntax elements in `options'
_get_eformopts , eformopts(`options') soptions allowed(__all__)
local eform `s(eform)'
// `diparm' should only contain -diparm()- options
local diparm `s(options)'
_get_diparmopts , diparmopts(`diparm') level(`level')
if "`header'"=="" {
Header `"`title'"'
}
// display the table of results
_coef_table, `first' level(`level') `neqopt' `plus' `options'
if "`footnote'" == "" {
ml_footnote
}
end
program Header
args title
if `"`title'"' == "" {
local title `"`e(title)'"'
}
local crtype = upper(substr(`"`e(crittype)'"',1,1)) + /*
*/ substr(`"`e(crittype)'"',2,.)
di _n in gr `"`title'"' /*
*/ _col(51) in gr "Number of obs" _col(67) "= " /*
*/ in ye %10.0g e(N)
if !missing(e(N_reps)) {
di _col(51) in gr "Replications" _col(67) "= " /*
*/ in ye %10.0g e(N_reps)
}
local cfmt=cond(e(chi2) local stat chi2
if !missing(e(df_r)) {
local cfmt=cond(e(F) di _col(51) in gr "F(" /*
*/ in ye %4.0f `e(df_m)' in gr "," /*
*/ in ye %7.0f `e(df_r)' in gr ")" _col(67) "= " /*
*/ in ye `cfmt' e(F)
local stat F
}
else if "`e(chi2type)'"=="Wald" & e(chi2) >= . {
di in smcl _col(51) /*
*/ "{help j_robustsingular##|_new:Wald chi2(`e(df_m)'){col 67}= }" /*
*/ in ye `cfmt' e(chi2)
}
else {
di _col(51) in gr "`e(chi2type)' chi2(" /*
*/ in ye "`e(df_m)'" in gr ")" _col(67) "= " /*
*/ in ye `cfmt' e(chi2)
}
if missing(e(r2_p)) {
di in gr "`crtype' = " in ye %10.0g e(ll) /*
*/ _col(51) in gr "Prob > `stat'" _col(67) "= " /*
*/ in ye %10.4f e(p)
}
else {
di _col(51) in gr "Prob > `stat'" _col(67) "= " /*
*/ in ye %10.4f e(p)
di in gr "`crtype' = " in ye %10.0g e(ll) /*
*/ _col(51) in gr "Pseudo R2" _col(67) "= " /*
*/ in ye %10.4f e(r2_p)
}
di
end
exit