I am trying to run your code to see if I can reproduce the result. Unfortunately I am running into an error. I am trying to run the code as is (only change is username/password). The code I am running is from:
When I get to this section:
###############################################################################################################
### COMPUSTAT CLEANING AND VAR CALC ###
# load("180619 data.ccm.RData")
data.comp <- data.ccm %>%
rename(PERMNO=permno) %>% data.table %>% # ensure col names match crsp's
group_by(PERMNO) %>%
mutate(datadate = as.yearmon(datadate),
comp.count = row(.)) %>% # number of years in data; future option to cut first year data; works but leads to warnings
# tests based on BE spread show FF no longer impose this condition (even though mentioned in FF'93)
ungroup %>% arrange(datadate, PERMNO) %>% data.frame %>%
distinct(datadate, PERMNO, .keep_all = TRUE) # hasn't been issue but just in case
I get the following error:
Error: Column `comp.count` must be length 1 (the group size), not 12099238
In addition: There were 50 or more warnings (use warnings() to see the first 50)
Is there an input that I am missing?