{smcl} {* 14dec2006}{...} {hline} help for {hi:qinvgauss} {hline} {title:Quantile-quantile plot for data versus fitted inverse Gaussian distribution} {p 8 17 2} {cmd:qinvgauss} {it:varname} [{cmd:if} {it:exp}] [{cmd:in} {it:range}] [{it:weight}] [{cmd:,} {cmdab:g:rid} {cmd:param(}{it:# #}{cmd:)} {cmd:show(}{it:condition}{cmd:)} {cmdab:gen:erate(}{it:newvar}{cmd:)} {it:graph_options} ] {p 4 4 2} where {it:graph_options} are {p 8 8 2} {cmd:rlopts(}{it:cline_options}{cmd:)} {cmd:addplot(}{it:plot}{cmd:)} {it:scatter_options} {it:twoway_options} {p 4 4 2}{cmd:fweight}s and {cmd:aweight}s are allowed; see help {help weights}. {title:Description} {p 4 4 2} {cmd:qinvgauss} plots the quantiles of {it:varname} against the quantiles of a two-parameter inverse Gaussian distribution with probability density function variable x > 0, location parameter m > 0 and scale parameter l > 0 of {bind:(l / 2 pi x^3)^(1/2) exp((-l (x - m)^2 / 2 m^2 x))}. By default, maximum likelihood estimation is carried out, using {help invgausscf}, which should be installed separately. {title:Remarks} {p 4 4 2}In the majority of cases, {cmd:qinvgauss} will be used to fit an inverse Gaussian distribution on the fly and to assess that fit. In some cases, it may be of interest to compare data with an inverse Gaussian distribution with known or hypothesised parameters, which may be specified using the {cmd:param()} option. In all cases it is important not only to specify any {cmd:if} or {cmd:in} restrictions, but also to specify relevant weights, which will (unless constant) affect the configuration of the plot. {p 4 4 2}Stata programmers will find embedded in the code various Mata functions for the inverse Gaussian that may be useful in other circumstances. The calculation of the quantile function is based in part on S code by Paul Bagshaw, found at {browse "http://www.statsci.org/s/invgauss.s":http://www.statsci.org/s/invgauss.s} (accessed 8 December 2006). {title:Options} {p 4 8 2}{cmd:grid} adds grid lines at the .05, .10, .25, .50, .75, .90, and .95 quantiles. {p 4 8 2}{cmd:param()} may be used to supply parameter values (namely, location and scale parameters) directly for use in estimation of fitted quantiles. m and l should be provided as separate values in precisely that order. {p 4 8 2}{cmd:show()} may be used to specify that you wish to restrict the graph according to some condition, say looking at one tail of the distribution only. Note that {cmd:if} and {cmd:in} should not be used for this purpose. {p 4 8 2}{cmd:generate()} specifies the name of a new variable to hold values of fitted inverse Gaussian quantiles. {p 4 8 2}{it:graph_options} are {cmd:rlopts(}{it:cline_options}{cmd:)}, {cmd:addplot(}{it:plot}{cmd:)} {it:scatter_options}, and {it:twoway_options}. {p 4 8 2} {cmd:rlopts(}{it:cline_options}{cmd:)} affect the rendition of the reference line; see help {help cline_options}. {p 4 8 2} {cmd:addplot(}{it:addplot}{cmd:)} provides a way to add other plots to the generated graph; see help {help addplot_option}. {p 4 8 2} {it:scatter_options} affect the rendition of the plotted points; see help {help scatter}. {p 4 8 2} {it:twoway_options} are any of the options documented in help {help twoway_options} excluding {cmd:by()}. These include options for titling the graph (see help {help title_options}) and options for saving the graph to disk (see help {help saving_option}). {title:Examples} {p 4 8 2}{cmd:. qinvgauss spacing} {p 4 8 2}{cmd:. qinvgauss spacing, param(20 3)} {p 4 8 2}{cmd:. qinvgauss spacing, gen(spacing_g)} {title:Author} {p 4 4 2}Nicholas J. Cox, Durham University, U.K.{break} n.j.cox@durham.ac.uk {title:References} {p 4 8 2} Evans, M., Hastings, N. and Peacock, B. 2000. {it:Statistical distributions.} New York: John Wiley. {p 4 8 2} Johnson, N.L., Kotz, S. and Balakrishnan, N. 1994. {it:Continuous univariate distributions: Volume 1.} New York: John Wiley. {title:Also see} {p 4 13 2} Online: help for {help invgausscf}, {help invgaussfit} (if installed) {help pinvgauss} (if installed), {help graph}, {help diagplots}