help jnsnandhelp jnsniVersion 1.2 2007-01-17 -------------------------------------------------------------------------------

Title

jnsn-- Fit Johnson's system of transformations by moment matchingjnsni

Syntax

jnsnvarname[if] [in] [weight] [,jnsn-specific option] [commonoptions]

jnsni,jnsni-specific options[common options]

optionsDescription -------------------------------------------------------------------------jnsn-specific Optiongenerate(newvar)create variable namednewvarthat is the fitted normal transformation ofvarname

jnsni-specific Optionsmean(#)mean of the variable to be transformed; this is requiredsd(#)standard deviation of the variable to be transformed; this is requiredskewness(#)coefficient of skewness of the variable to be transformedkurtosis(#)coefficient of kurtosis of the variable to be transformedCommon Options

tolerance(#)tolerance differentiating distributionssbiterate(#)iteration criterion for fitting bounded distributionsmoiterate(#)outer-loop iteration limit for estimating moments (used in fitting bounded distributions)motolerance(#)outer-loop convergence criterion for estimating moments (used in fitting bounded distributions)miiterate(#)inner-loop iteration limit for estimating moments (used in fitting bounded distributions)mitolerance(#)inner-loop convergence criterion for estimating moments (used in fitting bounded distributions) -------------------------------------------------------------------------bymay be used withjnsn; seeby.aweights andfweights are allowed withjnsn; see weight.

Description

jnsnfits the Johnson system of distributions (Johnson, 1949) for transformingvarnameto a standard normal deviate.jnsniis the immediate form of the command, and allows the user to specify mean, standard deviation, and coefficients of skewness and kurtosis of a hypothetical variable or of one in a dataset that is not at-hand.jnsnandjnsniimplement what is known asAlgorithm AS 99(Hill, Hill and Holder, 1976), which fits parameters of Johnson system functions by moment matching.

Options+------+ ----+ Main +-------------------------------------------------------------

generatecreatesnewvarcontaining values of the normal deviate as defined by the fitted transformation coefficients.

meanandsdmean and standard deviation are used in all cases.

skewnessandkurtosiscoefficients of skewness and kurtosis are those that would be returned by summarize. If these are not supplied, then they default to zero and three.

tolerancetolerance criterion used in discriminating distributions; defaults to 0.01.

sbiteratemaximum number of iterations in fitting bounded distributions; defaults to 50.

moiteratemaximum number of outer-loop iterations in higher moment estimation used for fitting bounded distributions; defaults to 50.

motolerancecriterion for convergence of the outer-loop interations in higher moment estimation used for fitting bounded distributions; defaults to 0.00001.

miiteratemaximum number of inner-loop iterations in higher moment estimation used for fitting bounded distributions; defaults to 50.

mitolerancecriterion for convergence of the inner-loop interations in higher moment estimation used for fitting bounded distributions; defaults to 0.00000001.

RemarksJohnson's system comprises several functions intended to transform a variable into a standard normal deviate. The choice of which of the functions to use in the transformation of a given variable is made on the basis of the distribution characteristics of the variable to be transformed. Each of the functions has up to four parameters, which are usually named

gamma,delta,xiandlambda. Four of the functions are given below. In each case,zis distributedN(0,1),andyis defined as

y= (x-xi) /lambdawhere

xis the variable to be transformed.SN (Normal distribution)

z=ySL (log-normal distribution)

z=gamma+delta*ln(y)SU (Unbounded distribution)

z=gamma+delta*asinh(y)SB (Bounded distribution)

z=gamma+delta*ln(y/ (1 -y))The Johnson SN transformation is the trivial case where the variable to be transformed is already normally distributed. Here,

xiandlambdaare the only two paramters involved, and represent the mean and standard deviation. The Johnson SL case is tranformation of a variable that is bounded on one side. For this distribution,xiis the bound, andlambdais either one (positive skew) or negative one (negative skew). The Johnson SU case is transformation of an unbounded distribution. A simplified version of this transformation is known as the Inverse Hyperbolic Sine (IHS) transformation. The Johnson SB case is for variables whose distribution is bounded on both ends. Here,xilies just beneath the minimum ofx's distribution, andlambdais such thatlambda-xilies just above the maximum ofx's distribution. Parameters for this case are the most difficult to fit. In all cases in which it is involved, the parameter space fordeltais strictly positive.Selection of the transformation function is made on the basis of the location of the variable's coefficients of skewness and kurtosis on the plane defined by their joint parameter space. Two lines are defined in this plane for the purpose of selecting a transformation function. One is the "log-normal" line emanating from (0,3). (See the references for the parametric equations that define the log-normal line.) The other is the boundary line, defined as coefficient of kurtosis = squared coefficient of skewness + 1. A skewness-kurtosis pair lying within

toleranceof (0,3) will be fit as SN. A pair withintoleranceof the log-normal line will be fit as SL. A pair lying above the log-normal line will be fit as SU. A skew-kurtosis pair withintoleranceof the boundary is fit as ST, which is not listed above. A pair lying between the two lines is fit as SB. ST is not a Johnson transformation, but rather a special case created by Hill, Hill and Holder (T stands for "two-ordinate").Once the transformation function has been chosen, the function's parameters are fitted. Fitting for SN, SL and ST are noniterative and unproblematic. Fitting for SU is iterative, but convergence is usually unproblematic. Fitting of the SB case is more difficult. Suboptimum fit and failure to fit are not unusual. Although

jnsndoes not screen for adequacy of fit, it does detect failures to fit and then resorts to an alternative transformation (often SU or SL) chosen on the basis of the best match of sample skewness and kurtosis to those for a variable subject to the fall-back transformation.Johnson transformations involve only the first four moments of the distribution of the variable to be transformed. Its transformation of a variable to the standard normal deviate is thus approximate. If interest lies in the extremes or tails of the distribution, the approximation might not be adequate.

Notes

jnsnandjnsnireturn the transformation function selected in the return macro r(johnson_type). They return the fitted parameter estimates in return scalars r(gamma), r(delta), r(xi) and r(lambda), and convergence exceptions in the return macro r(fault). Coefficients for parameters that are not used in a transformation, such asgammaanddeltain type SN, are set to default values, typically, zero forgammaand one fordelta. For ST cases,xiandlambdaare set to the ordinates on the skewness-kurtosis plane,deltais set to the proportion of values atlambda, andgammais set to zero.Default values for tolerances and iteration maximums are those in the FORTRAN-66 source code accompanying the article by Hill, Hill and Holder (1976).

jsncalls summarize to obtain mean, standard deviation, and skewness and kurtosis coefficients. It then feeds them tojnsni.

ReferencesI. D. Hill, R. Hill and R. L. Holder, Fitting Johnson curves by moments.

Applied Statistics25:180–89, 1976.N. L. Johnson, Systems of frequency curves generated by methods of translation.

Biometrika36:149–76, 1949.

Examples

. jnsn mpg

. jnsni , mean(0.5) sd(0)

AuthorJoseph Coveney jcoveney@bigplanet.com

Also seeManual:

[R] summarize,[R] boxcox,[R] lnskew0,[R] ladder