Publications by Hailey Botelho
Term Project
This is an extension of the tidytuesday assignment you have already done. Complete the questions below, using the screencast you chose for the tidytuesday assigment. Import data library(tidyverse) library(lubridate) library(scales) theme_set(theme_light()) bike_traffic_raw <- readr::read_csv("https://raw.githubusercontent.com/rfordatascience/tid...
2468 sym R (6843 sym/10 pcs) 8 img
Quiz 5
Replicate a case study of marketing analytics: https://www.linkedin.com/learning/the-data-science-of-marketing/cluster-analysis-with-r?u=2232593 Q1 Import data myClusterData <- read.csv("cluster-r.csv") Q2 Review data head(myClusterData) ## Email Behavior.3 Brand.Preference CTA ## 1 nisl@adipisc...
646 sym R (21545 sym/6 pcs) 1 img
Quiz 4
Make sure to include the unit of the values whenever appropriate. Q1 Build a regression model to predict life expectancy using gdp per capita. Hint: The variables are available in the gapminder data set from the gapminder package. Note that the data set and package both have the same name, gapminder. library(tidyverse) options(scipen=999) data(...
2428 sym R (2087 sym/3 pcs)
Reading on Regression
Instructions You must follow the instructions below to get credits for this assignment. Read the document (example of regression analysis) posted in Moodle before answering the following questions. Write in your own words. Multiple identical answers will get zero. Elaborate your answer. One or two sentence answers won’t get credit. Make sure t...
5476 sym
Quiz 2
# 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...
1890 sym R (2522 sym/9 pcs) 3 img
Bivariate Graphs
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. Q1 Plot the distribution of daily returns by stock using kernel density plots. Hint: See the code in 4.3.2 Grouped kernel density plots. Q2 Plot the distribution of daily...
1441 sym 5 img
Introduction to ggplot2
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") stock_pri...
1134 sym R (2783 sym/10 pcs) 6 img
Clean Data
In this exercise you will learn to clean data using the dplyr package. To this end, you will follow through the codes in one of our e-texts, Data Visualization with R. The given example code below is from Chapter 1.2 Cleaning data. ## # A tibble: 87 x 13 ## name height mass hair_color skin_color eye_color birth_year gender ## <chr> <int>...
864 sym R (2656 sym/7 pcs)
Mock Quiz 1
Use the given code below to answer the questions. Q1 Get Walmart stock prices, instead of Apple. Hint: Insert a new code chunk below and type in the code, using the tq_get() function above. Replace the ticker symbol for Walmart. You may find the ticker symbol for Microsoft from Yahoo Finance. ## Load package library(tidyverse) # for cleaning, pl...
1757 sym R (1014 sym/3 pcs) 1 img
My First RMarkdown with Code
Use the given code below to answer the questions. Q1 Get Amazon stock prices, instead of Apple. Hint: Insert a new code chunk below and type in the code, using the tq_get() function above. Replace the ticker symbol for Microsoft. You may find the ticker symbol for Microsoft from Yahoo Finance. ## Load package library(tidyverse) # for cleaning, p...
1403 sym R (1021 sym/3 pcs) 1 img