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
140000 = Upper Middle Class
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.
library(readr)
ahs <- read_csv("C:/Users/RArev/Desktop/household.csv")
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 <- g1 + geom_bar(stat = "identity", position = position_dodge(), colour = "gray") + labs(title = "Rent based on Education Soreted by Sex")
graph.1
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 <- g3 + geom_bar(stat = "identity", position = position_dodge(), colour = "blue") + labs(title = "Rent based on Income Class Sorted by Education")
graph.3
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 <- g5 + geom_bar(stat = "identity", position = position_dodge(), colour = "blue") + labs(title = "Rent based on Sex Sorted by Income Class")
graph.5
graph.6 <- g6 + geom_bar(stat = "identity", position = position_dodge(), colour = "blue") + labs(title = "Rent based on Education Sorted by Income Class")
graph.6