Objectives

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.

Look at the data

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 ...
head(housing)
##      Sat   Infl  Type Cont Freq
## 1    Low    Low Tower  Low   21
## 2 Medium    Low Tower  Low   21
## 3   High    Low Tower  Low   28
## 4    Low Medium Tower  Low   34
## 5 Medium Medium Tower  Low   22
## 6   High Medium Tower  Low   36

1. First plot

# place code for vis here
plot1=ggplot(housing,aes(x=Infl, y=Freq))+geom_point(shape=1)+facet_grid(rows=vars(Type))
plot1

# The first plot shows the relationship about influential impact on frequency. Perceived degree of influence householders do not have significant impact on the  the numbers of residents in each class. Residents with low influence on management have the highest numbers of residents in each class. Residents with Medium influence on management have the highest numbers of residents in each class.

2. Second plot

# place code for vis here
plot2=ggplot(housing,aes(x=Sat,y=Freq))+geom_point(shape=2)+facet_grid(Cont~.)
plot2

# The second plot shows the relationship about satisfaction of householders with their present housing circumstances and frequency. People with high satisfaction have more frequency of resident number. 

3. Third plot

# place code for vis here
plot3=ggplot(housing,aes(x=Cont,y=Freq))+geom_point(shape=1)+facet_wrap(~Type,ncol=2)
plot3

# We can see that both low and high contact residents that are afforded with other residents, Atrium housing type has the lowest numbers of residents in each class,and Apartment housing type has the highest numbers of residents in each class. 

4. Fourth plot

# place code for vis here
plot4=ggplot(housing,aes(x=Type,y=Freq))+geom_point(shape=1)+facet_wrap(vars(Sat))
plot4

# Apartment type have highest satification of residents. People have high satisfication have higher frequency. This shows the housing satisfaction by type on Frequency.

5. Fifth plot

# place code for vis here
plot5=ggplot(housing,aes(x=Sat,y=Freq))+geom_point(shape=2)+facet_grid(Infl~.)
plot5

#This plot shows that low satisfaction rate tend to have low frequency. Medium & High satisfaction tend to have high frequency.