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:
symbol: The 3 to 4 letter symbol used to ID the company on the stock market
company: The name of the company
sector: The sector of the economy of the company (Medical/Financial/Utility/Construction/etc…)
state: Which state the headquarters is located
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.
price: The price of an individual share (as of May 23rd 2024)
region: The region in the US (or not in US) of the HQ (Northeast/Midwest/South/West/Not US)
Create a bar graph of each sector. See what it should look like on Brightspace!
Create a bar chart of the number of companies in each sector by region. See what it should look like on Brightspace!
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)
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:
Amazon: “#ff9900”
Tesla: “#E31937”
Nvidia: “#76B900”
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!