Publications by Daniel Lee

Apply 9

08.11.2024

Set up library(tidyverse) library(tidyquant) library(broom) library(umap) library(plotly) library(readr) Data # Get info on companies listed in S&P500 sp500_index_tbl <- tq_index("SP500") # Get individual stocks from S&P500 sp500_symbols <- sp500_index_tbl %>% distinct(symbol) %>% pull() # Get stock prices of the companies sp500_prices_tbl...

1911 sym R (8541 sym/24 pcs) 4 img

Apply 10 FA

07.11.2024

# Load packages # Core library(tidyverse) library(tidyquant) Goal Calculate and visualize your portfolio’s beta. Choose your stocks and the baseline market. from 2012-12-31 to present 1 Import stock prices symbols <- c("JPM", "NVDA", "LLY", "AMZN") prices <- tq_get(x = symbols, get = "stock.prices", f...

1388 sym R (2963 sym/16 pcs) 1 img

Document

07.11.2024

# Load packages # Core library(tidyverse) library(tidyquant) Goal Visualize and examine changes in the underlying trend in the downside risk of your portfolio in terms of kurtosis. Choose your stocks. from 2012-12-31 to present 1 Import stock prices symbols <- c("NOK", "GM", "HON", "HMC", "GOOGL") prices <- tq_get(x = symbols, ...

876 sym R (2981 sym/14 pcs) 1 img

Code Along 10

07.11.2024

# Load packages # Core library(tidyverse) library(tidyquant) 1 Import stock prices symbols <- c("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get(x = symbols, get = "stock.prices", from = "2012-12-31", to = "2017-12-31") 2 Convert prices to returns asset_returns_tbl <- prices...

288 sym R (3631 sym/17 pcs) 2 img

Code Along 10 DA

06.11.2024

# Load packages # Core library(tidyverse) library(nycflights13) library(lubridate) Chapter 15 Factors Introduction Creating factors General Social Survey gss_cat ## # A tibble: 21,483 × 9 ## year marital age race rincome partyid relig denom tvhours ## <int> <fct> <int> <fct> <fct> <fct> <fct> <f...

472 sym R (8623 sym/50 pcs) 4 img

Apply 10 DA

06.11.2024

Import your data data <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-06-02/marbles.csv') ## Rows: 256 Columns: 14 ## ── Column specification ─────────────────────────────────────────────────�...

291 sym 2 img

Code Along 10 FA

06.11.2024

# Load packages # Core library(tidyverse) library(tidyquant) Goal Collect individual returns into a portfolio by assigning a weight to each stock five stocks: “SPY”, “EFA”, “IJS”, “EEM”, “AGG” from 2012-12-31 to 2017-12-31 1 Import stock prices symbols <- c("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get(x = symbols, ...

476 sym R (3415 sym/17 pcs) 2 img

Apply 9 DA

06.11.2024

Import your data data <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-03-17/office_ratings.csv') ## Rows: 188 Columns: 6 ## ── Column specification ───────────────────────────────────────────────�...

112 sym Python (11965 sym/14 pcs)

Apply 10

06.11.2024

# Load packages # Core library(tidyverse) library(tidyquant) Goal Calculate and visualize your portfolio’s beta. Choose your stocks and the baseline market. from 2012-12-31 to present 1 Import stock prices symbol <- c("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get(x = symbol, get = "stock.prices", from =...

911 sym R (2830 sym/16 pcs) 1 img

Code Along 11

06.11.2024

library(dplyr) ## ## Attaching package: 'dplyr' ## The following objects are masked from 'package:stats': ## ## filter, lag ## The following objects are masked from 'package:base': ## ## intersect, setdiff, setequal, union library(ggplot2) library(lubridate) ## ## Attaching package: 'lubridate' ## The following objects are masked from '...

462 sym R (10042 sym/60 pcs) 5 img