{smcl}
{* 5august2002}{...}
{hline}
help for {hi:qlognorm, plognorm}
{hline}

{title:Distributional diagnostic plots (lognormal distribution)} 

{p 8 16}{cmd:qlognorm}
{it:varname} 
[{cmd:if} {it:exp}] 
[{cmd:in} {it:range}] 
[{cmd:,}
{cmd:grid}
{it:graph_options}
{cmd:a(}{it:#}{cmd:)}  
{cmd:ml} 
]

{p 8 16}{cmd:plognorm}
{it:varname} 
[{cmd:if} {it:exp}] 
[{cmd:in} {it:range}] 
[{cmd:,}
{cmdab:g:rid}
{it:graph_options} 
{cmd:a(}{it:#}{cmd:)}  
{cmd:ml} 
]


{title:Description} 

{p}{cmd:qlognorm} plots the quantiles of {it:varname}
against the quantiles of the corresponding lognormal distribution (Q-Q plot).

{p}{cmd:plognorm} graphs a standardized lognormal probability (P-P) plot
for {it:varname}. 

{p}The (two-parameter) lognormal distribution fitted corresponds to a normal
distribution with the mean and standard deviation of log({it:varname}).


{title:Remarks} 

{p}Sometimes there is interest in whether the lognormal is appropriate as a
distribution model for a variable. Other times there is interest in whether the
logarithm of a variable is more nearly normal than that variable itself. These
are two sides of the same question.  {cmd:qlognorm} and {cmd:plognorm} are
commands for investigating it directly. 
 
{p}With official Stata, it is easy to {cmd:generate} a new variable which is
the logarithm of a variable and then to use {cmd:qnorm} and {cmd:pnorm} to see
whether that new variable is close to normal in distribution. Using
{cmd:qlognorm} and {cmd:plognorm} instead has these small but distinct
advantages: 
 
{p 4 4}1. If you do this frequently, you will need to type less; 
sometimes, but not always, you will decide that a log transformation
is advisable. 

{p 4 4}2. Fit can be assessed graphically on both raw and transformed 
scales. 

{p 4 4}3. If desired, you can use a plotting position other than 
the i / (N + 1) wired into {cmd:qnorm} and {cmd:pnorm}. 

{p 4 4}4. If desired, you can insist on maximum likelihood estimation. 


{title:Options} 

{p 0 4}{cmd:grid} adds grid lines at the .05, .10, .25, .50, .75, .90, and .95
quantiles when specified with {cmd:qlognorm}. It is equivalent to
{cmd:yline(.25 .5 .75) xline(.25 .5 .75)} when specified with {cmd:plognorm}.

{p 0 4}{it:graph_options} are any of the options allowed with 
{cmd:graph, twoway}; see help {help grtwoway}.

{p 0 4}{cmd:a(}{it:#}{cmd:)} specifies a family of plotting positions, defined by
{bind:(i - a)}{bind: / (N - 2a + 1)}, where i is the rank assigned to an
observed value and N is the number of observed values. The default is 0.5.
(Note that the default for {cmd:qnorm} and {cmd:pnorm} is 0. 
Choice of {cmd:a} is rarely material unless the sample size is very small, and
then the exercise is moot whatever is done. For more on plotting positions, see
{browse "http://www.stata.com/support/faqs/stat/pcrank.html":http://www.stata.com/support/faqs/stat/pcrank.html}.

{p 0 4}{cmd:ml} specifies maximum likelihood estimation. This option is for
purists only. The only difference it makes is to ensure that the standard
deviation of log({it:varname}) is calculated as the root mean square deviation
from the mean. Multiplying the default standard deviation, which is that 
produced by {cmd:summarize}, by a factor of {bind:sqrt(N / (N - 1))} is 
rarely material unless the sample size is very small, and then the exercise 
is moot whatever is done.


{title:Examples} 

{p 4 8}{inp:. qnorm mpg}

{p 4 8}{inp:. qlognorm mpg}{p_end} 
{p 4 8}{inp:. qlognorm mpg, xlog ylog}

{p 4 8}{inp:. plognorm mpg}


{title:Author}

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


{title:Also see}

{p} Manual:  {hi:[R] diagplots}, {hi:[R] summarize}{p_end}
{p}On-line:  help for {help diagplots}, {help graph} 

