.- help for ^bsmplot^ .- Binomial smoothing plot [STB35: gr22] ----------------------- ^bsmplot^ yvar xvar [^if^ exp] [^in^ range] [, ^w^indow^(^#^)^ graph_options ] Description ----------- ^bsmplot^ produces a scatter plot of yvar and yvar smoothed by a binomial filter against xvar. Normally, but not necessarily, xvar will contain equally-spaced times and yvar some fluctuating response. Binomial filters have weights given by the coefficients in the n expansion of (a + b) . Thus 2 2 2 (a + b) expands to 1a + 2ab + 1b , 4 4 3 2 2 3 4 (a + b) expands to 1a + 4a b + 6a b + 4ab + 1b , and more compactly (listing here only examples with odd numbers of weights, which are the practical choices in smoothing) 1 2 1 length 3 1 4 6 4 1 length 5 1 6 15 20 15 6 1 length 7 1 8 28 56 70 56 28 8 1 length 9 and so forth. Each weight is divided by the sum of the weights to produce scaled weights that have sum 1. Thus smoothing with weights in the ratio 1:2:1 means compute smooth at i by 1/4 value at i-1 + 1/2 value at i + 1/4 value at i+1, each weight being divided by the sum 4. Options ------- ^window(^#^)^ specifies the length of the binomial filter. The default is 3, giving the filter with weights in the ratio 1:2:1, often known as Hanning. The length must be an odd number and at least 3. graph_options are options allowed with ^graph, twoway^. The default values include ^xla yla c(||s) sy(iii) gap(6)^ ^t1title^ shows the window length ^c(..s)^ would show just the smooth values, suppressing the data. Examples -------- . ^bsmplot temp year^ . ^bsmplot temp year, w(9)^ . ^bsmplot temp year, w(9) c(..s)^ Author ------ Nicholas J. Cox, University of Durham, U.K. n.j.cox@@durham.ac.uk Also see -------- STB: gr22 (STB-35) On-line: help for @smooth@, @graph@, @ksm@