Description Usage Arguments Value Examples
Generate CompetitorSize from a dataset of portfolio weights and a dataset of fund sizes
1 2 | GenCompSize(pw, size, fund.id = "wficn", date.id = "date",
stock.id = "permno", w.var = "w", size.var = "fund.size")
|
pw |
data.table (or data.frame) of portfolio weights (or other measure based on which fund similarity should be calculated). Must be a long-form dataset, with columns specifying fund, stock, date, and the corresponding portfolio weight. |
size |
data.table (or data.frame) of fund sizes. Must be a long-form dataset, with columns corresponding to fund, date, and the size measure. |
fund.id |
Name of the variable (supplied as a character string) containing fund identifiers. Defaults to "wficn". |
date.id |
Name of the variable (supplied as a character string) conteining time identifiers. Defaults to "date". |
stock.id |
Name of the variable (supplied as a character string) containing security identifiers. Defaults to "permno". |
w.var |
Name of the variable (supplied as a character string) based on which fund similarity is to be calculated. Defaults to "w". In Jakab (2018), w.var is market-adjusted portfolio weights. |
fund.size |
Name of the variable (supplied as a character string) based on which competitor size is to be calculated. In Jakab (2018), fund.size is FundSize, i.e. total net assets normalized by the market capitalization of all common equity in CRSP. |
A data.table of fund.ids, dates, and CompetitorSize (labeled comp.size).
1 2 3 4 5 6 7 8 9 10 11 | pw <- data.table(
wficn = paste0("fund", rep(1:2, each = 50)),
date = paste0("date", rep(rep(1:2, each = 25), 2)),
permno = paste0("stock", rep(1:25, 4)),
w = runif(100))
pw[, w := w / sum(w), by = .(wficn, date)]
size <- data.table(
wficn = paste0("fund", rep(1:2, each = 2)),
date = paste0("date", rep(1:2, 2)),
fund.size = c(.1, .11, .2, .25))
GenCompSize(pw, size)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.