Publications by Daniel Lee

Code along 7

14.10.2024

# Load packages # Core library(tidyverse) library(tidyquant) Goal Measure portfolio risk using skewness. Skewness is the extent to which returns are asymmetric around the mean. It is important because a positively skewed distribution means large positive returns are more likely while a negatively skewed distribution implies large negative returns...

608 sym R (4443 sym/17 pcs) 3 img

Codealong7

13.10.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 = symb...

441 sym R (4750 sym/20 pcs) 3 img

Apply 6 FA

13.10.2024

# Load packages # Core library(tidyverse) library(tidyquant) Goal Visualize expected returns and risk to make it easier to compare the performance of multiple assets and portfolios. Choose your stocks. from 2012-12-31 to 2017-12-31 1 Import stock prices symbols <- c("NKE", "NFLX", "AAPL") prices <- tq_get(x = symbols, from = "2...

793 sym R (3254 sym/18 pcs) 1 img

Apply 6 DA

13.10.2024

Import data salary <- read.csv("../00_data/Salaries.csv") Introduction Questions Variation ggplot(data = salary) + geom_bar(mapping = aes(x = rank)) Visualizing distributions ggplot(data = salary) + geom_bar(mapping = aes(x = rank)) salary %>% count(rank) ## rank n ## 1 AssocProf 64 ## 2 AsstProf 67 ## 3 Prof 266 gg...

370 sym R (1308 sym/18 pcs) 10 img

Apply 5

11.10.2024

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.3.1 ## ...

286 sym R (6715 sym/18 pcs) 4 img 7 tbl

Document

10.10.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 = symb...

402 sym R (4242 sym/21 pcs) 2 img

Apply Data 5

10.10.2024

# Load packages # Core library(tidyverse) library(tidyquant) Goal Collect individual returns into a portfolio by assigning a weight to each stock Choose your stocks. from 2020-01-01 to 2024-10-5 # I get error message if I do the default dates, think one of my stock choices is newer. 1 Import stock prices symbols <- c("SPOT", "ISRG", "KHC", "...

546 sym R (2879 sym/11 pcs) 3 img

Apply Data 4

10.10.2024

1 Import stock prices of your choice 2 Convert prices to returns by quarterly 3 Make plot 4 Interpret the plot Which stock do you expect to make more money / higher quarterly return next quarter. I would expect either ISRG or GOOG have the higher quarterly return. GooG has a tighter distrubution with the average return being roughly .125, I...

601 sym 1 img

Document

10.10.2024

# Load packages # Core library(tidyverse) library(tidyquant) Goal Visualize expected returns and risk to make it easier to compare the performance of multiple assets and portfolios. Choose your stocks. from 2012-12-31 to 2017-12-31 1 Import stock prices symbols <- c("XOM", "MSFT", "ABT", "NVDA", "JPM") prices <- tq_get(x = symbols, ...

1001 sym R (4232 sym/21 pcs) 2 img

Code along 6

10.10.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, ...

400 sym R (4144 sym/21 pcs) 2 img