Adjusted "ksm" for robust scatterplot smoothing ----------------------------------------------- ^adjksm^ yvar xvar [if exp] [in range] [, [[line] [weight] | lowess] [bwidth(#)] [logit] [adjust] [gen(newvar)] [nograph] | graph_options] ] Description ----------- ^adjksm^ calculates locally weighted regression scatterplot smoothing with an uniform band width along the x interval by a modification of the original "ksm" Stata ado-file. The robust iterative procedure is implemented in two additional modified ado-files: ^lorobwei^ and ^roblowes^ which syntax is. ^lorobwei^ yvar yhatvar ^roblowes^ yvar xvar bwidth Example ------- . ^adjksm alr tsr, lowess nograph bwidth(.5) gen(lowere50)^ . ^graph alr lowere50 tsr, xlab ylab c(.l) s(op) to get robust results the following iterative procedure is necessary: . ^lorobwei^ alr lowere50 generation of robust weights in the variable "robwei" . ^roblowes^ alr tsr .5 (first robust results in the variable "lowerob") To repeat the robust procedure: . ^gen^ lwrob501=lowerob . ^gen^ robwe501=robwei . ^drop^ robwei lowerob . ^lorobwei^ alr lwrob501 . ^roblowes^ alr tsr .5 It is necessary to rename the variables "lowerob" and "robwei" before any additional iteration. . ^gen^ lwrob502=lowerob . ^gen^ robwe502=robwei . ^drop^ robwei lowerob . ^lorobwei^ alr lwrob502 . ^roblowes^ alr tsr .5 References ---------- Chambers, J.M., W.S. Cleveland, B. Kleiner and P.A. Tukey (1983) Graphical Methods for Data Analysis. Wadsworth & Brooks/Cole Chap. 4: 75-127. Cleveland, W.S. 1979. Robust locally weighted regression and smoothing Scatterplots. Journal of the American Statistical Association 74(368): 829-836. Goodall, C. 1990. A survey of smoothing techniques. In Modern Methods of Data Analysis, ed. J. Fox and J.S. Long, 126-176. Newbury Park CA: Sage Publications. Royston, J.P. 1991. gr6: Lowess smoothing. Stata Technical Bulletin 3: 7-9. Reprinted in Stata Technical Bulletin Reprints, vol. 1, pp. 41-44. Authors ------- Isaias H. Salgado-Ugarte, and Makoto Shimizu University of Tokyo, Faculty of Agriculture, Dept. of Fisheries (Fax 81-3-3812-0529) Also see -------- STB: Manual: [5s] ksm On-line: ^help^ for ^ksm^