Hello Everyone,

I have imported 2 files from excel to stata with all string variables. I know how to convert them to numeric variables. The two datasets consist of 1) the event dates 2) the prices of the firm. First I was wondering whether I have to declare the files as panel data or time series? second, I do not know how to merge the event dates to the right company as flow traders is a duplicate and has 2 different event dates? third, once the event date is merged, how can I get the number of trading days until and from the event per firm? I have included the data below.

I hope my question is clear. If I can do something that makes it easier to answer the question please let me know.

Thanks in advance,

Delano Driessen


Data for prices;


Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str10 Date str17 PTBV str6 Price str8 MarketValue str11 Name
" 3/28/2018" "4.8"               "35.18"  "1637.1"   "Flowtraders"
" 3/29/2018" "4.72"              "34.62"  "1611.04"  "Flowtraders"
" 3/30/2018" "4.72"              "34.62"  "1611.04"  "Flowtraders"
"  4/2/2018" "4.72"              "34.62"  "1611.04"  "Flowtraders"
"  4/3/2018" "4.81"              "35.22"  "1638.96"  "Flowtraders"
"  4/4/2018" "4.7"               "34.46"  "1603.6"   "Flowtraders"
"  4/5/2018" "4.68"              "34.32"  "1597.08"  "Flowtraders"
"  4/6/2018" "4.7"               "34.48"  "1604.53"  "Flowtraders"
"  4/9/2018" "4.73"              "34.7"   "1614.76"  "Flowtraders"
" 4/10/2018" "4.8"               "35.16"  "1636.17"  "Flowtraders"
" 4/11/2018" "4.96"              "36.34"  "1691.08"  "Flowtraders"
" 4/12/2018" "4.86"              "35.64"  "1658.51"  "Flowtraders"
" 4/13/2018" "4.85"              "35.54"  "1653.85"  "Flowtraders"
" 4/16/2018" "4.95"              "36.28"  "1688.29"  "Flowtraders"
" 4/17/2018" "5"                 "36.62"  "1704.11"  "Flowtraders"
" 4/18/2018" "5.08"              "37.22"  "1732.03"  "Flowtraders"
" 4/19/2018" "5.04"              "36.96"  "1719.93"  "Flowtraders"
" 4/20/2018" "4.94"              "36.22"  "1685.5"   "Flowtraders"
" 4/23/2018" "5.08"              "37.24"  "1732.96"  "Flowtraders"
" 3/13/2018" "9.83"              "43.5"   "74590.56" "UNILEVER"   
" 3/14/2018" "9.800000000000001" "43.4"   "74419.06" "UNILEVER"   
" 3/15/2018" "9.74"              "43.1"   "73904.69" "UNILEVER"   
" 3/16/2018" "9.779999999999999" "43.3"   "74247.63" "UNILEVER"   
" 3/19/2018" "9.83"              "43.5"   "74590.56" "UNILEVER"   
" 3/20/2018" "9.800000000000001" "43.4"   "74419.06" "UNILEVER"   
" 3/21/2018" "9.800000000000001" "43.4"   "74419.06" "UNILEVER"   
" 3/22/2018" "9.800000000000001" "43.4"   "74419.06" "UNILEVER"   
" 3/23/2018" "9.85"              "43.6"   "74762.06" "UNILEVER"   
" 3/26/2018" "9.74"              "43.1"   "73904.69" "UNILEVER"   
" 3/27/2018" "9.779999999999999" "43.3"   "74247.63" "UNILEVER"   
" 3/28/2018" "10.26"             "45.4"   "77848.56" "UNILEVER"   
" 3/29/2018" "10.46"             "46.3"   "79391.81" "UNILEVER"   
" 3/30/2018" "10.46"             "46.3"   "79391.81" "UNILEVER"   
"  4/2/2018" "10.46"             "46.3"   "79391.81" "UNILEVER"   
"  4/3/2018" "10.35"             "45.8"   "78534.44" "UNILEVER"   
"  4/4/2018" "10.44"             "46.2"   "79220.31" "UNILEVER"   
"  4/5/2018" "10.64"             "47.1"   "80763.56" "UNILEVER"   
"  4/6/2018" "10.6"              "46.9"   "80420.63" "UNILEVER"   
"  4/9/2018" "10.48"             "46.4"   "79563.25" "UNILEVER"   
" 3/14/2018" "4.51"              "33.04"  "1537.52"  "flowtraders"
" 3/15/2018" "4.48"              "32.8"   "1526.35"  "flowtraders"
" 3/16/2018" "4.47"              "32.78"  "1525.42"  "flowtraders"
" 3/19/2018" "4.49"              "32.9"   "1531"     "flowtraders"
" 3/20/2018" "4.47"              "32.74"  "1523.56"  "flowtraders"
" 3/21/2018" "4.51"              "33.04"  "1537.52"  "flowtraders"
" 3/22/2018" "4.43"              "32.48"  "1511.46"  "flowtraders"
" 3/23/2018" "4.84"              "35.44"  "1649.2"   "flowtraders"
" 3/26/2018" "4.6"               "33.74"  "1570.09"  "flowtraders"
" 3/27/2018" "4.84"              "35.48"  "1651.06"  "flowtraders"
" 3/28/2018" "4.8"               "35.18"  "1637.1"   "flowtraders"
" 3/29/2018" "4.72"              "34.62"  "1611.04"  "flowtraders"
" 3/30/2018" "4.72"              "34.62"  "1611.04"  "flowtraders"
"  4/2/2018" "4.72"              "34.62"  "1611.04"  "flowtraders"
"  4/3/2018" "4.81"              "35.22"  "1638.96"  "flowtraders"
"  4/4/2018" "4.7"               "34.46"  "1603.6"   "flowtraders"
"  4/5/2018" "4.68"              "34.32"  "1597.08"  "flowtraders"
"  4/6/2018" "4.7"               "34.48"  "1604.53"  "flowtraders"
"  4/9/2018" "4.73"              "34.7"   "1614.76"  "flowtraders"
" 4/10/2018" "4.8"               "35.16"  "1636.17"  "flowtraders"
"  3/7/2018" "1.41"              "18.442" "22993.65" "Ahold"      
"  3/8/2018" "1.38"              "18.152" "22632.07" "Ahold"      
"  3/9/2018" "1.39"              "18.202" "22694.41" "Ahold"      
" 3/12/2018" "1.39"              "18.256" "22761.73" "Ahold"      
" 3/13/2018" "1.4"               "18.318" "22839.04" "Ahold"      
" 3/14/2018" "1.39"              "18.202" "22694.41" "Ahold"      
" 3/15/2018" "1.4"               "18.356" "22886.43" "Ahold"      
" 3/16/2018" "1.41"              "18.54"  "23115.82" "Ahold"      
" 3/19/2018" "1.41"              "18.532" "23105.86" "Ahold"      
" 3/20/2018" "1.43"              "18.686" "23297.88" "Ahold"      
" 3/21/2018" "1.42"              "18.65"  "23252.98" "Ahold"      
" 3/22/2018" "1.42"              "18.674" "23282.9"  "Ahold"      
" 3/23/2018" "1.43"              "18.692" "23305.35" "Ahold"      
" 3/26/2018" "1.41"              "18.452" "23006.11" "Ahold"      
" 3/27/2018" "1.43"              "18.756" "23385.14" "Ahold"      
" 3/28/2018" "1.45"              "19.072" "23779.14" "Ahold"      
" 3/29/2018" "1.47"              "19.242" "23991.1"  "Ahold"      
" 3/30/2018" "1.47"              "19.242" "23991.1"  "Ahold"      
"  4/2/2018" "1.47"              "19.242" "23991.1"  "Ahold"      
end
Data for event dates:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str11 Naam str10 EventDate
"Flowtraders" " 4/15/2018"
"Unilever"    "  4/1/2018"
"Flowtraders" "  4/1/2018"
"Ahold"       " 3/25/2018"
end