help for xriglsPatrick Royston -------------------------------------------------------------------------------

Reference Interval Estimation by Generalized Least Squares

Syntax

xriglsyvar xvar[if] [in] [,major_optionsminor_options]

optionsDescription -------------------------------------------------------------------------major_optionsalpha(#)specifies significance level for testing between FP functionscentile(#[#...])defines the centiles of yvar|xvarcvmodels the S-curve as a coefficient of variationdetaildisplays the final regression modelsfp([m:term] [s:term])specifies fractional polynomial modelsminor_optionscovars([m:vars] [s:vars])includes variables as predictors of the mean and/or SD curvecycles(#)determines the number of fitting cyclesnographsuppresses the graph of the resultsnoleaveprevents the creation of new variablesnotidypreserves fractional polynomial transformationspowers(powlist)defines powers for fractional polynomialsropts([m:mopts] [s:sopts])determines regression optionssaving(filename[, replace])saves the graph to a filesecalculates standard errors of estimated centile curves -------------------------------------------------------------------------where

termis of the form [powers]#[#...]|df#.

Description

xriglscalculates reference intervals foryvarbased on thexvar- (e.g. age-) specific mean and standard deviation ofyvar.yvaris assumed to be Normally distributed, conditional onxvar.

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

alpha(#)specifies the significance level for testing between degrees of FP for the mean and SD curves. Default : 0.05.

centile(#[#...])defines the required centiles ofyvar|xvar. Default is 3 and 97 (i.e. a 94% reference interval).

cvmodels the S-curve as a coefficient of variation.

detaildisplays the final regression models for the mean and SD curves.

fp([m:term[, s:term]{cmd:) specifies fractional polynomial models inxvarfor the mean and SD curves.termis of form [powers]#[#...]|df#. The phrasepowersis optional. The powers should be separated by spaces, for examplefp(m:powers 0 1, s:powers 2). Ifpowersordfare not given for any curve, the default is cmd:fp(m:df 4,s:df 2)}.df#specifies that the degrees of freedom for the best-fitting FP model are to be at most#for the curve in question. The powers are then determined from the data.

+-------+ ----+ Minor +------------------------------------------------------------

covars([m:vars[, s:vars]{cmd:) includes variables as predictors in the regression model for the mean and/or SD (S) curves.

cycles(#)determines the number of fitting cycles (fit mean, calculate absolute residuals, fit absolute residuals, recalculate weights, etc.). The default value of#is 2: an initial (unweighted) fit for the mean is followed by an unweighted fit of the absolute residuals; weights are calculated, and one weighted fit for the mean, one weighted fit for the absolute residuals and a final weighted fit for the mean are carried out.

nographsuppresses a plot ofyvaragainstxvarwith fitted values and reference limits superimposed. The default is to have the graph.

noleaveprevents the creation of new variables. The default (leave) causes new variables, appropriately labelled, containing the estimated mean, SD, Z- scores foryvarand also the centiles specified incentile(), to be created.

noselectspecifies that the degree of FP will be that specified in thefp()option. The default is to select a lower order FP if the likelihood ratio test has P-valuealpha().

notidypreserves the variables created in the routine representing the fractional polynomials powers of thexvarused in the analysis.

powers(powlist)specifies powers for FP models. Defaultpowlistis -2, -1,-0.5, 0, 0.5, 1, 2, 3 (0 meaning log).

ropts([m:mopts] [,] [s:sopts])determines the regression options for the mean and SD regression models. Example:ropt(m:nocons)suppresses the constant for the mean curve.

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

secalculates the standard errors of the estimated centile curves.

Remarks

yvaris assumed to have a normal (Gaussian) distribution. If a constant SD is assumed, it is estimated by the residual mean square in the usual way. Otherwise, the SD is estimated by regression of the absolute residuals on an FP inxvar. The SD's are the predicted values from this regression, multiplied by the square root of pi/2 (i.e. 1.2533...). Since the correct regression foryvarshould include weights proportional to the reciprocal of the squared SD, the regression foryvaris repeated using weights equal to the squared reciprocal of the fitted SDs. At each iteration, models of lower degree are also fitted. The FP with the lowest degree (k), for which the FP with degree k+1 is not a significantly better fit, is selected. The selection criteria between models may be specified.

xriglsdisplays the deviance (-2 * ln likelihood) for the entire model (including weights derived from the fitted SD). In general, the lower the deviance, the better the fit of the model.

Examples

. sysuse auto

. xrigls mpg weight, fp(m:1 3,s:2 2) centile(10 90) cycles(3)The FP model with powers (1,3) is used for the mean, and the FP model with powers (2,2) for the SD. Three cycles are performed. The results are saved in new variables. A graph of the resulting 10th, 50th and 90th centiles (or 80% reference interval) is given.

. xrigls mpg weight, fp(m:df 2,s:df 2) noselect powers(1 2 3) cvThe model for the mean of

mpgis the best FP1 function ofweight, and for the CV, the best degree-1 FP function ofweight. The chosen powers will be a subset of {1,2,3}. A graph of the resulting 94% reference interval and new variables are also given.

. xrigls mpg weight, alpha(0.1) fp(m:df 2,s:df 2)For both the mean and SD, a selection will be made between the best degree-1 FP function, linear and constant fits using a significance level of 10% in the the likelihood-ratio tests.

Stored Results

xriglsis an R-class program and saves in ther()functions:

r(dev)deviance of final model`r(mpow)'powers in final FP model for mean curve`r(spow)'powers in final FP model for SD curve

AuthorsPatrick Royston, MRC Clinical Trials Unit, London. pr@ctu.mrc.ac.uk

Eileen Wright, Macclesfield

Also see