Published
Edited
Oct 19, 2019
Insert cell
Insert cell
Insert cell
Insert cell
import {Airbnb as Airbnb} from '@nussyr3/airbnb-data'
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
md` ** 4. Does the overall affordability of a room have an effect on the minimum stay nights set by the owner?**`
Insert cell
md` ** 5. Do cheaper listings mean that less money is spent overall? How much is money is being spent when minimum night stays are factored in?**`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
md` ## I am not sure about this one! `
Insert cell
VegaLite({
data: {values: Airbnb},
width: 500,
height: 400,
mark: "bar",
encoding: {
x:{field: "reviews_per_month", aggregate: "count", type: "quantitative"},
y:{field: "room_type", type: "nominal"},
color: {field: "reviews_per_month", type: "quantitative"},
}
})
Insert cell
md` ##### *Visualization 4 - Relationship between the minimum nights and pricing`
Insert cell
VegaLite({
data: {values: Airbnb},
width: 700,
height: 500,
mark: "circle",
encoding: {
x: {field: "price", type: "quantitative"},
y: {field: "minimum_nights", type: "quantitative"},
color: {
field: "price", type: "quantitative",
scale: {scheme:"darkred", reverse: true}
}

}
})
Insert cell
md`This is this first part of the visualization that helps us see if there is a correlation between the price listed by the host and the minimum number of nights they are required to stay.

The x-axis shows the scale of price listings of the stay, while the y-axis shows the minimum number of nights that has to be booked with the particular listing. A scatterplot graph was chosen because the individual values don't matter as much since we just wanted to look at the clusters and trends. The clusters are definitely more prominent in certain areas meaning there are several listings that are within those ranges.

This visualization shows that listings with more affordable prices have a huge tendency to have a much higher minimum stay time. The listings that cost over $1000 all have a very low minimum number of nights you have to stay while the super affordable places under $400 mostly go up to minimum 500 nights you need to stay. That's over a year so it may prove to be quite difficult to find a very affordable place for short-term stay.

The dark-red colour scheme is used again, but for the range of price just to visually reinforce the change in the price listings. This way it is easier to scan at a glance and compare the cheaper listings with the more expensive ones. `



Insert cell
md` ##### *Visualization 5 - Price listing compared to total money spent`
Insert cell
VegaLite({
data: {values: Airbnb},
width: 600,
height: 400,
transform: [
{calculate: "datum.minimum_nights*datum.price", as: "total_minimum_cost"},
],
mark: "circle",
encoding:{
x: {field: "price", type: "quantitative"},
y: {field: "total_minimum_cost", type: "quantitative", scale: {type: "log"}},
// color: {field: "minimum_nights", type: "quantitative"}
}
})
Insert cell
md`This is visualization that helps us see if there is a correlation between the price listed by the host and the minimum number of nights they are required to stay.

The x-axis holds the listing price by the owner, and the y-axis scales up by the total minimum cost that must be spent by the one who is booking the location. This is just calculated by multiplying the minimum nights together with the listing price to find the total asking price. A line chart was originally used, but was changed to a scatterplot because it is easier to identify individual listings as well as locate the concentration of listings within certain price ranges.

It can be noted that quite a prominent bottom curve in the graph. This shows that within that curve, there are quite a few listings that have a minimum night of 1 that they customer must stay, which suggests that with enough search, customers can find affordable stays for however long they choose to stay. It is also notable that throughout all of the listing prices, there, the overall money required to be spent can range up quite high, which means that those listings are for people who are committed to staying in one place for a long duration of time, and must save up quite a bit of money to book it for the whole duration. An example of this is for a listing that costs $250, the minimum number of nights set by the lister requires the booker to spend $67,500.

This visualization shows that just because the listing is cheap if measured per day, those staying might not be able to take advantage of the low price because of the minimum number of nights they must spend there, especially when travelling for a shorter duration of time. `


Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more