Can you make your data reproducible next time?
Your data:
library(tidyverse)
NewData <- tibble::tribble(
~gvkey, ~date, ~a, ~b,
1L, "01/01/2000", 15624000, 10011531920,
1L, "02/01/2000", 18480000, 10592724720,
1L, "03/01/2000", 16968000, 10160611743,
2L, "01/01/2000", 9375333997, 10011531920,
2L, "02/01/2000", 9943536057, 10592724720,
2L, "03/01/2000", 9470034340, 10160611743,
3L, "01/01/2000", 441665123.3, 10011531920,
3L, "02/01/2000", 412041243.1, 10592724720,
3L, "03/01/2000", 417427403.1, 10160611743
)
a<-NewData %>%
mutate(firmMarket=NewData$cshoc*NewData$prccd)
Which column is meant to be cschoc
and which one is meant to be prccd
? Are they from somewhere else?