EMF Part 2
Data handling
Research question is key, not statistical significance.
1. Ri=x + β−❑❑ βmomentum After results: what do we learn? Suppose I don’t
find momentum: explain. Think ahead before making research question.
2. Create table 1
create dummy var=sell and run on cumulative return.
Why would you test for 18th century, what is added value? Are investors same
today
3. Possible extensions: re-do in other country/time period For which other
country? What would we learn from that? If you believe so, why didn’t you do
it?
WRDS: import data from WRDS in Stata.
Check data: plot some summaries. Key is your prior expectations (no
negative results).
-99 is missing value in CRSP, ordinary equity stocks have share code 10 or
11.
Stata code:
preserve: save what you did before.
Normalize/standardize price to compare in graph:
o bysort permno: g firstprice=prc if _n==1: create firstprice for every
firm which takes value of series prc if it’s fist observation and missing
otherwise.
o bysort permno: g scalingfactor=sum(firstprice): create scalingfactor for
every firm which takes value of firstprice for all days.
o Divide every price observation by scalingfactor and multiply by 100.
restore: Stata retrieves dataset before preserve.
Dates:
Stata dates are numerical, days are numbered (starting from Jan 1 st, 1960).
o Easy to add and subtract.
o Otherwise account for year, month, day, leap years, Feb 29.
Stata code:
preserve
g eventdate=17790: create eventdate which measures days relevant to
event day.
display date(“20080915”, “YMD”) dates will be numerical.
g t=date-eventdate: shows days around event.
replace ret=ret*100
keep if t>-14 & t<14: reduce window to 14 days before and after.
replace ret=. if permno==80599 & t>0: Lehman has no returns after event.
twoway (line ret t if permno==80599)
,
Data handling
Research question is key, not statistical significance.
1. Ri=x + β−❑❑ βmomentum After results: what do we learn? Suppose I don’t
find momentum: explain. Think ahead before making research question.
2. Create table 1
create dummy var=sell and run on cumulative return.
Why would you test for 18th century, what is added value? Are investors same
today
3. Possible extensions: re-do in other country/time period For which other
country? What would we learn from that? If you believe so, why didn’t you do
it?
WRDS: import data from WRDS in Stata.
Check data: plot some summaries. Key is your prior expectations (no
negative results).
-99 is missing value in CRSP, ordinary equity stocks have share code 10 or
11.
Stata code:
preserve: save what you did before.
Normalize/standardize price to compare in graph:
o bysort permno: g firstprice=prc if _n==1: create firstprice for every
firm which takes value of series prc if it’s fist observation and missing
otherwise.
o bysort permno: g scalingfactor=sum(firstprice): create scalingfactor for
every firm which takes value of firstprice for all days.
o Divide every price observation by scalingfactor and multiply by 100.
restore: Stata retrieves dataset before preserve.
Dates:
Stata dates are numerical, days are numbered (starting from Jan 1 st, 1960).
o Easy to add and subtract.
o Otherwise account for year, month, day, leap years, Feb 29.
Stata code:
preserve
g eventdate=17790: create eventdate which measures days relevant to
event day.
display date(“20080915”, “YMD”) dates will be numerical.
g t=date-eventdate: shows days around event.
replace ret=ret*100
keep if t>-14 & t<14: reduce window to 14 days before and after.
replace ret=. if permno==80599 & t>0: Lehman has no returns after event.
twoway (line ret t if permno==80599)
,