webuse auto, clear //1.删除mpg重复的数据,只保留一行,结果每行的mpg值不相同 duplicates drop mpg,force //方法2: bys mpg:gen filter=_n keep if filter==1