Centile estimation (STB-8: sg7) ------------------ ^centile^ [varlist] [^if^ exp] [^in^ range] [^, c^entile^(# [# ...]^)^ ^cc^i ^n^ormal ^m^eansd ^l^evel^(^#^)^ Description ----------- ^centile^ calculates the centiles of varlist specified by the list in ^centile()^. If varlist is not specified, all variables are used. If ^centile()^ is not specified, medians (^centile(50)^) are reported. By default, centile uses a binomial method for obtaining confidence intervals that makes no assumptions as to the underlying distribution of the variable. If the data contains many ties, however, the the intervals may not be valid. Options ------- ^centile(^# [#...]^)^ specifies the centiles to be reported and defualts to centile(50) if not specified. Specifying ^centile(5)^ would report the 5th (per)centile. Specifying ^centile(5 50 95)^ would report the 5th, 50th, and 95th centiles. ^cci^ prevents centile from interpolating when calculating the distribution-free (binomial-based) confidence limits. ^cci^ stands for conservative confi- dence interval. The resulting intervals are generaly wider than the default (interpolated) intervals. ^normal^ specifies that confidence intervals are to be obtained assuming that both the data and the centiles are normally distributed. Also see the ^meansd^ alternative, below. ^meansd^ specifies that the data are again to be assumed to be normally distri- buted. Centiles are calculated as the sample mean plus k standard devia- tions, where k is determined from the centiles of the standard normal distribution (e.g., k=1.645 for the 95th centile). Confidence intervals are calculated assuming that the estimated centiles themslves are normally distributed. For example, with ^meansd^, the 50th centile (median) is taken as the sample mean and a 95% confidence interval is the mean plus or minus 1.96 times the estimated standard error of the mean. ^level(^#^)^ specifies the significance level, in percent, for the confidence interval and defaults to 95 or the value set by ^set level^; see ^help level^. Examples -------- . ^centile x, centile(5 50 95)^ calculates the 5th, 50th (median) and 95th centiles for x, not assuming normality. . ^centile x y, centile(2.5 97.5) meansd^ calculates 2.5th and 97.5th centiles for x and y from their means and standard deviations, assuming normality. . ^centile x, centile(10) normal^ calculates the 10th centile for x, assuming normality. In each case 95% confidence intervals for the specified centiles are provided. Warning ------- The formulas used for obtaining centiles are slightly different than those used by ^summarize, detail^. See sg7 (STB-8) for technical details. Saved Results ------------- ^centile^ saves in the ^$S_^# macros: ^S_1^ number of observations ^S_2^ number of centiles requested ^S_3^ last centile requested ^S_4^ last estimated centile ^S_5^ last estimated lower confidence limit ^S_6^ last estimated upper confidence limit ^S_7^ first requested centile of final variable in varlist ^S_8^.. 2nd,... requested centile of final variable in varlist, if any Author ------ Patrick Royston, Royal Postgraduate Medical School, London. Also see ------- STB: sg7 (STB-8) On-line: ^help^ for ^ci^, ^lv^, ^summarize^