Rows: 424 Columns: 18
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (10): ticker, name, asset_class, sub_asset_class, region, market, locat...
dbl (6): gross_expense_ratio_percent, net_expense_ratio_percent, net_asset...
dttm (2): incept_date, net_assets_as_of
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
blackrock_etf_screener_esg <- blackrock_etf_screener |>mutate(standard_or_esg =if_else(condition =is.na(sustainable_classification),true ="ESG",false ="Standard" ))|>group_by(sustainable_classification) |># Summarize to find the largest fund by net assets in each classificationsummarize(largest_fund_name = name[which.max(net_assets_usd)],largest_fund_net_assets =max(net_assets_usd),total_assets_in_classification =sum(net_assets_usd),percent_of_assets = (largest_fund_net_assets / total_assets_in_classification) *100 ) |># Rank the classifications by the % of assets in its largest fundmutate(rank =dense_rank(desc(percent_of_assets))) |># Arrange by the rank in descending orderarrange(desc(rank))blackrock_etf_screener_esg
# Find the 10 smallest ETFs by net assetssmallest_etfs <- blackrock_etf_screener %>%arrange(net_assets_usd) %>%head(10)ggplot(smallest_etfs, aes(x =fct_reorder(name, net_assets_usd), y = net_assets_usd)) +geom_bar(stat ="identity", fill ="Pink") +coord_flip() +labs(title ="10 Smallest ETFs",x ="ETF Name",y ="Net Assets (USD)",caption ="Zixi Fan") +theme_minimal() +scale_y_continuous(labels = scales::label_dollar(scale =1))
Question 3
# Find the bottom quintile threshold for the MSCI ESG quality scorebottom_quintile_threshold <-quantile(blackrock_etf_screener$msci_esg_quality_score_0_10, 0.4, na.rm =TRUE)# Find the funds in the bottom quintile of the MSCI ESG quality scorebottom_quintile_funds <- blackrock_etf_screener %>%filter(msci_esg_quality_score_0_10 <= bottom_quintile_threshold)bottom_quintile_funds
# Calculate the number of funds and the total assets, grouped by asset class and sub-asset classfunds_summary <- bottom_quintile_funds %>%group_by (asset_class, sub_asset_class) %>%summarize(number_of_funds =n(),total_assets =sum(net_assets_usd, na.rm =TRUE) )
`summarise()` has grouped output by 'asset_class'. You can override using the
`.groups` argument.
funds_summary
# A tibble: 15 × 4
# Groups: asset_class [4]
asset_class sub_asset_class number_of_funds total_assets
<chr> <chr> <int> <dbl>
1 Equity All Cap 40 124665679945.
2 Equity Large Cap 3 6868475033
3 Equity Large/Mid Cap 15 49976527609.
4 Equity Mid Cap 4 93098049659.
5 Equity Mid/Small Cap 1 987699241.
6 Equity Small Cap 18 188148191582.
7 Fixed Income Corporates 1 41339182.
8 Fixed Income Credit 2 1994922916.
9 Fixed Income Government 24 220879023443.
10 Fixed Income High Yield 20 40239808172.
11 Fixed Income Inflation 4 27172554003.
12 Fixed Income Multi Sectors 11 139515488512.
13 Multi Asset Static Allocation 2 870450502.
14 Multi Asset Target Date 1 2711720.
15 Real Estate Real Estate Securities 6 11753595625.
Question 4
#1 Show the distribution of funds across different asset classes.
asset_class_distribution <- blackrock_etf_screener %>%count(asset_class) %>%arrange(desc(n))ggplot(asset_class_distribution, aes(x =reorder(asset_class, n), y = n, fill = asset_class)) +geom_bar(stat ="identity") +coord_flip() +labs(title ="Distribution of iShares ETFs by Asset Class",x ="Asset Class",y ="Number of Funds") +theme_minimal()
#2 Identify and visualize the top 10 largest ETFs by total assets.
top_10_etfs <- blackrock_etf_screener %>%arrange(desc(net_assets_usd)) %>%slice_head(n =10)ggplot(top_10_etfs, aes(x =reorder(name, net_assets_usd), y = net_assets_usd)) +geom_bar(stat ="identity", fill ="blue") +coord_flip() +labs(title ="Top 10 Largest iShares ETFs by Total Assets",x ="ETF Name",y ="Total Assets (USD)") +theme_minimal()
#3 Explore the distribution of MSCI ESG Quality Scores across all ETFs.
ggplot(blackrock_etf_screener, aes(x = msci_esg_quality_score_0_10)) +geom_histogram(binwidth =0.1, fill ="green", color ="Black") +labs(title ="Distribution of MSCI ESG Quality Scores Among iShares ETFs",x ="ESG Quality Score",y ="Frequency") +theme_minimal()