Packages and Data

setwd("~/Desktop/MTH 250")
library(tidyverse)
drug <- readr::read_csv("~/Desktop/MTH 250/Drug3.csv") %>%
  mutate(State=factor(State)) %>%
  as.data.frame()
str(drug)

mw<- filter(drug, State %in% c("Minnesota","Michigan", "Iowa", "Illinois", "Wisconsin"))%>%
  mutate(State=factor(State))
str(mw)

My theme

theme_markia <- theme_bw()+
  theme(plot.caption = element_text(color="white"),
    plot.subtitle = element_text(color="white"),
    plot.title=element_text(color="white"),
    strip.background=element_rect(fill="black",color="gray50"),
        strip.text=element_text(color="white",size=8),
    panel.background=element_rect( fill="gray10"),
    plot.background=element_rect( fill="gray10", color="white"),
    strip.text.y = element_blank(),
    panel.grid.major=element_line(color="gray30",linetype="dashed"),
    panel.grid.minor=element_line(color="gray30",linetype="dotted"),
    axis.text=element_text(color="white"),                                axis.title.x=element_text(color="white",face="bold"),
    axis.title.y=element_text(color="white",face="bold"),
    legend.background=element_rect(fill="gray10"),
    legend.text=element_text(color="white"),
    legend.title=element_text(color="white"),
    legend.key.size=unit(4,"mm"),
    legend.key=element_rect(fill="gray10",color="gray10"),
    legend.position = "top")

Wages in Ashland

For this data I was looking at how the wages of different occupations over the years differs among men and women. Obviously there were many occupations that were missing within this data, but the reason I mostly was interested in this data is because I plan on staying in Ashland to teach hopefully at the middle school and so I wanted to see how the wages of a middle school teacher differed between other occupations in this area.

w<- ggplot(data=wage, mapping=aes(x=Year, y=Average.Wage,                        fill=Detailed.Occupation)) +
          geom_bar(stat="identity", color="black", alpha=.75)+
         facet_grid(rows=vars(Detailed.Occupation), 
                    cols=vars(Gender))+
         scale_x_continuous(name="Year", 
                            breaks=seq(2014,2017,2))+
         scale_y_continuous(name="Average Wage", 
                          expand=expansion(mult=c(0,0.01)),      
                          labels=scales::dollar)+
         labs(fill="Occupation") +
         labs(title="Wages in Ashland Wisconsin from 2014-2017",  
              subtitle="By: Markia Smith",  
              caption="Source:https://datausa.io/profile/geo/ashland-w                        i",   
              x=element_blank(),y=element_blank())+
          guides(fill = guide_legend(nrow = 3))+
          theme_markia
w

What I found was kind of what I would have expected was that typically men do make more than women in most of the occupations, the only one being teachers as they make roughly the same way. It also was what I was kind of expecting in that teachers were right around the middle ground of being paid. They were not making as much as other occupations but were not the least paid. An interesting think that I noticed was that the wages have been pretty stagnate during this time with cashiers have a little increase but the other remaining about the same. I chose to use a facet my data because I really wanted to look at wasges over a time period while also looking at the difference between men and women, while also looking at how they differed between occupations. The conclusions that I did make couldve been made through make many different graphs but it was nice to be able to look at one graph and make many conclusions about it. I also chose to have a whole differnt chunk for my theme because I had a lot going on and so by having a seperate chunk for it and calling it a new name it was easy to keep track of my data and manipulate the theme as I went until I liked it. I chose a bar graph because it allowed me to look and see and compare visually the size difference for each one to see how much it increased and compared to others how large or small it was.