Merge or join two data sets
Show older comments
I'm working on a project where I have to conduct an event study. The study is based on two timeseries data set:
1) sentiments from news posts (negative, neutral and positive), and
2) futures returns on specific asset and a relevant index.
In the news data I have isolated the date and sentiment in a table, with a huge number of rows since there're several news posts each day (also weekends). The data is further split up to negative, neutral and positive to conduct the event study and examine them seperately. The pic below is the negative.

In the returns data set I have price developments in returns for the asset and its index in a timetable. One price each trading day (not weekends and holidays).

To perform the event study I need to find a way to remove all rows that do not match a trading day and duplicate dates, so I'm left with one row for each trading day. Is that possible?
Can it be done by merging/joining the two data set, since the return data only consists of observations on trading days
Note: The return data goes back further in time since I need to compute the "normal return" based on returns from -205 days to -5 days prior to the news sentiment.
Thanks a lot for the help! I really appreciate any suggestions!
Frank
2 Comments
Mohammad Sami
on 17 Apr 2020
you can use groupsummary to summarise your sentiment data by day first. For example it will count how many negative news item appeared on that day. Then you can merge it with your returns table.
Star Strider
on 17 Apr 2020
Accepted Answer
More Answers (0)
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!