I am not sure it will help, but here the ado file I used:
program define mlbeta, rclass
version 8
syntax varlist [if][in] [,DIspersion(varlist)] [,Robust]
[,svy] [,Nocons]
tokenize `varlist'
marksample touse
if "`svy'"!=""{
svymarkout `touse'
}
local lhs "`1'"
mac shift
local rhs "`*'"
ml model lf mlbeta_ll (`lhs'=`rhs', `nocons') (`dispersion')
`if' `in', `robust' `svy'
ml search
ml maximize
tempvar error
quietly {
predict `error' if e(sample)
replace `error' = exp(`error')/(1+exp(`error'))
replace `error' = (`lhs' - `error')^2
su `error', meanonly
}
display in green _n "Mean squared error:" in yellow `r(mean)'
end
*
* 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/