The objective of this assignment is to conduct an exploratory data analysis of a data set that you are not familiar with. In this week’s lecture, we discussed a number of visualization approaches in order to explore a data set with categorical variables. This assignment will apply those tools and techniques. An important distinction between class examples and applied data science work is iterative and repetitive nature of exploring a data set. It takes time to understand what the data is and what is interesting about the data (patterns).
For this week, we will be exploring the Copenhagen Housing Conditions Survey:
Your task for this assignment is to use ggplot and the facet_grid and facet_wrap functions to explore the Copenhagen Housing Conditions Survey. Your objective is to develop 5 report quality visualizations (at least 4 of the visualizations should use the facet_wrap or facet_grid functions) and identify interesting patterns and trends within the data that may be indicative of large scale trends. For each visualization you need to write a few sentences about the trends and patterns that you discover from the visualization.
To submit this homework you will create the document in Rstudio, using the knitr package (button included in Rstudio) and then submit the document to your Rpubs account. Once uploaded you will submit the link to that document on Canvas. Please make sure that this link is hyperlinked and that I can see the visualization and the code required to create it.
str(housing)
## 'data.frame': 72 obs. of 5 variables:
## $ Sat : Ord.factor w/ 3 levels "Low"<"Medium"<..: 1 2 3 1 2 3 1 2 3 1 ...
## $ Infl: Factor w/ 3 levels "Low","Medium",..: 1 1 1 2 2 2 3 3 3 1 ...
## $ Type: Factor w/ 4 levels "Tower","Apartment",..: 1 1 1 1 1 1 1 1 1 2 ...
## $ Cont: Factor w/ 2 levels "Low","High": 1 1 1 1 1 1 1 1 1 1 ...
## $ Freq: int 21 21 28 34 22 36 10 11 36 61 ...
view(housing)
ggplot(housing, aes(x= Sat, y = Freq, color = Infl)) + geom_point() + facet_wrap(~Infl)
We have plotted Satisfaction levels with perceived degree of influence householders have on the management of the property. In low influence and high influnce residents have low and high satisfaction respectively. In medium influnce section, we can see similar satisfaction across all categories. ## 2. Second plot
ggplot(housing, aes(x= Sat, y = Freq, color = Type)) + geom_point() + facet_wrap(~Type)
We have plotted satisfaction levels across different type of rental accomodation. Residnts in atrium have similar satisfaction across all levels whereas residents in apartment have high numbers in terms low and high satisfaction. ## 3. Third plot
ggplot(housing, aes(x= Type, y = Freq, color = Infl)) + geom_point() + facet_wrap(~Infl)
We have plotted type of accomodation with influence on property management. Residents living in Atrium have lowest number in terms of influence on property management as compared to people living in apartments. ## 4. Fourth plot
ggplot(housing, aes(x= Cont, y = Freq, color = Type)) + geom_point() + facet_wrap(~Type)
We have plotted contact residents afforded with other residents against type of accomodation. We can see high number of residnts in apartment under both categories low and high contact residents.
ggplot(housing, aes(x= Cont, y = Freq, color = Sat)) + geom_point() + facet_wrap(~Sat)
We have plotted contact residents against satisfaction level. We can see high number of contact residents with low and high satisfaction.
ggplot(housing, aes(Freq, fill = Type)) + geom_bar() + facet_wrap(~Type)
Summary; From the observations, we can see that apartment is a type of accomodation where number of residents with satisfaction levels are highest along with high influence on property management and contact residents. Influence of property management is signifanct on satisfaction levels among residents.