library(mosaic)
## Loading required package: dplyr
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## Loading required package: lattice
## Loading required package: ggformula
## Loading required package: ggplot2
## 
## New to ggformula?  Try the tutorials: 
##  learnr::run_tutorial("introduction", package = "ggformula")
##  learnr::run_tutorial("refining", package = "ggformula")
## Loading required package: mosaicData
## Loading required package: Matrix
## 
## The 'mosaic' package masks several functions from core packages in order to add 
## additional features.  The original behavior of these functions should not be affected by this.
## 
## Note: If you use the Matrix package, be sure to load it BEFORE loading mosaic.
## 
## Attaching package: 'mosaic'
## The following object is masked from 'package:Matrix':
## 
##     mean
## The following objects are masked from 'package:dplyr':
## 
##     count, do, tally
## The following objects are masked from 'package:stats':
## 
##     binom.test, cor, cor.test, cov, fivenum, IQR, median,
##     prop.test, quantile, sd, t.test, var
## The following objects are masked from 'package:base':
## 
##     max, mean, min, prod, range, sample, sum
library(DT) # If you get an error stating: 
            # Error in library(DT): there is no package called 'DT'
            # You will need to run: install.packages("DT") 
            # in your Console, then try "Knit HTML" again.
Rent <- read.csv("../Data/Rent.csv", header=TRUE)

install.packages(“DT”)


Background

Stephanie1 is a student that will be starting school at BYU-Idaho next semester. Here is a copy of the email request for information that she sent.

“Hi. My name is Stephanie. I would like to learn about what housing options I have for living at BYU-Idaho next semester. It will be my first semester there, so I would like to find something that is close to campus and around $300 a month in rent. I’m not too picky on roomates, but I would like somewhere that has a lot of people around so I can get to know as many people as possible. Thanks in advance!”

Use the data from the BYU-Idaho Housing Website to prepare an Analysis that will answer Stephanie’s questions and give her some recommendations on a few apartments that best meet her criterions above. However, also be sure to demonstrate all of her options to her.

For your convenience, the first three observations of a dataset pulled from the BYUI website are shown in the following table. There are a total of 122 observations in the dataset.

datatable(Rent, options=list(lengthMenu = c(3,10,30)))

Analysis

The question is whether or not there is an apartment that fits everything that Stephanie wants. My hypotheses is that there will be a place that fits all of Stephanie’s wants. The below scaterplot shows the appartments that would be work for Stephanie. All of the points are apartments for women, have relatively low costs and have at least 5 people living in the appartment complex.Birch Wood, the red dot, is the lowest cost and has a lot of people living there which is something that Stephanie mentioned that she would like.

Rent2 <- subset(Rent, Gender=="F"& Cost<="1100"& Residents>="4")
plot(Residents~Cost, data=Rent2, xlab="Cost of a Semester in Dollars", ylab="Number of Residents", main="BYU-Idaho Women Housing Options", pch=19, col=c("black","black","black","red"))

Looking further into Birch Wood it in the table it is only a 1 minute walking distance from campus

Interpretation

Although there are a few options that fit the criteria that Stephanie mentioned the best choice is Birch Wood because it is close to campus, low cost and has a lot of people living there.


  1. Note that Stephanie is a fictional character who is based on real experiences of many faculty and staff here at BYU-Idaho.