I have a question concerning the average return of a portfolio.

I created 2 groups of stocks, one with sin stocks (alcohol, tobacco and gambling) and one with comperables.
For all the individual firms I have their bid, ask, open price and volume on a daily basis from 1965-2018 (or the period they exist). I would like to generate weighted average monthly returns for the sin group and the comparable group. How can I generate this in Stata?

I am replicating the paper: The price of sin: The effects of social norms on markets by Hong and Kacperczyk.