Hi,

I am trying to find beta's for different stocks at in different time periods (when they were not included in the S&P 500 Index and when they were included). I've got three files to work with. One with the 'permno' (id) 'comnam' (company name) 'dateann' (announced inclusion) 'dateeff' (actual inclusion date). One with 'sprtrn' (s&p return) 'rf' (yield on short term government debt) 'date' (observation dates 1 year before dateann and one year after dateeff). One with 'ret' (returns) 'permno' (id) 'dateann' 'date'. Trying to merge them won't work because 5 stocks have double (id) 'permno', an old one and a new one. I am a stata beginner and have no idea what to do from now on. Does anyone know how to proceed?