In this assignment (25% of Final Grade) you construct, estimate and evaluate a linear hedonic price model, using Stata software. We assigned you to groups of 3 in which you will complete the assignment.
The assignment can be found here Assignment_HedonicPrices_2020.pdf. Data can be downloaded he...
Using the “summary()” function, we found that the data contains negative prices and
missing values.
Exclude missing and wrong observations:
library(stats)
Data1.2 <- Data1.1[complete.cases(Data1.1$price),]
Data1.2 <- Data1.2[complete.cases(Data1.2$size),]
Data1.2 <- Data1.2[complete.cases(Data1.2$pricesqm),]
Data1.2 <- Data1.2[Data1.2$price >= 0, ]
The function ‘complete.cases()’ creates a logical vector in which the cases are complete,
i.e. have no missing values. We made use of this function to exclude missing observations in
terms of prices, house size and price per m2.
We made use of indexing to exclude negative (wrong) prices. All price values in ‘Data1.2’
must be higher or equal to zero.
Drop outliers:
lower_bound_pricesqm <- quantile(Data1.2$pricesqm, 0.025)
upper_bound_pricesqm <- quantile(Data1.2$pricesqm, 0.975)
To detect the outliers in terms of prices, house size and price per m2, we made use of the
percentiles method. With this method, all observations that lie outside the interval formed
by the 2.5 and 97.5 percentiles will be considered as potential outliers.
The values of the lower and upper percentiles (and thus the lower and upper limits of the
interval) can be computed with the ‘quantile()’ function (Soetewey, 2020).
outlier_ind_pricesqm <- which(Data1.2$pricesqm < lower_bound_pricesqm
| Data1.2$pricesqm > upper_bound_pricesqm)
Data1.3 <- Data1.2[-outlier_ind_pricesqm,]
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller JelleSierkstra. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $8.47. You're not tied to anything after your purchase.