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
Testing for weak instruments in 2SLS regression using robust SE (just-identified model)Hi, I'am currently struggling to test for weak instruments when conducting a 2sls regression using …
Importance of misspecification test vs. R-sq. and consequences of xtsktestDear Statalist Members, I am analyzing a balanced panel of around 2400 firms over 12 years (Stata 1…
Generating a new variable with standardized values compared to a healthy control group mean and SD (z scores)I'm working with crossectional test data with a selection of test results (all continuous variables)…
Esport summary statistics by 5 groupsDear all, Recfently I presented my research project to a faculty. One of the comment for improvemen…
Bernanke Sims Decomposition Restriction for VAR IRFsHi all, I'm wondering if anyone knows if STATA has the functionality to do a bernanke sims decomposi…
Subscribe to:
Post Comments (Atom)
0 Response to Stata merging help - date horizontal
Post a Comment