Hypothesis

The probability of a building being owned increases as the rentable square footage of a building increases

Null hypothesis

The rentable square footage does not affect the probability of a building being owned.

Question 1

I chose to graph the “building rentable square feet” column in the dataset with a histogram so that the frequency of the physical sizes of each building in the dataset could be visually seen. The column had some large numbers so I decided to use the base 10 logarithm of each number so that the histogram was not skewed to one side. The graph shows that most of the buildings are in the 5,000s and 10,000s range of square feet with the mean being 4.09 or 45324 sq ft. There are more buildings in the dataset that are larger than 10,000 sq ft than there are buildings that are less than 10,000 sq ft. This could affect the hypothesis since most of the buildings in the dataset are similar in size and there could potentially be no distinguishable difference between a building’s size and their ownership.

 GSA <- read.csv("GSA-Buildings.csv")

 hist(log10(GSA$Building.Rentable.Square.Feet),
     main = "log10(x) of rentable square footage in all GSA buildings", 
     xlab = "10^x sq ft", 
     ylab = "Frequency",
     col = "blue")
## Warning in hist(log10(GSA$Building.Rentable.Square.Feet), main = "log10(x) of
## rentable square footage in all GSA buildings", : NaNs produced
 mean(GSA$Building.Rentable.Square.Feet)
## [1] 45324.73
 mean(log10(GSA$Building.Rentable.Square.Feet[GSA$Building.Rentable.Square.Feet > 0]), na.rm = TRUE)
## [1] 4.094102
 abline(v = mean(log10(GSA$Building.Rentable.Square.Feet[GSA$Building.Rentable.Square.Feet > 0]), na.rm = TRUE), col = "red", lwd = 2)
 
text(x = mean(log10(GSA$Building.Rentable.Square.Feet[GSA$Building.Rentable.Square.Feet > 0]), na.rm = TRUE), y = 200, labels = "Mean = 4.09 or 45324 sq ft", col = "red", pos = 4)

Question 2

I decided to split my data into two datasets where the buildings are owned called “GSAOwned” and where the buildings are leased called “GSALeased”. With these new datasets I could calculate the average rentable square footage of the leased and owned buildings and see if larger buildings tend to be owned or leased. After finding each mean, the average rentable square footage for the buildings that were owned was 109659 and the average for the buildings that were leased was 27598. This supports my hypothesis because the data suggests that larger buildings may be more likely to be owned since the average size is much greater in the dataset where the buildings are owned than in the dataset where buildings are leased.

GSAOwned <- GSA[GSA$Owned.or.Leased == "OWNED",]
GSALeased <- GSA[GSA$Owned.or.Leased == "LEASED",]
mean(GSAOwned$Building.Rentable.Square.Feet)
## [1] 109659.9
mean(GSALeased$Building.Rentable.Square.Feet)
## [1] 27598.23

Question 3

Since the “Owned or Leased” column is categorical I first had to convert the two options into a binary variable so that “OWNED” became 1 and “LEASED” became 0. Then I ran a linear regression model and found out that the R squared value was 0.07045 which means that the rentable square footage explains about 7.045% percent of the variation in ownership status. The p-value was < 2.2 x 10^-16 which is extremely small and suggests that the results are statistically significant and that a relationship between the rentable square footage and ownership status exists. The coefficient is 8.585 x 10^-7 which is positive and it can be seen in the scatter plot since the regression line is going upwards towards “Owned” as the rentable square footage of a building increases. This supports my hypothesis that a building is more likely to be owned as the rentable square footage increases because of the positive regression line.

GSA$Owned_Binary <- ifelse(GSA$Owned.or.Leased == "OWNED", 1, 0)
 
model <- lm(Owned_Binary ~ GSA$Building.Rentable.Square.Feet, data = GSA)
 
summary(model)
## 
## Call:
## lm(formula = Owned_Binary ~ GSA$Building.Rentable.Square.Feet, 
##     data = GSA)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -1.5709 -0.1923 -0.1831 -0.1780  0.8229 
## 
## Coefficients:
##                                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                       1.771e-01  4.779e-03   37.05   <2e-16 ***
## GSA$Building.Rentable.Square.Feet 8.585e-07  3.539e-08   24.26   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.3968 on 7766 degrees of freedom
## Multiple R-squared:  0.07045,    Adjusted R-squared:  0.07033 
## F-statistic: 588.6 on 1 and 7766 DF,  p-value: < 2.2e-16
plot(GSA$Building.Rentable.Square.Feet,
     GSA$Owned_Binary,
     main = "Rentable Square Feet vs. Building Ownership",
     xlab = "Rentable Square Feet",
     ylab = "Ownership (0 = Leased, 1 = Owned)")

abline(model)

Question 4

I wanted to check the “Building Rentable Square Feet” column where the buildings are owned in the GSAOwned dataset and where the buildings are leased in the GSALeased dataset. By plotting the histogram of this column it will visually show the ownership status of a building and how it relates to its size. There are less owned buildings than leased buildings so the frequencies varied between each histogram. Both histograms were skewed left and had higher frequencies around the 100,000 square footage range, but the GSALeased dataset had way more in that area than the GSAOwned dataset. These results suggest that leased buildings have smaller average rentable square footage since most of the data is close to 0 than to the first bin of the histogram. The GSAOwned dataset had better distributed data but was still close to the smaller ranges.

hist(GSAOwned$Building.Rentable.Square.Feet,
     main = "Rentable Square Footage of Owned Buildings", 
     xlab = "sq ft", 
     ylab = "Frequency",
     col = "green")

abline(v = mean(GSAOwned$Building.Rentable.Square.Feet, na.rm = TRUE), col = "red", lwd = 2)
 
text(x = mean(GSAOwned$Building.Rentable.Square.Feet, na.rm = TRUE), y = 200, labels = "Mean = 109659.9" , col = "red", pos = 4)

hist(GSALeased$Building.Rentable.Square.Feet,
     main = "Rentable Square Footage of Leased Buildings", 
     xlab = "sq ft", 
     ylab = "Frequency",
     col = "orange")

abline(v = mean(GSALeased$Building.Rentable.Square.Feet, na.rm = TRUE), col = "red", lwd = 2)
 
text(x = mean(GSALeased$Building.Rentable.Square.Feet, na.rm = TRUE), y = 1000, labels = "Mean = 27598.23" , col = "red", pos = 4)

Question 5

I chose to use the “owned or leased” column again and split the data into a group where the buildings are owned and a group where the buildings are leased. I then conducted a two sample t-test to determine if there was a large difference in the average rentable square footage between the two groups. The results showed that the average rentable square footage was 109,659.89 for owned buildings and 27,598.23 for leased buildings. The t-value was 14.391 with 1775.8 degrees of freedom and a p-value of <2.2 x 10^-16. This means that there is a statistically significant difference in rentable square footage between buildings that are leased and buildings that are owned. On average, buildings that are owned tend to have more rentable square footage.

t.test(GSAOwned$Building.Rentable.Square.Feet,
       GSALeased$Building.Rentable.Square.Feet)
## 
##  Welch Two Sample t-test
## 
## data:  GSAOwned$Building.Rentable.Square.Feet and GSALeased$Building.Rentable.Square.Feet
## t = 14.391, df = 1755.8, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  70877.31 93246.01
## sample estimates:
## mean of x mean of y 
## 109659.89  27598.23