--------------------------------------------------------------------------------------------------------------------------------- name: log: /disk/nber10/SCCS/hcris/fy/duplicates.log log type: text opened on: 29 Apr 2011, 11:48:44 . set more off . ** by Jean Roth, jroth@nber.org , 2011-04-29 . local indir /homes/nber/jroth/bulk/cost-reports/hosp . foreach year of num 1995/2009 { 2. di "Year = `year'" 3. use prvdr_num using `indir'/hcris`year' 4. duplicates tag prvdr_num , gen(dup_prvdr_num) 5. lab var dup_prvdr_num "Providers with >1 report have dup_prvdr_num>0" 6. duplicates report prvdr_num 7. sort prvdr_num rpt_rec_num 8. saveold `indir'/hcris`year', replace 9. } Year = 1995 Duplicates in terms of prvdr_num Duplicates in terms of prvdr_num -------------------------------------- copies | observations surplus ----------+--------------------------- 1 | 2 0 -------------------------------------- variable rpt_rec_num not found r(111); end of do-file r(111); . exit,clear