Determinants of Airbnb prices in European cities: A spatial econometrics approach (Supplementary Material)
收藏资源简介:
This repository contains supplementary materials for the article: <strong>Determinants of Airbnb prices in European cities: A spatial econometrics approach</strong> <strong>(</strong>DOI<strong>: </strong>https://doi.org/10.1016/j.tourman.2021.104319) The materials include the used datasets and Python scripts for spatial regression models. <strong>Datasets</strong> For each city two files are provided: data for weekday and weekend offers The columns are as following: realSum: the full price of accommodation for two people and two nights in EUR room_type: the type of the accommodation room_shared: dummy variable for shared rooms room_private: dummy variable for private rooms person_capacity: the maximum number of guests host_is_superhost: dummy variable for superhost status multi: dummy variable if the listing belongs to hosts with 2-4 offers biz: dummy variable if the listing belongs to hosts with more than 4 offers cleanliness_rating: cleanliness rating guest_satisfaction_overall: overall rating of the listing bedrooms: number of bedrooms (0 for studios) dist: distance from city centre in km metro_dist: distance from nearest metro station in km attr_index: attraction index of the listing location attr_index_norm: normalised attraction index (0-100) rest_index: restaurant index of the listing location attr_index_norm: normalised restaurant index (0-100) lng: longitude of the listing location lat: latitude of the listing location <strong>Programming Scripts</strong> In this repository you will find a script for spatial regressions in Python using PySAL (models_robust.py). The codes cover the following regression models: OLS SLX (lagged_x) SAR (lagged_y) SDM (lagged_x_y) SEM (lagged_e) SDEM (lagged_e_x) Main parameters: cities - list of cities from the dataset to be included in the analysis Robust=False: calculate the OLS, SLX, SAR and SDM regressions with W (weight matrix) based on 10 closest neighbours Robust=True: calculate all regression models with different specifications of W direct_indirect=True: calculate the direct and indirect effects (based on Golgher, A. B., & Voss, P. R. (2016). How to Interpret the Coefficients of Spatial Models: Spillovers, Direct and Indirect Effects. Spatial Demography (Vol. 4). https://doi.org/10.1007/s40980-015-0016-y) Key functions: create_weights - defines the W specification write_stats - calculates's Moran's I and Geary's C direct - calculates the direct effect of the variable indirect - calculates the indirect effect coord - sets the coordinate refence system (CRS) appropriate to the analysed city total_results calculates the regressions the coordinates are projected from GPS (epsg:4326) to the local CRS (km_lat, km_lon) all regressions are saved as formatted txt table the results can be also saved as csv table
本仓库包含论文《欧洲城市Airbnb定价影响因素:空间计量经济学方法》(Determinants of Airbnb prices in European cities: A spatial econometrics approach)的补充材料,论文DOI:https://doi.org/10.1016/j.tourman.2021.104319。材料涵盖本次研究使用的数据集与空间回归模型的Python脚本。 ### 数据集 针对每个城市,我们提供两类文件:工作日与周末的房源定价数据。各字段说明如下: - realSum:双人入住两晚的住宿全额价格,单位为欧元(EUR) - room_type:住宿房型 - room_shared:共享房间虚拟变量(dummy variable) - room_private:私人房间虚拟变量 - person_capacity:房源最大容纳客人数 - host_is_superhost:房东为超级房东(superhost)的虚拟变量 - multi:该房源属于拥有2-4套房源的房东的虚拟变量 - biz:该房源属于拥有4套以上房源的房东的虚拟变量 - cleanliness_rating:清洁度评分 - guest_satisfaction_overall:房源整体满意度评分 - bedrooms:卧室数量(单间公寓设为0) - dist:房源至城市中心的距离,单位为公里(km) - metro_dist:房源至最近地铁站的距离,单位为公里 - attr_index:房源所在区位的景点指数 - attr_index_norm:标准化景点指数(取值范围0-100) - rest_index:房源所在区位的餐饮指数 - rest_index_norm:标准化餐饮指数(取值范围0-100) - lng:房源位置的经度 - lat:房源位置的纬度 ### 编程脚本 本仓库包含基于PySAL库实现空间回归分析的Python脚本(models_robust.py),代码覆盖以下回归模型:普通最小二乘回归(OLS)、滞后解释变量模型(SLX,lagged_x)、滞后被解释变量模型(SAR,lagged_y)、空间杜宾模型(SDM,lagged_x_y)、空间误差模型(SEM,lagged_e)、空间误差交互模型(SDEM,lagged_e_x)。 主要参数说明: 1. `cities`:待纳入分析的数据集内城市列表 2. `Robust=False`:基于10近邻权重矩阵(W)计算OLS、SLX、SAR与SDM回归 3. `Robust=True`:基于不同权重矩阵规格计算全部回归模型 4. `direct_indirect=True`:计算直接效应与间接效应(参考Golgher, A. B., & Voss, P. R. (2016). 《如何解读空间模型系数:溢出效应、直接效应与间接效应》,《空间人口学》(第4卷),https://doi.org/10.1007/s40980-015-0016-y) 核心函数说明: - `create_weights`:定义权重矩阵(W)的规格 - `write_stats`:计算莫兰指数(Moran's I)与吉尔里C统计量(Geary's C) - `direct`:计算变量的直接效应 - `indirect`:计算变量的间接效应 - `coord`:设置适配分析城市的坐标参考系统(CRS) - `total_results`:执行回归分析。代码会将坐标从GPS坐标系(epsg:4326)投影至局部坐标系(km_lat, km_lon)。所有回归结果将保存为格式化文本表格,也可导出为CSV表格。



