Density trace (boxcar weight function) [STB-16: snp6] -------------------------------------- ^boxdetra^ varname width dtrace Description ----------- ^boxdetra^ calculates the density trace of "varname" using the boxcar weight function described in Chambers et. al. (1983). "width" is a constant that specifies the width of the density window around each point. "dtrace" is a new variable that contains the density trace on output. The data set is assumed to be sorted in the order of "varname". This procedure can be regarded as a descriptive smoother of histograms. Indeed this simple density estimator is like a histogram using bins of the specified width but no fixed origin; the bin's windows run along the series with each observation at its midpoint allowing overlap. The "smoothness" of the result can be regulated by changing the width of the interval. Wide intervals produce smooth results; narrow intervals result in noiser density values. WARNING: This procedure performs conditional summaries for every observation in the data set. Thus, the time it requires is proportional to the quantity of data. Please be patient. Example ------- . ^boxdetra ozone 75 dtrace^ After some time (depending on the number of observations) the results are placed in the new variable ^dtrace^. . ^list ozone dtrace^ lists the values of the data variable and the density trace estimation results. . ^graph dtrace ozone^, xlab ylab s(.) c(J) displays a graph of the density trace. References ---------- Chambers, J.M., W.S. Cleveland, B. Kleiner and P.A. Tukey (1983) Graphical Methods for Data Analysis. Wadsworth & Brooks/Cole Chap. 2: 9-46. Fox, J. (1990) Describing univariate distributions. In (Fox, J. & J.S. Long, Eds.) "Modern Methods of Data Analysis". Sage Chap. 2: 58-125. Authors ------- Isaias H. Salgado-Ugarte, Makoto Shimizu and Toru Taniuchi, University of Tokyo, Faculty of Agriculture, Dept. of Fisheries (Fax 81-3-3812-0529) Also see -------- STB: snp6 (STB-16) On-line: ^help^ for ^boxdetr2^, ^cosdetra^, ^kernsim^, ^kernepa^, ^kerngaus^, ^adgakern^, ^adgaker2^