Module # 10 assignment

For this assignment, we will be using ggplot2 and creating time series visualizations to analyze data.

To start, we will make a barplot. Using hotdogs data and ggplot2, we can create a visualization that shows the contest results over 30 years. We can see that the number of hotdogs and buns seems to mostly steadily increase over time, going from an average of 10 to well over 50.

Next, using ggplot, we can create a similar graph, but one that is more refined, easier to understand, and more presentable. 

In the first graph, there is no indicator of what the different colored bars mean. In the new visualization, the key makes it very clear that they represent new record amounts of HBDs eaten. Additionally, the first graph’s y axis cuts off at 60, while we have some data bars that exceed that, but it’s unclear just what number they are. In the new graph, we can see that they are in between 60 and 70. 

Using base R graphics, we can also create a stacked bar plot to compare the hotdog eating contest results from 2000 to 2010. Unlike a regular bar plot, which displays each category separately, a stacked bar plot places the values on top of one another within each bar. This allows us to see the combined total as well as how each category contributes to that total.

Next, using ggplots built in dataset, economics, we can can create a time series to plot unemployment population over time. This graph gives us a visual look at how unemployment has changed over time. We can easily see periods where unemployment increased or decreased, showing how economic conditions have shifted throughout the years.

These graphs show the relationship between the unemployment-to-population ratio and the median number of weeks people remain unemployed. The first graph shows the overall relationship, while the second uses different colors to represent each year, making it easier to see how the pattern changes over time. We can see how unemployment levels and the length of time people remain unemployed are connected, as well as how this relationship shifts across different years. 

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *