{smcl}
{* 15nov2007}{...}
{hline}
help for {hi:weibullfit}
{hline}

{title:Fitting a two-parameter Weibull distribution by maximum likelihood}

{p 8 17 2}{cmd:weibullfit} {it:varname} [{it:weight}] [{cmd:if} {it:exp}]
[{cmd:in} {it:range}] [{cmd:,} {cmdab:b:var(}{it:varlist1}{cmd:)}
{cmdab:c:var(}{it:varlist2}{cmd:)} {cmdab:r:obust}
{cmdab:cl:uster(}{it:clustervar}{cmd:)}  {cmdab:l:evel(}{it:#}{cmd:)}
{it:maximize_options} ]

{p 4 4 2}{cmd:by} {it:...} {cmd::} may be used with {cmd:weibullfit}; see help
{help by}. 

{p 4 4 2}{cmd:fweight}s and {cmd:aweight}s are allowed; see help {help weights}.


{title:Description}

{p 4 4 2} {cmd:weibullfit} fits by maximum likelihood a two-parameter Weibull 
distribution to a distribution of a variable {it:varname}. The distribution has
probability density function for variable {it:x} >= 0,
scale parameter {it:b} > 0 and 
shape parameter {it:c} > 0
of ({it:c}/{it:b}) ({it:x}/{it:b})^({it:c} - 1) exp(-({it:x}/{it:b})^{it:c}).


{title:Options}

{p 4 8 2}{cmd:bvar(}{it:varlist1}{cmd:)} and
{cmd:cvar(}{it:varlist2}{cmd:)} allow the user to specify each parameter as
a function of the covariates specified in the respective variable list. A
constant term is always included in each equation. 

{p 4 8 2}{cmd:robust} specifies that the Huber/White/sandwich estimator of
variance is to be used in place of the traditional calculation.  {cmd:robust} combined with
{cmd:cluster()} allows observations which are not independent within cluster
(although they must be independent between clusters). 

{p 4 8 2}{cmd:cluster(}{it:clustervar}{cmd:)} specifies that the observations
are independent across groups (clusters) but not necessarily within groups.
{it:clustervar} specifies to which group each observation belongs; e.g.,
{cmd:cluster(personid)} in data with repeated observations on individuals.  
Specifying {cmd:cluster()} implies {cmd:robust}.

{p 4 8 2}{cmd:level(}{it:#}{cmd:)} specifies the confidence level, in percent,
for the confidence intervals of the coefficients; see help {help level}.

{p 4 8 2}{cmd:nolog} suppresses the iteration log.

{p 4 8 2}{it:maximize_options} control the maximization process; see 
help {help maximize}. If you are seeing many "(not concave)" messages in the 
log, using the {cmd:difficult} option may help convergence.


{title:Saved results}

{p 4 4 2}In addition to the usual results saved after {cmd:ml}, {cmd:weibullfit}
also saves the following, if no covariates have been specified: 

{p 4 4 2}{cmd:e(b)} and {cmd:e(c)} are the estimated Weibull parameters.

{p 4 4 2}The following results are saved regardless of whether covariates have
been specified:

{p 4 4 2}{cmd:e(b_b)} and {cmd:e(b_c)} are row vectors containing the
parameter estimates from each equation. 

{p 4 4 2}{cmd:e(length_b_b)} and {cmd:e(length_b_c)} contain the lengths
of these vectors. If no covariates are specified in an equation, the
corresponding vector has length equal to 1 (the constant term); otherwise, the
length is one plus the number of covariates.

	
{title:Examples}

{p 4 8 2}{cmd:. weibullfit mpg}


{title:Authors}

{p 4 4 2}Nicholas J. Cox, Durham University{break}n.j.cox@durham.ac.uk

{p 4 4 2}Stephen P. Jenkins, University of Essex{break}stephenj@essex.ac.uk


{title:References}

{p 4 4 2}
Evans, M., Hastings, N. and Peacock, B. 2000. {it:Statistical distributions.}
New York: John Wiley.

{p 4 4 2} 
Johnson, N.L., Kotz, S. and Balakrishnan, N. 1994. 
{it:Continuous univariate distributions: Volume 1.} New York: John Wiley.

{p 4 4 2}
Kleiber, C. and Kotz, S. 2003. 
{it:Statistical size distributions in economics and actuarial sciences.} 
Hoboken, NJ: John Wiley. 


{title:Also see}

{p 4 13 2}
Online: help for {help pweibull} (if installed), {help qweibull} (if installed) 

