help xrimlPatrick Royston -------------------------------------------------------------------------------

Reference Interval Estimation by Maximum Likelihood

Syntax

xrimlyvar[xvar] [if] [in] [weight] [,dist(distribution_code)[major_optionsminor_options]

optionsDescription -------------------------------------------------------------------------majorcentile(numlist)defines the required centiles ofyvar|xvarfp(terms)specifies the fractional polynomial power(s) inxvarfor the M, S, G and D regression modelsminorcens(censvar)defines a censoring variablecovars(covar_list)includes variables as predictors in the regression models for the M, S, G and D curvescvparametrizes the S-curve to be a coefficient of variationinit(terms)specifies initial values for the G and D curvesltolerance(#)is a convergence criterion for the iterative fitting processnodetailsuppresses display of details of the iterative fitting algorithmnographsuppresses the plot of the age-specific reference intervalnooutofsamplerestricts prediction of M, S, G and D curves and Z-scores to the estimation sampleoffset(varname)addsvarnameto the M-curve of the modelplot(plot)provides a way to add other plots to the generated graph; see help plot optionscatter(scatter_options)are options of scatterseproduces standard errors of the M, S, G and D curves, and reference intervalsline_optionsoptions allowed with line -------------------------------------------------------------------------where

distribution_codeis one ofn|en|men|pn|mpn|sl.

Description

xrimlcalculates cross-sectional reference intervals foryvar, which is assumed to follow one of 6 possible distributions. The parameters are estimated by maximum likelihood.If

xvaris specified, reference intervals foryvarconditional onxvarare estimated. Typically,xvaris age. The parameters of the distribution are modelled as functions ofxvarusing fractional polynomials (see fracpoly).

xrimlwithout variables or options displays the results of the most recent estimation.

NOTE: the default prediction behaviour ofxrimlchanged at version 6.0.0. Thealloption has been replaced with anooutofsampleoption; please see the description of the latter underMinor optionsbelow.

Options+---------------+ ----+ Major options +----------------------------------------------------

distribution(distribution_code)is NOT optional. Valid distribution_codes are Normal (n), exponential-Normal (en), modulus-exponential-Normal (men), power-Normal (or Box-Cox) (pn), modulus power-Normal (mpn) and shifted (or three-parameter) lognormal (sl).

centile(numlist)defines the required centiles ofyvar|xvar. Defaultnumlistis3 97(i.e. a 94% reference interval).

fp([m:term] [, s:term] [, g:term] [, d:term])specifies the fractional polynomial power(s) inxvarfor the M, S, G and (for the four-parameter distributions only) D regression models.

termis of form [powers]#[#...]|fix#. The phrasepowersis optional. The powers should be separated by spaces, for examplefp(m:powers 0 1, s:powers 2), or equivalentlyfp(m:0 1, s:2). Ifpowersorfixare not specified for any curve, the curve is assumed to be a constant (_cons) estimated from the data.

fix#implies that the corresponding curve is NOT to be estimated from the data, but is to be fixed at#.fixis valid only withg:andd:.Default: constants for each curve (M, S, G; D if applicable).

+---------------+ ----+ Minor options +----------------------------------------------------

cens(censvar)definescensvaras the censoring variable for data in which some observations are left- (censvar= -1) or right- (censvar= 1) censored. Uncensored observations havecensvar= 0.

covars([m:mcovars] [, s:scovars] [, g:gcovars] [, d:dcovars])includesmcovars(scovars,gcovars,dcovars) variables as predictors in the regression model for the M (S, G, D if applicable) curves.

cvparametrizes the S-curve to be a coefficient of variation (CV, standard deviation divided by median), rather than a standard deviation.

init([g:#] [, d:#])specifies initial values for the G (g:) and (where applicable) D (d:) parameter curves. Defaults are shown below.Distribution Default # for G Default # for D ---------------------------------------------------

nN/A N/Aen0.01 N/Amen-0.2 1pn1 N/Ampn1 1sl0 N/A ---------------------------------------------------

ltolerance(#)is a convergence criterion for the iterative fitting process. For convergence, the difference between the final two values of the log likelihood must be less than#. Default#is 0.001.

nodetailsuppresses display of the steps of the iterative fitting algorithm and of the estimated regression coefficients and confidence intervals.

nographsuppresses the default plot ofyvaragainstxvarwith fitted median and reference limits.

nooutofsamplerestricts prediction of M, S, G and D curves, standard errors (when specified) and Z-scores to the estimation sample. The default is to predict in-sample and out-of-sample for all available observations ofxvarandyvar.

offset(varname)offsetsvarname, that is,varnameis added to the M-curve of the model.

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

saving(filename[, replace])saves the graph to a file (seenograph).

scatter(scatter_options)are options of scatter. These should be specified to control the rendering of the original data points.

seproduces standard errors of the M, S, G (and if applicable, D) curves. Standard errors of the estimated reference limits are also calculated. Warning: This option is computationally intensive when determining SEs of centiles, and may take considerable time on a slow computer and/or with a large dataset.

line_optionsare any of the options allowed with line. These should be specified to control the rendering of the smoothed lines or the overall graph.

RemarksAll the models fitted by

xrimlare defined by transformations of the original data towards a Normal distribution (the `identity transformation' in the case of the Normal model). The shape parameter(s) of the resulting distributions may either be estimated from the data or fixed by the user.Estimation is by maximum likelihood and is iterative. For the three-parameter models, the fit should converge within about 4-8 iterations. For the four-parameter models, about 5-15 iterations are needed in most cases.

The

pnandmpnmodels may be used only with data which are positive in value. The restriction does not apply to any of the other models.Each of the

en,pnandsldistributions has 3 parameters known as M (mu, the median), S (sigma, the scale factor) and G (gamma, generic name for the shape parameter). M is modelled as a fractional polynomial (FP) function of xvar. S and G may also be modelled as FP functions of xvar, or may be treated as constants to be estimated from the data.The

mpn(modulus power-Normal) andmen(modulus exponential-Normal) distributions are governed by four parameters, M, S, G and D. There are two shape parameters, G (gamma) and D (delta). Delta = 1 gives the `parent'pnanden(power-Normal and exponential-Normal) distributions respectively. If delta < 1 the distribution has longer tails than the corresponding `parent' distribution, and vice versa for delta > 1. The distributions with gamma = 1 for thempnand gamma = 0 for themenare symmetric.The

en(men) andpn(mpn) models are essentially identical in that if Y has apn(mpn) distribution, then log Y has anen(men) distribution. However, the parameter values from the two models will differ, since in the first case the M curve is the median of Y, whereas in the second it is the median of log Y. The S curves from theenandmenmodels for log Y have the character of a CV for Y.Note that fractional polynomial transformations of

xvarare adjusted such that the transformed value is 0 at the mean ofxvar.

Examples

. use foothemi.dta

. generate y = log(foot)

. xriml y gawks, fp(m:-2 -2, s:1) dist(en)

. xriml y gawks, fp(m:-2 -2, s:1, g:fix 0) dist(men) se

. xriml foot gawks, fp(m:powers 2 2, s:powers 2) dist(pn)

. xriml foot gawks, fp(m:2 2) dist(pn) saving(g1, replace)

. xriml foot gawks, fp(m:2 2) dist(pn) cv

. xriml foot gawks, fp(m:1, s:-1, g:0) dist(en) nooutofsample

AuthorPatrick Royston, MRC Clinical Trials Unit, London. patrick.royston@ctu.mrc.ac.uk

Eileen Wright, Macclesfield

Also seeManual:

[R] fracpolyOnline: fracpoly, xrigls (when installed)