The Data

The data being used this week is the American Housing Survey from 2015 (AHS), a continuation from previous assignments. The primary focus for this weeks assignemt is presenting data visualiztion for rent differences between the following variables: 1. HHGENDER = Sex 2. HHGRAD = Education 3. HINC = Income Class

The variables were each renamed and recoded into categories: 1. Sex a. 1 = Male b. 2 = Female

  1. HHGRAD
  1. 35 = Elementary Education
  2. 36 - 43 = Secondart Education
  3. 44 = Bachelors
  4. 45 = Masters
  5. 46 - 47 = PhD/Professional Degree
  1. HINC
  1. <25000 = Poverty
  2. 25000 - 45000 = Working Class
  3. 45000 - 140000 = Middle Class
  4. 140000 = Upper Middle Class

Hypothesis

Based on these varaibles, I hypothesize that males with high education and high income classes will have the higher rent expenses when compared to females and those with lower education/income classes.

Importing Data

library(readr)
ahs <- read_csv("C:/Users/RArev/Desktop/household.csv")

Graphing

library(ggplot2)
g1 <- ggplot(data3, mapping=aes(x=Edu, y=Rent, fill=Sex))
g2 <-  ggplot(data3, mapping=aes(x=Income.Class, y=Rent, fill=Sex))
g3 <-  ggplot(data3, mapping=aes(x=Income.Class, y=Rent, fill=Edu))
g4 <- ggplot(data3, mapping=aes(x=Sex, y=Rent, fill=Edu))
g5 <- ggplot(data3, mapping=aes(x=Sex, y=Rent, fill=Income.Class))
g6 <- ggplot(data3, mapping=aes(x=Edu, y=Rent, fill=Income.Class))

Graph 1 - Rent Based on Education Sorted by Sex

graph.1 <- g1 + geom_bar(stat = "identity", position = position_dodge(), colour = "gray") + labs(title = "Rent based on Education Soreted by Sex")
graph.1

Graph 2 - Rent Based on Income Class sorted by Gender

graph.2 <- g2 + geom_bar(stat = "identity", position = position_dodge(), colour = "blue") + labs(title = "Rent based on Income Class Sorted by Sex")
graph.2

Graph 3 - Rent Based on Income Class sorted by Education

graph.3 <- g3 + geom_bar(stat = "identity", position = position_dodge(), colour = "blue") + labs(title = "Rent based on Income Class Sorted by Education")
graph.3

Graph 4 - Rent Based on Sex sorted by Education

graph.4 <- g4 + geom_bar(stat = "identity", position = position_dodge(), colour = "blue") + labs(title = "Rent based on Sex Sorted by Education")
graph.4

Graph 5 - Rent Based on Sex sorted by Income Class

graph.5 <- g5 + geom_bar(stat = "identity", position = position_dodge(), colour = "blue") + labs(title = "Rent based on Sex Sorted by Income Class")
graph.5

Graph 6 - Rent Based on Education sroted by Income Class

graph.6 <- g6 + geom_bar(stat = "identity", position = position_dodge(), colour = "blue") + labs(title = "Rent based on Education Sorted by Income Class")
graph.6