Provided that I second all the previous sound advices, an option for detecting outliers is to loop over a variable list, as in the following toy-example:
Code:
set obs 100 g A=runiform() g B=runiform() g C=runiform() foreach var of varlist A-C { quietly summarize `var' g Z_`var'=1 if `var'>3*r(sd) ///the aim of Z_`var' is to detect the values beyond a threshold-value you decide to set (let's say >3 standard deviation apart)/// replace Z_`var'=0 if Z_`var'==. list `var' Z_`var' if Z_`var'==1 }
Carlo
Leave a comment: