Scraping Edmunds.com to research vehicles
Scraping Edmunds.com listings and fitting a regression on resale prices to compare a Volvo XC60 and a Toyota RAV4.
Based on the predictive models, the XC60 depreciates roughly 26¢ per mile; the Rav4 depreciates approximately 16¢ per mile. The regression lines intersect at 44,000 miles.
Toyotas are known for their durability, which is reflected in the impressive holding resale prices for used vehicles. In comparison, luxury vehicles, such as the Volvo XC60, have a precipitous drop in value as they age. The rapid depreciation of luxury vehicles prompted a statistical analysis. Would a gently used XC60 cost about the same as a Toyota Rav4?
Data collection was accomplished using Python to scrape data from Edmunds.com. Linear regression was used to predict vehicle costs by mile for both the Rav4 and XC60.
Volvo XC60 linear regression model
- predicted_price = 41459.0 -0.26 * mileage
- R²: 0.71
- Standard Error: 4906.31
- Vehicles in the data set: 251
Toyota Rav4 linear regression model
- predicted_price = 37392.46 -0.16 * mileage
- R²: 0.74
- Standard Error: 4051.23
- Vehicles in the data set: 300
Calculating cost of ownership
The XC60 and the Rav4 are predicted to reach similar prices around 40,000 miles. I researched further to understand the overall cost of ownership differences. Bought at 40,000 miles and driven to 150,000 miles, the Volvo XC60 would cost roughly $150 more per month to own than the Toyota Rav4. In the end, purchases do not need to be purely mathematical. Sometimes an item is worth more because of the comfort and fun factor. The real question: would the XC60’s look, comfort, and fun be worth about $150 more each month to you?
Parsimony
In the age of AI, people rush to complex algorithms when often a simple solution is best. One could labor over in-depth forecasts of ownership costs. For most people, a rough estimate is enough to make an informed vehicle choice. The power of statistics lies in the freedom of inference. Data indicates that most consumers will choose the Toyota; others will happily pay more for the comfort and aesthetic bonus. Inference allows for an informed decision, which may be different depending on your unique preferences and needs.

