Publications by Ethan Hicks

Quiz2_c

25.02.2020

In this exercise you will learn to plot data using the ggplot2 package. To answer the questions below, use Chapter 4.3 Categorical vs. Quantitative Data Visualization with R. # Load packages library(tidyquant) library(tidyverse) # Import stock prices stock_prices <- tq_get(c("AAPL", "MSFT"), get = "stock.prices", from = "2020-01-01") # Calcul...

1464 sym R (1241 sym/7 pcs) 5 img

Document

03.03.2020

# Load packages library(tidyquant) library(tidyverse) # Import stock prices stock_prices <- tq_get(c("WMT", "TGT", "AMZN"), get = "stock.prices", from = "2020-01-01") # Calculate daily returns stock_returns <- stock_prices %>% group_by(symbol) %>% tq_mutate(select = adjusted, mutate_fun = periodReturn, period = "daily") stock_retur...

1915 sym R (2500 sym/9 pcs) 3 img

Quiz 3

26.03.2020

The data set is from a case-control study of smoking and Alzheimer’s disease. The data set has two variables of main interest: smoking a factor with four levels “None”, “<10”, “10-20”, and “>20” (cigarettes per day) disease a factor with three levels “Alzheimer”, “Other dementias”, and “Other diagnoses”. Q1 Describ...

2377 sym 2 img

Quiz 1

17.02.2021

In this exercise, use Chapter 4.2 Quantitative vs. Quantitative Data Visualization with R. # Load packages library(tidyquant) library(tidyverse) # Import stock prices stock_prices <- tq_get(c("AAPL", "MSFT", "AMZN"), get = "stock.prices", from = "2021-01-01") # Calculate daily returns stock_returns <- stock_prices %>% group_by(...

2857 sym R (2750 sym/7 pcs) 1 img

Quiz 3

19.03.2021

# Load packages library(tidyquant) library(tidyverse) Q1 dividends Import dividends of General Motors and Ford since 2010. mult_stocks <- tq_get(c("F", "GM"), get = "dividends", from = "2010-01-01") mult_stocks ## # A tibble: 58 x 3 ## symbol date value ## <chr> <date> <dbl> ...

1429 sym R (4952 sym/17 pcs)

Quiz 2

04.03.2021

# Load packages library(tidyquant) library(tidyverse) Q1 dividends Import dividends of General Motors and Ford since 2010. mult_stocks <- tq_get(c("F", "GM"), get = "dividends", from = "2010-01-01") mult_stocks ## # A tibble: 58 x 3 ## symbol date value ## <chr> <date> <dbl> ...

1429 sym R (4952 sym/17 pcs)

Quiz 4

03.04.2021

Witht the given stock, conduct the Bollinger Bands analysis by answering the questions below. Q1 Calculate 20-day moving averages and 20-day running standard deviation. Save the result under stock and print it. Hint: Take stock, pipe it to tidyquant::tq_mutate to calculate 20-day moving averages, pipe it to tidyquant::tq_mutate to calculate 20-d...

2991 sym 1 img

Quiz 5

17.04.2021

# Load packages library(tidyquant) ## Loading required package: lubridate ## ## Attaching package: 'lubridate' ## The following objects are masked from 'package:base': ## ## date, intersect, setdiff, union ## Loading required package: PerformanceAnalytics ## Loading required package: xts ## Loading required package: zoo ## ## Attachin...

3076 sym R (6227 sym/36 pcs) 1 img

Term Paper

03.05.2021

Finance students in the past have participated in national student competitions. They are a great opportunity to practice and further your knowledge and skills you learned in the finance program at PSU. Because not all of you are finance major, grading will be generous as long as you follow the instructions (e.g., number counts for answers). In a...

6018 sym

Quiz 6

01.05.2021

title: Quiz 6 author: Ethan Hicks output: html_document: toc: true — Q1 Get monthly returns of Tesla, Amazon, and Netflix for the last 5 years. # Load packages library(tidyquant) library(tidyverse) from <- today() - years(5) stock_returns_monthly <- c("TSLA", "AMZN", "NFLX") %>% tq_get(get = "stock.prices", from = from...

1705 sym R (8267 sym/18 pcs)