Stata Assistance

Good Evening,

I need assistance to create the following in STATA

I calculate the highest 24-month concentration of merger bids involving firms in that industry in each decade.2 This 24-month period is identified as a potential wave. Taking the total number of bids over the entire decade for a given industry, I simulate 1000 distributions of that number of occurrences of industry member involvement in a bid over a 120-month period by randomly assigning each occurrence to a month where the probability of assignment is 1/120 for each month. I then calculate the highest 24-month concentration of activity from each of the 1000 draws. Finally, I compare the actual concentration of activity from the potential wave to the empirical distribution of 1000 peak 24-month concentrations. If the actual peak concentration exceeds the 95th percentile from that empirical distribution, that period is coded as a wave.