Thank you for your help. what I need is to calculate the R2 for each firm in each year. to calculate the weight variable I need to create a new variable that represent the total market value of each industry in each week. To do so I write this code: by industry_id week , sort: egen industry_mv = total( weeklymv).
is this code OK or should I use another one.
is this code OK or should I use another one.
Comment