.- help for ^autosmoo^ (STB-41: gr27) .- Adaptive variable span running line smoother -------------------------------------------- ^autosmoo^ yvar [xvar] [^if^ exp] [^in^ range] [weight] [^,^ ^kmin(^#^)^ ^kmax(^#^)^ ^gen(^newvar^)^ ^genk(^newvar^)^ ^log^it ^nog^raph ^r^epeat^(^#^)^ graph_options] ^autosmoo^ smooths yvar on xvar. It is designed to be completely automatic, but some options are permitted. The smooth is a running line fit with a variable span. The span is chosen at each point by cross validation on the mean squared error of prediction. The span at each point is smoothed to produce the variable span used to smooth the data. A graph of yvar together with its smooth is plotted against xvar, unless suppressed. If xvar is not provided, yvar is smoothed against the ordered observations. Only analytic weights (^aweight^) are allowed; see help @weights@. Options ------- ^kmin(^#^)^ is the minimum number of symmetric nearest neighbors on each side of an observation that are used in smoothing. ^kmax(^#^)^ is the maximum number of symmetric nearest neighbors on each side of an observation that are used in smoothing. ^gen(^newvar^)^ creates newvar containing the smoothed values of yvar. Note that newvar will be on a logit scale if ^logit^ is used. ^genk(^newvar^)^ creates newvar containing the number of nearest neighbors on either side of each observation used in the final smooth. ^nograph^ suppresses the graph. ^logit^ transforms the smooth and plots the y-axis on a logit scale. Zero-one observations are automatically jittered in the vertical scale and are plotted just above and outside the range of the smoothed curve. ^repeat(^#^)^ specifies the number of times the data are to be smoothed using the selected span (number of symmetric nearest neighbors). The default is 1. graph_options are any of the options allowed with ^graph, twoway^; see ^help^ ^graph^. Graph plots yvar followed by its smooth against xvar, the default options are s(oi) (s(.i) with over 299 observations) and c(.l). Remarks ------- Like ^running^, ^autosmoo^ is an order N smoother --- it should take about 3 times as long as ^running^ to run on the same data. Unlike ^running^, ^autosmoo^ adaptively selects the number of nearest neighbors used to smooth the data. Additionally, the number of nearest neighbors used may vary from one observation to another. ^autosmoo^ will use larger neighborhoods with noisy data. It will use smaller neighborhoods, where the fitted smooth has greater curvature. The number of symmetric nearest neighbors on each side of each observation selected by ^autosmoo^ can be saved using the ^genk^ option. This variable can then be inserted into ^running^ (using the ^knn^ option). Author ------ Peter Sasieni Imperial Cancer Research Fund, London FAX 44-171-269-3429 Also see -------- STB: STB-41 gr27, STB-23 sed9 Manual: [R] ksm, [R] smooth On-line: help for @ksm@ and @smooth@