Publications by Owen Pedi

code_Along_8

27.03.2023

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

428 sym R (3703 sym/16 pcs) 3 img

apply7

23.03.2023

# 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("AAPl", "LUV", "NKE", "MSFT") prices <- tq_get(x = symbols, from = "2012-12-31", to = "2017-12-31...

776 sym R (2778 sym/15 pcs)

Code_Along_7_Ch_5

20.03.2023

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

438 sym R (4301 sym/18 pcs) 3 img

CodeAlong_6

06.03.2023

# 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 (4007 sym/21 pcs) 2 img

Apply_6

06.03.2023

# 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("AAPl", "LUV", "NKE", "MSFT") prices <- tq_get(x = symbols, fro...

929 sym R (3072 sym/17 pcs) 1 img

CodeAlong_5

27.02.2023

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

353 sym R (2529 sym/14 pcs) 3 img

Apply_5

27.02.2023

# 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 2012-12-31 to 2017-12-31 1 Import stock prices symbols <- c("AAPl", "LUV", "NKE", "MSFT") prices <- tq_get(x = symbols, from = "2012-12-31", t...

475 sym R (2190 sym/12 pcs) 1 img

Apply4

22.02.2023

1 Import stock prices of your choice 2 Convert prices to returns by quarterly ## # A tibble: 100 × 3 ## assets dates returns ## <chr> <date> <dbl> ## 1 AAPL 2012-03-30 0.377 ## 2 AAPL 2012-06-29 -0.0263 ## 3 AAPL 2012-09-28 0.137 ## 4 AAPL 2012-12-31 -0.221 ## 5 AAPL 2013-03-28 -0.178 ## 6 AAPL 2013-06-28...

593 sym 1 img

CodeAlong_4

20.02.2023

# Load packages # Core library(tidyverse) ## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ── ## ✔ ggplot2 3.4.0 ✔ purrr 1.0.1 ## ✔ tibble 3.1.8 ✔ dplyr 1.1.0 ## ✔ tidyr 1.3.0 ✔ stringr 1.5.0 ## ✔ r...

216 sym R (2764 sym/8 pcs) 1 img

Apply3

16.02.2023

library(tidyverse) library(tidyquant) get stock prices and convert to returns Ra <- c("LUV", "MSFT", "NKE") %>% tq_get(get = "stock.prices", from = "2022-01-01") %>% group_by(symbol) %>% tq_transmute(select = adjusted, mutate_fun = periodReturn, period = "monthly", col_rena...

196 sym R (3177 sym/11 pcs)