*! version 1.0.0 NJC 23 January 1998
program define wbull
    version 5.0
    local varlist "req ex max(1)"
    local if "opt"
    local in "opt"
    local weight "fweight"
    local options "Log"
    parse "`*'"
    if "`weight'" != "" { local exp "[w `exp']" }
    if "`log'" != "log" { local qui "qui" }
    `qui' weibull `varlist' `if' `in' `exp'
    qui count `if' `in'
    local n = _result(1)
    tempname b c
    scalar `b' = exp(_b[_cons])
    scalar `c' = exp([ln_p][_cons])
    di _n in g "Fitting Weibull distribution to `varlist'"
    di _n in g "b          " in y %12.5f `b'
    di    in g "c          " in y %12.5f `c'
    global S_1 = `n'
    global S_2 = `b'
    global S_3 = `c'
end