Publications by Daniel Lee

Code Along 9

06.11.2024

Set up library(tidyverse) ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.4 ✔ readr 2.1.5 ## ✔ forcats 1.0.0 ✔ stringr 1.5.1 ## ✔ ggplot2 3.5.1 ✔ tibble 3.2.1 ## ✔ lubridate 1.9.3 ✔ tidyr 1....

285 sym R (12004 sym/38 pcs) 4 img

CodeAlong10

04.11.2024

# Load packages # Core library(tidyverse) library(tidyquant) 1 Import stock prices # 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 sto...

502 sym R (3621 sym/18 pcs) 2 img

CodeAlong9

04.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= symbo...

368 sym R (3929 sym/20 pcs) 1 img

Applyit10

04.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("GOOG", "HSY", "TSLA", "AAPL", "SBUX") prices <- tq_get(x = symbols, get = "stock.prices", ...

840 sym R (2933 sym/16 pcs) 1 img

Apply9

04.11.2024

# Load packages # Core library(tidyverse) library(tidyquant) Goal Visualize and examine changes in the underlying trend in the performance of your portfolio in terms of Sharpe Ratio. Choose your stocks. from 2012-12-31 to present 1 Import stock prices symbols <- c("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get(x= symbols, ...

956 sym R (3929 sym/20 pcs) 1 img

Code Along 10

04.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 symbol <- c("SPY", "EFA", "IJS", "EEM", "AGG") prices <- tq_get(x = symbol, ...

474 sym R (3325 sym/17 pcs) 2 img

Code along 10 Financial analytics

05.11.2024

# Load packages # Core library(tidyverse) library(tidyquant) Goal Measure the portfolio’s beta coefficient, which can be thought of as the portfolio’s sensitivity to the market or its riskiness relative to the market. five stocks: “SPY”, “EFA”, “IJS”, “EEM”, “AGG” market: “SPY” from 2012-12-31 to 2017-12-31 1 Import s...

538 sym R (3514 sym/17 pcs) 2 img

Code along 10 Data analytics

05.11.2024

Ch15 Factors 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> <fct> <int> ## 1 2000 Never married 26 White $8000 to 9999 Ind,near … Prot… Sout… 12 ## ...

396 sym 3 img

Code along 9 DA

03.11.2024

Introduction String basics chac_data <- "I'm 'very' hungry." stringr::str_length("I am hungry.") ## [1] 12 stringr::str_c(c("I", " am"), collapse = "") ## [1] "I am" stringr::str_c("I", " am", sep = " ;") ## [1] "I ; am" str_sort(c("John", "Mary", "Aaron")) ## [1] "Aaron" "John" "Mary" Matching patterns with regular expressions flights %>% glim...

362 sym

Document

31.10.2024

# Load packages # Core library(tidyverse) library(tidyquant) Goal Visualize and compare skewness of your portfolio and its assets. Choose your stocks. from 2012-12-31 to 2017-12-31 1 Import stock prices symbols <- c("NOK", "GOOGL", "GM", "FDX", "AMZN") prices <- tq_get(x = symbols, get = "stock.prices", ...

870 sym R (3143 sym/18 pcs) 1 img