Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. dt.res <- dt.cj[Analys.x < Analys.y, .(cnt = length(unique(CUSIP.x))),by = .(Fdate, Analys.x, Analys.y)]```
  2.  
  3. ```dt <- data.table(CUSIP = c(1,1,1,1,2,2,2,2,2,2), Fdate = c("2000-12-31","2000-12-31","2001-12-31","2001-12-31","2000-12-31","2000-12-31","2000-12-31", "2001-12-31", "2001-12-31", "2001-12-31"), Analys = c(7649, 9845, 44283, 7649, 9845, 37856, 63528, 9845, 88254, 88254))```
  4.  
  5. CUSIP = Unique ID for a company
  6. Fdate = The date the forecast is based for
  7. Analys = The ID of a analyst
  8.  
  9. ```output <- data.table(Reg.ID = c(1,1,2,2), Location = c("2000-12-31","2001-12-31"), Count = c(2,2,3,2))```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement