*! version 2.0.0  10May2016
program define mynlprobit2, eclass sortpreserve
    version 14.1

    syntax varlist [if] [in] [,  noCONStant ]
    marksample touse

    gettoken depvar indeps : varlist

    tempname b V N rank

    mata: MYNLWork("`depvar'", "`indeps'", "`touse'", "`constant'", ///
       "`b'", "`V'", "`N'", "`rank'", "probit" )

    if "`constant'" == "" {
        local indeps "`indeps' _cons"
    }
    matrix colnames `b' = `indeps'
    matrix colnames `V' = `indeps'
    matrix rownames `V' = `indeps'

    ereturn post `b' `V', esample(`touse')
    ereturn scalar N       = `N'
    ereturn scalar rank    = `rank'
    ereturn local  cmd     "mynlprobit"

    ereturn display

end