The purpose of this project is to use R to gain insights into Airbnb listing prices in New York City. This analysis demonstrates the ability to import, clean, manipulate, visualize, and analyze data using R. It also includes descriptive statistics, a hypothesis test, and a linear regression model to better understand the factors associated with Airbnb pricing.
This project uses the NYC Airbnb Open Data dataset and focuses on how variables such as room type, borough, minimum nights, reviews, and availability relate to listing price.
How can I use R to gain insights into Airbnb listing prices in New York City?
More specifically, this project explores:
- How prices vary by room type
- How prices vary across boroughs
- Whether entire home or apartment listings differ significantly in price from private room listings
- Which listing characteristics help explain price differences
Dataset name: NYC Airbnb Open Data
File used in this project: AB_NYC_2019.csv
read_csv("data/AB_NYC_2019.csv")- R
- tidyverse
- dplyr
- ggplot2
Several cleaning steps were performed before analysis:
- Selected only the columns needed for this project
- Removed missing values from key variables
- Removed listings with a price of 0
- Removed extreme price outliers above 1000 to make the analysis and visualizations more readable
- Converted room type and borough variables into factors where appropriate
These cleaning steps were documented with comments directly in the R script.
This project uses multiple dplyr operations, including:
select()filter()mutate()group_by()andsummarise()arrange()
These operations were used to prepare the dataset for analysis and produce grouped summaries.
The following descriptive statistics were used:
- Mean price
- Median price
- Standard deviation of price
Grouped descriptive statistics were also calculated by room type and borough.
A two-sample t-test was performed to compare prices between two room types:
- Null Hypothesis (H0): The mean price of entire home or apartment listings is equal to the mean price of private room listings.
- Alternative Hypothesis (Ha): The mean price of entire home or apartment listings is different from the mean price of private room listings.
This test was chosen because price is a numeric variable and room type creates two groups for comparison.
A linear regression model was used to examine whether price can be predicted by:
- Minimum nights
- Number of reviews
- Reviews per month
- Availability over 365 days
The regression helps show which listing characteristics are associated with price changes.
This project includes at least three visualizations:
-
Boxplot of price by room type
Shows how price distributions differ across room types. -
Bar chart of average price by borough
Highlights which boroughs have the highest average listing prices. -
Scatter plot of price vs. number of reviews with a regression line
Helps visualize the relationship between reviews and price.
The visualizations are saved in the output folder.
This project is designed to reveal several important insights, including:
- Entire homes or apartments tend to have higher prices than private rooms
- Prices vary across boroughs
- Some listing characteristics may help explain differences in price
- Statistical testing and regression provide deeper insight beyond simple summaries
Your exact findings should be updated based on the output you get when running the script.
airbnb-r-final-project/
├── README.md
├── data/
│ └── AB_NYC_2019.csv
├── scripts/
│ └── final_project_analysis.R
└── output/
├── plot_price_by_room_type.png
├── plot_avg_price_by_borough.png
└── plot_price_vs_reviews.png
This project demonstrates how R can be used to gain meaningful insights from a publicly available dataset through cleaning, manipulation, visualization, statistical analysis, and regression modeling. The analysis shows how Airbnb prices differ by listing type and location, while also applying techniques that are useful in future academic and professional data work.