Hello everyone,
I have 2 datasets that needed to be merged. Dataset A has unique IDs with multiple transactions for each ID. Dataset B also has unique IDs with multiple action of rating score at different time. I want to merge A and B using unique IDs. However it goes under a condition that date for each transactions must fall into the date range of rating action. For example, stock C got transactions on 01/01/2019 and 06/01/2019. It also got 2 actions of rating score on 06/01/2018 and 02/28/2019. So when merging stock C on transaction 01/01/2019 would get score that rated on 06/01/2018; transactions on 06/01/2019 would get score that rated on 02/28/2019.
Does anyone know how to approach this problem? Thank you so much!!!
Related Posts with Merge based on time-range condition
Indicator VariableI would like to run a difference in difference regression to assess the early impact of country-by-c…
tabulate two variables?Dear All, How can I tabulate the following two variables altogether (horizontally). Code: . tabulat…
Histograms and step function graphs in one figureHi I am using Stata 15. My data is a panel data set for 300 districts from 1980 to 2015. I have thre…
Encoding CommandI am using encode to convert string variables into numeric, e.g. "NA" might get encoded to 0 or leav…
Propensity Score MatchingHi All I have two sets of data with values 0 and 1. The number of observations for dataset of value…
Subscribe to:
Post Comments (Atom)
0 Response to Merge based on time-range condition
Post a Comment