How do I add a list of variables from a “using” file to every observation (for a list of entities) in the master file? I am attempting to run an event study (and using Stata 15). The variables to be added are dates of events which affect all entities.
For example, to this data set
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input long id float(month ff)
2708 657     -.005559
2708 658 -.0023612394
2708 659  .0009129993
2708 660 -.0016764477
2708 661 -.0025546604
end
format %tmYYMon month
I hope to add the dates of events. For example
generate event_month = mofd(date("2/15/15", "MDY", 2050))
will add a single date to each observation
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input long id float(month ff event_month)
2708 657     -.005559 661
2708 658 -.0023612394 661
2708 659  .0009129993 661
2708 660 -.0016764477 661
2708 661 -.0025546604 661
end
format %tmYYMon month
however there are many event dates (in a seperate file) which I wish to add to each observation in the master file.
Thank you for your help, Dan