Brandon Heng S3987154
Last updated: 25 May, 2024
Melbourne’s real estate market has seen significant fluctuations over the years. Understanding the house price by region is critical for both potential buyers and investors.
In Melbourne or Victoria as a whole, the media consistently encourages people to relocate to the west due to more affordable properties (Kinsella 2022). This motivated me to examine the differences in house prices in Melbourne and Victoria between the western and eastern regions.
Also, as common sense says, the further the house is from CBD, the cheaper the price. This also motivates me to investigate whether the distance from CBD has a linear relationship with the house price.
This report uses the Melbourne Housing dataset, which provides information about each house sale across Melbourne and Victoria’s regions (Pino 2016).
Finally, the report will discuss the tests and the inferences drawn from them.
Summary statistics, histograms, and box plots are shown for the price, distance, and price of the western and eastern regions.
Missing values and outliers are removed to improve the accuracy of the analysis.
In the analysis, a two-sample t-test is performed to find out whether the means of house prices in the western and eastern regions are different.
The visual normality check is done by the Q-Q plot, and homogeneity of variance is checked by Levene’s test on the price of the western and eastern regions.
For the distance from CBD, a linear regression model is generated. This checks whether distance follows a linear relationship with price.
In the dataset, there are 21 columns. However, for the analysis, only four columns are needed:
Address: The address of each sale property. It is unique to each property listed in the dataset (CHARACTER).
Regionname: General region name in Melbourne [Northern Metropolitan, Western Metropolitan, Southern Metropolitan, Eastern Metropolitan, South-Eastern Metropolitan, Eastern Victoria, Northern Victoria, Western Victoria] (FACTOR)
Distance: Distance of property to Melbourne CBD in kilometer(km) (NUMERIC)
Price: Price of the property in Australian dollars (NUMERIC)
## [1] "Suburb" "Address" "Rooms" "Type"
## [5] "Price" "Method" "SellerG" "Date"
## [9] "Distance" "Postcode" "Bedroom2" "Bathroom"
## [13] "Car" "Landsize" "BuildingArea" "YearBuilt"
## [17] "CouncilArea" "Lattitude" "Longtitude" "Regionname"
## [21] "Propertycount"
| Suburb | Address | Rooms | Type | Price | Method | SellerG | Date | Distance | Postcode | Bedroom2 | Bathroom | Car | Landsize | BuildingArea | YearBuilt | CouncilArea | Lattitude | Longtitude | Regionname | Propertycount |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Abbotsford | 68 Studley St | 2 | h | NA | SS | Jellis | 3/09/2016 | 2.5 | 3067 | 2 | 1 | 1 | 126 | NA | NA | Yarra City Council | -37.8014 | 144.9958 | Northern Metropolitan | 4019 |
| Abbotsford | 85 Turner St | 2 | h | 1480000 | S | Biggin | 3/12/2016 | 2.5 | 3067 | 2 | 1 | 1 | 202 | NA | NA | Yarra City Council | -37.7996 | 144.9984 | Northern Metropolitan | 4019 |
| Abbotsford | 25 Bloomburg St | 2 | h | 1035000 | S | Biggin | 4/02/2016 | 2.5 | 3067 | 2 | 1 | 0 | 156 | 79 | 1900 | Yarra City Council | -37.8079 | 144.9934 | Northern Metropolitan | 4019 |
| Abbotsford | 18/659 Victoria St | 3 | u | NA | VB | Rounds | 4/02/2016 | 2.5 | 3067 | 3 | 2 | 1 | 0 | NA | NA | Yarra City Council | -37.8114 | 145.0116 | Northern Metropolitan | 4019 |
| Abbotsford | 5 Charles St | 3 | h | 1465000 | SP | Biggin | 4/03/2017 | 2.5 | 3067 | 3 | 2 | 0 | 134 | 150 | 1900 | Yarra City Council | -37.8093 | 144.9944 | Northern Metropolitan | 4019 |
| Abbotsford | 40 Federation La | 3 | h | 850000 | PI | Biggin | 4/03/2017 | 2.5 | 3067 | 3 | 2 | 1 | 94 | NA | NA | Yarra City Council | -37.7969 | 144.9969 | Northern Metropolitan | 4019 |
| Abbotsford | 55a Park St | 4 | h | 1600000 | VB | Nelson | 4/06/2016 | 2.5 | 3067 | 3 | 1 | 2 | 120 | 142 | 2014 | Yarra City Council | -37.8072 | 144.9941 | Northern Metropolitan | 4019 |
| Abbotsford | 16 Maugie St | 4 | h | NA | SN | Nelson | 6/08/2016 | 2.5 | 3067 | 3 | 2 | 2 | 400 | 220 | 2006 | Yarra City Council | -37.7965 | 144.9965 | Northern Metropolitan | 4019 |
| Abbotsford | 53 Turner St | 2 | h | NA | S | Biggin | 6/08/2016 | 2.5 | 3067 | 4 | 1 | 2 | 201 | NA | 1900 | Yarra City Council | -37.7995 | 144.9974 | Northern Metropolitan | 4019 |
| Abbotsford | 99 Turner St | 2 | h | NA | S | Collins | 6/08/2016 | 2.5 | 3067 | 3 | 2 | 1 | 202 | NA | 1900 | Yarra City Council | -37.7996 | 144.9989 | Northern Metropolitan | 4019 |
mel_house_prices <- mel_house_prices %>% select(Address, Regionname, Distance, Price)
head(mel_house_prices)cleaned_mel_house_prices <- mel_house_prices
cleaned_mel_house_prices$Regionname <- mel_house_prices$Regionname %>% factor(
levels = c("Northern Metropolitan", "Western Metropolitan", "Southern Metropolitan", "Eastern Metropolitan", "South-Eastern Metropolitan", "Eastern Victoria", "Northern Victoria", "Western Victoria"))
str(cleaned_mel_house_prices)## tibble [34,857 × 4] (S3: tbl_df/tbl/data.frame)
## $ Address : chr [1:34857] "68 Studley St" "85 Turner St" "25 Bloomburg St" "18/659 Victoria St" ...
## $ Regionname: Factor w/ 8 levels "Northern Metropolitan",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ Distance : num [1:34857] 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 ...
## $ Price : num [1:34857] NA 1480000 1035000 NA 1465000 ...
## Address Regionname Distance Price
## Length:34857 Length:34857 Min. : 0.00 Min. : 85000
## Class :character Class :character 1st Qu.: 6.40 1st Qu.: 635000
## Mode :character Mode :character Median :10.30 Median : 870000
## Mean :11.18 Mean : 1050173
## 3rd Qu.:14.00 3rd Qu.: 1295000
## Max. :48.10 Max. :11200000
## NA's :1 NA's :7610
price_sta <- cleaned_mel_house_prices %>% summarise(Min = min(Price,na.rm = TRUE),
Q1 = quantile(Price,probs = .25,na.rm = TRUE),
Median = median(Price, na.rm = TRUE),
Q3 = round(quantile(Price,probs = .75,na.rm = TRUE),2),
IQR = IQR(Price, na.rm = TRUE),
Max = max(Price,na.rm = TRUE),
Mean = round(mean(Price, na.rm = TRUE),2),
SD = round(sd(Price, na.rm = TRUE),2),
n = n(),
Missing = sum(is.na(Price)))
knitr::kable(price_sta)| Min | Q1 | Median | Q3 | IQR | Max | Mean | SD | n | Missing |
|---|---|---|---|---|---|---|---|---|---|
| 85000 | 635000 | 870000 | 1295000 | 660000 | 11200000 | 1050173 | 641467.1 | 34857 | 7610 |
price_mean <- mean(cleaned_mel_house_prices$Price, na.rm = TRUE)
price_his_plot <- ggplot(cleaned_mel_house_prices, aes(x = Price)) +
geom_histogram(fill = "blue", color = "white", bins = 30) +
geom_vline(aes(xintercept = price_mean), color = "red", linetype = "dashed", size = 1) +
annotate("text", x = price_mean, y = Inf, label = paste("Mean:", round(price_mean, 2)), vjust = 1.5, hjust = -0.1, color = "red") +
labs(x = "Price", y = "Frequency") +
scale_x_continuous(labels = label_comma())
annotate_figure(price_his_plot, bottom=text_grob("Figure 1. Histogram of prices", face = "bold", size = 14))distance_sta <- cleaned_mel_house_prices %>% summarise(Min = min(Distance,na.rm = TRUE),
Q1 = quantile(Distance,probs = .25,na.rm = TRUE),
Median = median(Distance, na.rm = TRUE),
Q3 = round(quantile(Distance,probs = .75,na.rm = TRUE),2),
IQR = IQR(Distance, na.rm = TRUE),
Max = max(Distance,na.rm = TRUE),
Mean = round(mean(Distance, na.rm = TRUE),2),
SD = round(sd(Distance, na.rm = TRUE),2),
n = n(),
Missing = sum(is.na(Distance)))
knitr::kable(distance_sta)| Min | Q1 | Median | Q3 | IQR | Max | Mean | SD | n | Missing |
|---|---|---|---|---|---|---|---|---|---|
| 0 | 6.4 | 10.3 | 14 | 7.6 | 48.1 | 11.18 | 6.79 | 34857 | 1 |
distance_mean <- mean(cleaned_mel_house_prices$Distance, na.rm = TRUE)
distance_his_plot <- ggplot(cleaned_mel_house_prices, aes(x = Distance)) +
geom_histogram(fill = "red", color = "white", bins = 30) +
geom_vline(aes(xintercept = distance_mean), color = "blue", linetype = "dashed", size = 1) +
annotate("text", x = distance_mean, y = Inf, label = paste("Mean:", round(distance_mean, 2)), vjust = 1.5, hjust = -0.1, color = "red") +
labs(x = "Distance", y = "Frequency") +
scale_x_continuous(labels = label_comma())
annotate_figure(distance_his_plot, bottom=text_grob("Figure 2. Histogram of distance", face = "bold", size = 14))cleaned_mel_house_prices <- mel_house_prices[!is.na(mel_house_prices$Price), ]
sum(is.na(cleaned_mel_house_prices$Price))## [1] 0
cleaned_mel_house_prices <- cleaned_mel_house_prices[!is.na(cleaned_mel_house_prices$Distance), ]
sum(is.na(cleaned_mel_house_prices$Distance))## [1] 0
b4_price_box_plot <- ggplot(cleaned_mel_house_prices, aes(y = Price)) +
geom_boxplot(fill = "dodgerblue3", color = "black", alpha = 0.7) +
scale_y_continuous(labels = label_comma()) +
labs(title = "Price", y = "House Price")
b4_distance_box_plot <- ggplot(cleaned_mel_house_prices, aes(y = Distance)) +
geom_boxplot(fill = "red", color = "black", alpha = 0.7) +
scale_y_continuous(labels = label_comma()) +
labs(title = "Distance", y = "Distance from CBD")
# Arrange the histograms side by side
annotate_figure(grid.arrange(b4_price_box_plot, b4_distance_box_plot, nrow = 1), bottom=text_grob("Figure 3. Box plot of price and distance before removing outliers", face = "bold", size = 14))cal_lower_upper_bound = function(x){
# Calculate Q1, Q3, and IQR
Q1 <- quantile(x, 0.25)
Q3 <- quantile(x, 0.75)
IQR <- Q3 - Q1
# Define lower and upper bounds
lower_bound <- Q1 - 1.5 * IQR
upper_bound <- Q3 + 1.5 * IQR
return(list(lower_bound = lower_bound, upper_bound = upper_bound))
}
is.outlier = function(x, lower_bound, upper_bound){(x < lower_bound)|(x > upper_bound)}price_boundary <- cal_lower_upper_bound(cleaned_mel_house_prices$Price)
print(sum(is.outlier(cleaned_mel_house_prices$Price, price_boundary$lower_bound, price_boundary$upper_bound)))## [1] 1278
distance_boundary <- cal_lower_upper_bound(cleaned_mel_house_prices$Distance)
print(sum(is.outlier(cleaned_mel_house_prices$Distance, distance_boundary$lower_bound, distance_boundary$upper_bound)))## [1] 1188
cleaned_mel_house_prices <- cleaned_mel_house_prices %>% filter(
Price >= price_boundary$lower_bound,
Price <= price_boundary$upper_bound,
Distance >= distance_boundary$lower_bound,
Distance <= distance_boundary$upper_bound
)af_price_box_plot <- ggplot(cleaned_mel_house_prices, aes(y = Price)) +
geom_boxplot(fill = "dodgerblue3", color = "black", alpha = 0.7) +
scale_y_continuous(labels = label_comma()) +
labs(title = "Price", y = "House Price")
af_distance_box_plot <- ggplot(cleaned_mel_house_prices, aes(y = Distance)) +
geom_boxplot(fill = "red", color = "black", alpha = 0.7) +
scale_y_continuous(labels = label_comma()) +
labs(title = "Distance", y = "Distance from CBD")
# Arrange the histograms side by side
annotate_figure(grid.arrange(af_price_box_plot, af_distance_box_plot, nrow = 1), bottom=text_grob("Figure 4. Box plot of price and distance after removing outliers", face = "bold", size = 14))# scatter plot
sctter_plot <- ggplot(cleaned_mel_house_prices, aes(x = Distance, y = Price)) +
geom_point(color = "blue", size = 0.1) +
geom_smooth(method = "lm", se = TRUE, color = "red") +
labs(title = "Scatter Plot of Distance and Price", x = "Distance", y = "Price") +
theme_minimal()
annotate_figure(grid.arrange(sctter_plot, nrow = 1), bottom=text_grob("Figure 5. Scatter Plot of Distance and Price", face = "bold", size = 14))This is a summary of the price statistics for properties in the western and eastern of Melbourn and Victoria.
Before showing the summary statistics, the regionname variable is filtered to include only the west and east regions of Melbourn and Victoria. Western Metropolitan and Western Victoria are one group and got renamed to West, and Eastern Metropolitan and Eastern Victoria are also one group and got renamed to East. The regionname factor become “west” and “east”.
west_east_mel_house_price <- cleaned_mel_house_prices[cleaned_mel_house_prices$Regionname %in% c("Western Metropolitan", "Eastern Metropolitan", "Eastern Victoria", "Western Victoria"), ]
west_east_mel_house_price <- west_east_mel_house_price %>%
mutate(Regionname = as.character(Regionname)) %>%
mutate(Regionname = if_else(Regionname == "Western Metropolitan" | Regionname == "Western Victoria", "west", "east"))
west_east_mel_house_price$Regionname <- west_east_mel_house_price$Regionname %>% factor(
levels = c("west", "east"))
str(west_east_mel_house_price)## tibble [8,732 × 4] (S3: tbl_df/tbl/data.frame)
## $ Address : chr [1:8732] "154 Halsey Rd" "50 Bedford St" "50 Bedford St" "23 Hart St" ...
## $ Regionname: Factor w/ 2 levels "west","east": 1 1 1 1 1 1 1 1 1 1 ...
## $ Distance : num [1:8732] 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 13.5 ...
## $ Price : num [1:8732] 840000 730000 770000 603000 700000 ...
The average price of western region property is lower than that of eastern region property.
As the mean is higher than the median, both western and eastern regions property prices are positively skewed.
price_by_regions <- west_east_mel_house_price %>% group_by(Regionname) %>% summarise(Min = min(Price,na.rm = TRUE),
Q1 = quantile(Price,probs = .25,na.rm = TRUE),
Median = median(Price, na.rm = TRUE),
Q3 = round(quantile(Price,probs = .75,na.rm = TRUE),2),
IQR = IQR(Price, na.rm = TRUE),
Max = max(Price,na.rm = TRUE),
Mean = round(mean(Price, na.rm = TRUE),2),
SD = round(sd(Price, na.rm = TRUE),2),
n = n(),
Missing = sum(is.na(Price)))
knitr::kable(price_by_regions)| Regionname | Min | Q1 | Median | Q3 | IQR | Max | Mean | SD | n | Missing |
|---|---|---|---|---|---|---|---|---|---|---|
| west | 85000 | 597125 | 760000 | 986375 | 389250 | 2255000 | 833300.5 | 346228.4 | 5566 | 0 |
| east | 288000 | 800000 | 1005000 | 1300000 | 500000 | 2285000 | 1068211.1 | 361267.1 | 3166 | 0 |
west_mean <- mean(west_east_mel_house_price[west_east_mel_house_price$Regionname == "west",]$Price, na.rm = TRUE)
west_his_plot <- ggplot(west_east_mel_house_price[west_east_mel_house_price$Regionname == "west",], aes(x = Price)) +
geom_histogram(fill = "blue", color = "white", bins = 30) +
geom_vline(aes(xintercept = west_mean), color = "red", linetype = "dashed", size = 1) +
annotate("text", x = west_mean, y = Inf, label = paste("Mean:", round(west_mean, 2)), vjust = 1.5, hjust = -0.1, color = "red") +
labs(x = "Price", y = "Frequency") +
ggtitle("Western region")
east_mean <- mean(west_east_mel_house_price[west_east_mel_house_price$Regionname == "east",]$Price, na.rm = TRUE)
east_his_plot <- ggplot(west_east_mel_house_price[west_east_mel_house_price$Regionname == "east", ], aes(x = Price)) +
geom_histogram(fill = "red", color = "white", bins = 30) +
geom_vline(aes(xintercept = east_mean), color = "blue", linetype = "dashed", size = 1) +
annotate("text", x = east_mean, y = Inf, label = paste("Mean:", round(east_mean, 2)), vjust = 1.5, hjust = -0.1, color = "red") +
labs(x = "Price", y = "Frequency") +
ggtitle("Eastern region")
annotate_figure(grid.arrange(west_his_plot, east_his_plot, nrow = 1), bottom=text_grob("Figure 6. Histogram of prices for western and eastern region", face = "bold", size = 14))As shown in figure 7, the median price of eastern properties is higher than the median price of western properties.
The IQR of eastern properties’s prices is substantially higher than that of western properties’s prices. This further emphasizes the greater variability in prices for eastern properties compared to western properties.
west_median <- median(west_east_mel_house_price[west_east_mel_house_price$Regionname == "west",]$Price)
west_box_plot <- ggplot(west_east_mel_house_price[west_east_mel_house_price$Regionname == "west",], aes(y = Price)) +
geom_boxplot(fill = "dodgerblue3", color = "black", alpha = 0.7) +
annotate("text", x = Inf, y = west_median, label = paste("Median:", round(median(west_median), 2)), color = "black", hjust = 1.7, vjust = -1) +
scale_y_continuous(labels = label_comma()) +
labs(title = "Western region", y = "Price", x = "")
east_median <- median(west_east_mel_house_price[west_east_mel_house_price$Regionname == "east",]$Price)
east_box_plot <- ggplot(west_east_mel_house_price[west_east_mel_house_price$Regionname == "east",], aes(y = Price)) +
geom_boxplot(fill = "red", color = "black", alpha = 0.7) +
annotate("text", x = Inf, y = east_median, label = paste("Median:", round(median(east_median), 2)), color = "black", hjust = 1.7, vjust = -1) +
scale_y_continuous(labels = label_comma()) +
labs(title = "Eastern region", y = "Price", x = "")
annotate_figure(grid.arrange(west_box_plot, east_box_plot, nrow = 1), bottom=text_grob("Figure 7. Box plots of prices for western and eastern region", face = "bold", size = 14))To determine whether there is a statistical difference in house prices between properties in the western and eastern regions, a two-sample t-test is performed.
The \(\alpha = 0.05\) level of significance is used is this hypothesis testing.
H0: There is no statistically significant difference between the average price of properties in the western and eastern regions.
HA: There is a statistically significant difference between the average price of properties in the western and eastern regions.
\[H_0: \mu_1 = \mu_2 \]
\[H_A: \mu_1 \ne \mu_2\]
qq <- ggqqplot(west_east_mel_house_price, x="Price", facet.by = "Regionname")
annotate_figure(grid.arrange(qq, nrow = 1), bottom=text_grob("Figure 8. Normal Q-Q plot of west and east region properties's prices", face = "bold", size = 14))As shown in figure 8, both Q-Q plots do not follow a normal distribution since the distributions of both west and east region properties’s prices are positively skewed in figure 6.
However, because the large sample test sizes (west n = 5566, east n = 3166) are larger than 30, the Central Limit Theorem suggests that the sampling distribution of the mean will be approximately normal regardless of the distribution of the data. Therefore, we can proceed with the two-sample t-test.
t.test(
Price ~ Regionname,
data = west_east_mel_house_price,
var.equal = FALSE,
alternative = "two.sided"
)##
## Welch Two Sample t-test
##
## data: Price by Regionname
## t = -29.652, df = 6350.2, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group west and group east is not equal to 0
## 95 percent confidence interval:
## -250440.7 -219380.5
## sample estimates:
## mean in group west mean in group east
## 833300.5 1068211.1
The p-value method rejects \(H_0\) because \(p = 2.2 \cdot 10^{-16} < \alpha = 0.05\). There was a statistically significant difference between the means.
## [1] -234910.6
## [1] -1.960338
A linear regression is applied to the variables distance vs prices.
The null hypothesis states that there is no statistically significant linear relationship between distance and prices.
The alternate hypothesis states that there is statistically significant linear relationship between distance and prices.
The equation of the linear model is:. \[\hat{Y_i}= \hat{β_0}+\hat{β_1}X_i\]
## [1] -0.1364971
##
## Call:
## lm(formula = Price ~ Distance, data = .)
##
## Residuals:
## Min 1Q Median 3Q Max
## -950798 -314536 -94357 268677 1371442
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1086686 6169 176.15 <2e-16 ***
## Distance -11452 528 -21.69 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 431500 on 24779 degrees of freedom
## Multiple R-squared: 0.01863, Adjusted R-squared: 0.01859
## F-statistic: 470.4 on 1 and 24779 DF, p-value: < 2.2e-16
## 2.5 % 97.5 %
## (Intercept) 1074594.66 1098778.23
## Distance -12487.48 -10417.57
Before reporting the regression model, there are five assumptions for linear regression that have to be validated.
Independence: Independence was assumed because the distance and price data came from different houses sold.
Linearity: The residuals vs fitted graph shows a flat relationship between fitted value and residuals (look at the red line), suggesting a linear model for distance and price. Also, the scatter plot in Figure 5 and the observed negative correlation of about -0.13 show a weak linear relationship between the variables, i.e., distance increases but price slightly decreases.
Normality of residuals: Normal Q-Q plot show the deviations from normality. It is not safe to assume that the residuals are approximately normally distributed.
Influential cases: The residual vs leverage graph contains no points that are above Cook’s distance. Outliers do not have a significant impact.
Homoscedasticity: The residual vs. fitted graph shows homoscedasticity, or consistent variance between the data. In addition, a straight line crosses across the middle, indicating that it fits the data.
The estimated average price when distance = 0 was 1086686 AUD.
The intercept of the regression was statistically significant as \(\hat{β_0} = 1086686, p = 2.2 \cdot 10^{-16} < 0.05\), and 95% CI (1074594.66 1098778.23).
For every one unit increase in distance (km), the house price was estimated to decrease on average by 11452 AUD.
The slope of the regression for price was statistically significant, \(\hat{β_1} = -11452, p = 2.2 \cdot 10^{-16} < 0.05\), 95% CI (-12487.48 -10417.57).
The estimated linear model can be defined as \(Price = 1086686 - 11452 * Distance\)
The linear model was statistically significant, F(1,24779) = 470.4, p < 0.05. However, the distance explained only 1.85 % of the variability in house price.
The results of the hypothesis test were therefore statistically significant. This indicates the rejection of the null hypothesis and the existence of a linear relationship between distance and prices.
However, since the correlation coefficient is -0.13 and the distance explained only 1.85% of the variability in house prices, the linear relationship between distance and prices is weak.
Moreover, the model fails to meet the assumption of normally distributed residuals, which means the linear regression model’s forecasts and confidence intervals may be inefficient, seriously biassed, or misleading.
The summary statistics show that the mean house price in western regions (833300.5 AUD) is lower than in eastern regions (1068211.1 AUD).
The two-samples t-test has been performed to check whether there is a statistically significant difference between the average house price of western regions and eastern regions.
The two-sample t-test has met the assumption of normality since the large sample and the Central Limit Theorem state that the sampling distribution of the mean is essentially normal regardless of data distribution. Also, it is not safe to assume equal variance as the p value of Levene’s test is less than 0.05.
Major finding: The two-sample t-test revealed a statistically significant difference in property prices between the western and eastern regions, as shown by a p-value of \(p = 2.2 \cdot 10^{-16} < \alpha = 0.05\), a 95% confidence interval that does not capture the mean difference (-234910.6) ranging from -250440.7 to -219380.5, and a test statistic of t = -29.65, which is more extreme than the t-critical value t* = -1.96.
Strength: The study benefits from large sample sizes (5566 properties in the western region and 3166 in the eastern region), enhancing reliability, and the use of Levene’s test, which ensured the appropriate t-test was used given the unequal variances.
Limitations: The non-normality of data, despite large sample sizes, could still influence results. Additionally, the study does not account for external factors like house sizes, the age of house or market trends that could impact prices.
Future Investigations: Explore how factors like property type, size, age, and proximity to amenities contribute to regional price differences. Also, track property price trends over time to understand how regional disparities evolve and identify underlying temporal patterns.
Conclusion: The result of hypothesis test I shows that there is a statistically significant difference between the average house price in western regions and eastern regions. The investigation suggests that the average house price in western regions is lower than in eastern regions, which is a reason for the media to encourage people to relocate to the west.
In the linear regression analysis, we investigate whether the house’s distance from CBD causes its price to decrease, as the price is the independent variable.
The lm() function was used and returned a linear regression model with various statistics and graphs.
Among the five assumptions for linear regression that have to be validated, independence was validated as the data came from different houses. Linearity was supported by a flat residuals vs. fitted graph and a weak negative correlation (-0.13) in the scatter plot. Influential cases were minimal, as indicated by no points above Cook’s distance in the residual vs. leverage graph, suggesting outliers had negligible impact. Homoscedasticity was evident from the residual vs. fitted graph, indicating consistent variance across data points, with a straight line crossing the middle, affirming model fit. However, the deviations in the normal Q-Q plot indicated that the residuals did not meet the normality assumption.
The p-value is observed to be significantly small, with an F-statistic of 470.4, which indicates that it is a linear relationship. However, the R-squared value is 0.0185, which means the distance explained only 1.85% of the house price variability.
Major finding: Firstly, a statistically significant negative linear relationship between distance and house prices was identified, with an average decrease of 11452AUD for every one-unit increase in distance (km). However, the distance only explained 1.85% of the variability in house prices, and the correlation coefficient is -0.13, suggesting a weak association. Hypothesis tests confirmed the statistical significance of both the intercept and slope of the regression model.
Strength: Rigorous validation of assumptions underlying linear regression.
Limitations: Despite the significant relationship found, the weak correlation coefficient and low variability explained by distance imply limited predictive ability. Other unaccounted factors may influence house prices significantly, complicating valuation. Furthermore, the violation of the assumption of normally distributed residuals raises concerns about the model’s reliability, urging careful interpretation of results.
Future Investigations: Further investigations could enhance understanding by incorporating additional variables, such as property size. Utilising advanced statistical techniques like nonlinear regression could provide deeper insights into the complex relationships influencing house prices.
Conclusion: The hypothesis test results showed statistical significance, confirming a linear relationship between distance and prices. The further away from CDB, the cheaper the house. However, the weak correlation coefficient and the limited variability explained by distance suggest a weak negative linear relationship. Additionally, the model’s failure to meet the assumption of normally distributed residuals raises concerns about the efficiency, bias, or potential misleading nature of the linear regression model’s forecasts and confidence intervals.
Frost J (2024) Guidelines for Removing and Handling Outliers in Data, Statistics By Jim website, accessed 25 May 2024. https://statisticsbyjim.com/basics/remove-outliers/
Kinsella E (2022) Moving west, ABC website, accessed 25 May 2024. https://www.abc.net.au/news/2022-03-20/melbourne-west-altona-housing-property-prices-development/100828670
Pino T (2016) Melbourne Housing Market [data set], Kaggle website, accessed 25 May 2024. https://www.kaggle.com/datasets/anthonypino/melbourne-housing-market