Nely Niawati (s3757886), Kathleen Magbual (s3768288), Karen Gonzalez (s3697003)
Last updated: 31 May, 2019
An online version of the report can be found published in RPub.
Comparison of Airbnb entire apartment prices in Fitzroy and St. Kilda
setwd("C:/Users/karen/OneDrive/Documents/MC242/Intro to Statistics/Assignments/A3")
airbnb <- read_excel("airbnb.xlsx")
head(airbnb)# Set variable "suburb"" as factor ( )
airbnb$suburb <- airbnb$suburb %>% factor(levels=c("Fitzroy", "St Kilda"))
airbnb# Descriptive Statistics
desc_stats <- airbnb %>% group_by(suburb) %>% summarise(Min = min(price,na.rm = TRUE),
Q1 = quantile(price,probs = .25,na.rm = TRUE),
Median = median(price, na.rm = TRUE),
Q3 = quantile(price,probs = .75,na.rm = TRUE),
IQR = IQR(price, na.rm=TRUE),
Max = max(price,na.rm = TRUE),
Mean = mean(price, na.rm = TRUE),
SD = sd(price, na.rm = TRUE),
n = n(),
Missing = sum(is.na(price)))
kable(desc_stats)| suburb | Min | Q1 | Median | Q3 | IQR | Max | Mean | SD | n | Missing |
|---|---|---|---|---|---|---|---|---|---|---|
| Fitzroy | 64 | 100 | 129 | 150 | 50 | 695 | 146.3655 | 85.82725 | 145 | 0 |
| St Kilda | 62 | 107 | 130 | 174 | 67 | 450 | 146.2552 | 60.43152 | 145 | 0 |
# Box-plot:
boxplot(price ~ suburb, data = airbnb, ylab = "Suburb", xlab="Daily Price of an Entire Apartment",
main = "Entire Apartment Daily Price Comparison", horizontal = TRUE)We selected Two-sample Independent T-test because we wanted to compare the daily prices of two independent suburbs
Hypotheses for two samples:
\[H_0: \mu_1 = \mu_2 (\mu_1 - \mu_2 = 0)\]
\[H_A: \mu_1 \ne \mu_2 (\mu_1 - \mu_2 \ne 0)\]
airbnb_fitzroy <- airbnb %>% filter(suburb == "Fitzroy")
airbnb_fitzroy$price %>% qqPlot(dist="norm")## [1] 69 82
airbnb_sk <- airbnb %>% filter(suburb == "St Kilda")
airbnb_sk$price %>% qqPlot(dist="norm")## [1] 42 121
\[H_0: \sigma_1^2 = \sigma_2^2 \]
\[H_A: \sigma_1^2 \ne \sigma_2^2 \]
leveneTest(price ~ suburb, data=airbnb)result <- t.test(price ~ suburb,
data = airbnb,
var.equal = TRUE,
alternative = "two.sided"
)
result##
## Two Sample t-test
##
## data: price by suburb
## t = 0.012658, df = 288, p-value = 0.9899
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -17.04700 17.26769
## sample estimates:
## mean in group Fitzroy mean in group St Kilda
## 146.3655 146.2552
Based on the Two Sample Independent T-test the decision is fail to reject the null hypothesis \(H_0: \mu_1 = \mu_2 (\mu_1 - \mu_2 = 0)\) or Average Daily Price of Fitzroy’s Airbnb = Average Daily Price of St. Kilda’s Airbnb.
As p (0.9899) > 0.05, and the 95% CI [-17.04700 17.26769] captures the H0 = 0. Thus, the results of the test found no statistical significance on the comparison between mean prices of Airbnbs in Fitzroy and St. Kilda respectively.
As mentioned earlier, the Airbnb data was preprocessed and filtered into two popular Melbourne suburbs which is Fitzroy and St. Kilda. It was also narrowed down to renting enitre Apartments only instead of a Private Room or Shared Room.
However there were some limitations in the given dataset that could be improved for future investigations, a bigger sample size could give a more accurate mean price comparison between the two. In addition, the data was only for June and July 2018, a longer date range could possibly give a more accurate mean price of the Apartments depending on Seasonality/peak or off seasons.
Once again, based on the Two Sample Independent T-test there was no statistical significance between the Average daily price of Fitzroy and St.Kilda Airbnb.