Data Description

The sp500 data set has the 502 companies in the Standards & Poors (S&P 500) that are the largest 500 (502) publicly traded companies in the US. The data set has 11 variables, with the important ones being:

  1. symbol: The 3 to 4 letter symbol used to ID the company on the stock market

  2. company: The name of the company

  3. sector: The sector of the economy of the company (Medical/Financial/Utility/Construction/etc…)

  4. state: Which state the headquarters is located

  5. market_cap: The total price of all the “at large” shares (as of May 23rd 2024) of the company. Used as a measure of the value of the entire company.

  6. price: The price of an individual share (as of May 23rd 2024)

  7. region: The region in the US (or not in US) of the HQ (Northeast/Midwest/South/West/Not US)

Question 1: Bar Graphs

Part 1A) Bar Graph of sector

Create a bar graph of each sector. See what it should look like on Brightspace!

Part 1b) Region by Sector

Create a bar chart of the number of companies in each sector by region. See what it should look like on Brightspace!

Part 1c) Sectors by Region

Create a bar chart of the percentage of regions by sector. See what it should look like on Brightspace! The groups on the x-axis are ordered by market cap (highest -> lowest)

Question 2: Graphs for market cap and available shares

Part 2a) Histogram for market cap

Create a histogram in Brightspace for market cap

Part 2b) Density plot for the number of shares by sector

Create the density plot seen in Brightspace. The number of shares = market_cap / price.

Question 3: Graph of Market Cap for Tesla, Nvidia, and Amazon

The code chunk below reads in a data set that has the daily closing price per share of three companies: Amazon, Tesla, and Nvidia from January 1st, 2020 to May 23rd, 2024.

The important columns are: company, date, and market_cap

Create an appropriate graph to show how the three companies’ market cap has changed across time. If you use color to represent the companies (hint, hint), the company color hexcodes are:

Display market cap in billions (1,000,000,000) of dollars (ie, 100 billion market cap = 100). Add any appropriate titles, labels, themes, etc… to make the graph look nice!