Hi there,
I am currently struggling to merge two data files in the way that I want on Stata, so if anyone could help that would be great. I am trying to obtain two portfolios which have average return data for companies between 2005-2013. The companies selected for these portfolios are ranked based on their ESG score. So I have a file with 3000 companies and within each year they are ranked based on this ESG score. I also have a file with the same companies but with their return data for each month. What I ultimately need is two portfolios (one high ranked, one low) with average monthly return data for these companies.
the issue I am having is that each year these portfolios are rebalanced, therefore the companies within them change. So i need to be able to merge these two data files in a way that i can easily find the average monthly return for each portfolio each year based on the ESG rankings. So I think the best way is to somewhere merge the date horizontally whilst still having the companies ranked by ESG score and then manually selecting the top and bottom 800 companies for that month to take an average from. I have attached the stata file that i have done this for 2005 for.
I understand this probably doesnt make much sense but if anyone has any idea how i can make this easier for myself that would be great, thanks!
Related Posts with Stata merging help - date horizontal
Ordered Logit coefficient interpretation with categorical (>2) independent variablesHi I am running an ologit model to understand the effect of parents' beliefs on students' high scho…
Insignificant Pooled OLS model running with bank lending dataHi, We are writing our master thesis on the effect of capital requirements on bank lending, using t…
Help on control variablesDear everyone, I am running a regression of banks in around 26 countries, and I want to include con…
Predicting factors scores after CFAHello I am currently working on confirmatory factor analyses with my survey data using the command …
Normalization of year interaction term to zero for interpretationDear all, I am working with a cross-sectional data set for the years 2005 to 2015. I am trying to e…
Subscribe to:
Post Comments (Atom)
0 Response to Stata merging help - date horizontal
Post a Comment