Week 1 Analysis

# This gray area is called an "R-chunk". 
# These library commands install some powerful functions for your use later on.
library(mosaic)
library(pander)
library(tidyverse)
library(DT) 

# This read_csv command reads in the "Rent" data set into an object called "Rent"
Rent <- read_csv("../Data/Rent.csv")

# To load this data set into your R-Console do the following:
#  1. From your top file menu select "Session -> Set Working Directory -> To Source File Location"
#  2. Press the green "play button" in the top right corner of this gray box (which is called an "R-chunk").
#  3. Then in your "Console" window of 


Background

Here is a data table showing the available approved housing apartment options at BYU-Idaho for single students. There are 122 entries comprising 57 female and 65 male apartment options.

# Code to get you started. 
# View(...) works great in the Console, but datatable(...) must be
# used instead within an R-chunk.
datatable(Rent, options=list(lengthMenu = c(3,10,30)), extensions="Responsive")

Graphic

plot(Price ~ MilesToCampus, data=Rent, xlab="Miles to Campus", ylab="Price", main="Distance and Price of Rexburg Approved Housing", col="turquoise", pch=16)

The scatter plot above shows the comparison of the price of rent and the miles to campus. We are able to view a certain distance and also see what the price is for that distance. There doesn’t seem to be a trend on the scatter plot, however we can see that the apartments that are .7 miles or more are less expensive than most of the apartments. We can also conclude, that the distances of .1, .2, and .3 miles do have some of the more expensive prices.

\[\\[.25in]\]

Numerical

Mean, minimum and maximum of prices

mean(Rent$Price, na.rm=TRUE)
## [1] 1132.733
min(Rent$Price, na.rm=TRUE)
## [1] 850
max(Rent$Price, na.rm=TRUE)
## [1] 1585

\[\\[.25in]\]

Mean, minimum and maximum of miles to campus.

mean(Rent$MilesToCampus, na.rm=TRUE)
## [1] 0.3006725
min(Rent$MilesToCampus, na.rm=TRUE)
## [1] 0.06213727
max(Rent$MilesToCampus, na.rm=TRUE)
## [1] 0.7456473


We are seeing here that the average price is approximately $1132.73 per semester, with the average distance to campus being approximately .301 miles. We can also see the minimum and maximum prices and distances above.

Conclusion

In conclusion, I have to say, I was hoping there would be more of a trend in the prices and distance. I hypothesized that the apartments that were farther from campus would be less expensive, with the apartments that are closer, being more expensive. As we can see from looking at the scatter plot, there is quite a variance in price and distance. There are a few outliers of closer apartments being more expensive and farther apartments being less expensive.