------------------------------------------------------------------------------- help forqinvgauss-------------------------------------------------------------------------------

Quantile-quantile plot for data versus fitted inverse Gaussian distribution

qinvgaussvarname[ifexp] [inrange] [weight] [,gridparam(# #)show(condition)generate(newvar)graph_options]where

graph_optionsare

rlopts(cline_options)addplot(plot)scatter_optionstwoway_options

fweights andaweights are allowed; see help weights.

Description

qinvgaussplots the quantiles ofvarnameagainst 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 (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 invgausscf, which should be installed separately.

RemarksIn the majority of cases,

qinvgausswill 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 theparam()option. In all cases it is important not only to specify anyiforinrestrictions, but also to specify relevant weights, which will (unless constant) affect the configuration of the plot.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 http://www.statsci.org/s/invgauss.s (accessed 8 December 2006).

Options

gridadds grid lines at the .05, .10, .25, .50, .75, .90, and .95 quantiles.

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.

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 thatifandinshould not be used for this purpose.

generate()specifies the name of a new variable to hold values of fitted inverse Gaussian quantiles.

graph_optionsarerlopts(cline_options),addplot(plot)scatter_options, andtwoway_options.

rlopts(cline_options)affect the rendition of the reference line; see help cline_options.

addplot(addplot)provides a way to add other plots to the generated graph; see help addplot_option.

scatter_optionsaffect the rendition of the plotted points; see help scatter.

twoway_optionsare any of the options documented in help twoway_options excludingby(). These include options for titling the graph (see help title_options) and options for saving the graph to disk (see help saving_option).

Examples

. qinvgauss spacing

. qinvgauss spacing, param(20 3)

. qinvgauss spacing, gen(spacing_g)

AuthorNicholas J. Cox, Durham University, U.K. n.j.cox@durham.ac.uk

ReferencesEvans, M., Hastings, N. and Peacock, B. 2000.

Statistical distributions.New York: John Wiley.Johnson, N.L., Kotz, S. and Balakrishnan, N. 1994.

Continuous univariatedistributions: Volume 1.New York: John Wiley.

Also seeOnline: help for invgausscf, invgaussfit (if installed) pinvgauss (if installed), graph, diagplots