Construct matrix and analysis code for threshold detection in online booking behaviour
Description
Associated manuscript "When Linear Models Detect Nothing: Threshold Structure in Booking Behaviour Across Survey and Observed-Behaviour Data" Omar Millan Delgado, Faculty of Engineering, Universidad de Investigacion y Desarrollo (UDI), Bucaramanga, Colombia. omillan1@udi.edu.co Licence CC BY 4.0 Contact omillan1@udi.edu.co Everything needed to reproduce Tables 1-7 and Figures 1-4 of the manuscript from raw inputs. No step depends on proprietary software. Total runtime is roughly 90 minutes on a standard laptop, dominated by the Monte Carlo study. constructs_final.csv Survey construct matrix, N = 640 anfis.py Takagi-Sugeno ANFIS implementation benchmark_cse_tam.py Learner benchmark, nested cross-validation montecarlo.py Simulation study external.py External validation on observed bookings README.txt This file 2. DATA FILE -------------------------------------------------------------------------------- constructs_final.csv 640 rows, 9 columns, no missing values. Columns: SUSC, SOCIAL, INF, EWOM, INT, SAT, ATEN, WEBUSE, PURCHASE These are regression factor scores from a varimax-rotated solution, rescaled to the unit interval. The rotation is orthogonal, so the columns are mutually uncorrelated by construction: the largest absolute off-diagonal correlation is 0.07 and the mean is 0.007. This is a deliberate design feature and not an artefact; Section 3.2 of the manuscript explains why. Construct sources SUSC susceptibility to interpersonal influence Bearden et al. (1989) WEBUSE web use Davis (1989) EWOM electronic word-of-mouth Hennig-Thurau et al. (2004) SAT satisfaction Oliver (1980) INF information quality DeLone & McLean (2003) INT interest Hoffman & Novak (1996) ATEN attention --- SOCIAL social factors Venkatesh et al. (2003) PURCHASE purchase intention Ajzen (1991) Collection. Structured face-to-face interviews with 640 tourists in San Gil and Barichara, Department of Santander, Colombia, across high and low season. Response rate 78% of 820 contacted. Inclusion required a visit within the previous six months, at least one online accommodation booking in the previous year, and age 18 or above. Ethics. Project 2025-S-02, approved by the Research Committee, the Directorate of Research and the Rectory of UDI prior to collection. Informed consent obtained from all participants. Handling complied with Colombian Statutory Law 1581 of 2012 and Decree 1377 of 2013. The file contains no direct or indirect identifiers.
Files
Steps to reproduce
REQUIREMENTS Python 3.10+. Install: pip install numpy pandas scikit-learn scipy statsmodels xgboost matplotlib All random seeds are fixed and cross-validation folds are shared across learners, so paired comparisons are valid and results reproduce exactly on equivalent library versions. STEP 1 - Survey analysis (approx. 10 min) python benchmark_cse_tam.py constructs_final.csv Input: constructs_final.csv (640 rows, 9 orthogonal construct scores on the unit interval). Runs the linear path analysis and benchmarks seven learners (least squares, SVR, MLP, random forest, gradient boosting, XGBoost, ANFIS) under nested cross-validation: outer 5-fold for performance, inner 3-fold grid search for hyperparameters, so no tuning information reaches the performance estimate. Requires anfis.py in the same directory. Produces: Table 3 (17 linear paths, all ns), Table 4 (repeated nested CV with 95% intervals), Table 5 (Friedman test), Table 6 (e-WOM transition location), Figure 2 (partial dependence by three model families), Figure 3 (joint partial dependence and Friedman H statistic). STEP 2 - Simulation study (approx. 60 min) python montecarlo.py 20 Takes no input file; generates data internally. Four orthogonal uniform predictors; the outcome is a difference of two logistic functions giving a floor, an activation at tau = 0.47, a plateau and a decline after 0.78. Crosses sample size (200/400/640/1000), transition sharpness (k = 8/16/40) and noise (sd = 0.05/0.10/0.20), 20 replications per cell, 720 runs. A null condition with a purely linear generating process adds 180 runs and measures the false positive rate. The argument sets replications per cell; use a smaller value for a faster check. Produces: Table 1 (recovery by sharpness), Table 2 (recovery by sample size), Figure 1. STEP 3 - External validation (approx. 15 min) python external.py Downloads a public snapshot of 48,895 Airbnb listings for New York City derived from Inside Airbnb (http://insideairbnb.com/get-the-data). The file is not redistributed here because it is not ours to license. Filters to 30,988 cases: availability_365 > 0, price > 0, price < 1000, minimum_nights <= 90. Outcome is booked days = 365 - availability_365. Predictors are number_of_reviews, price, minimum_nights, calculated_host_listings_count, room_type and neighbourhood_group. If the source URL changes, substitute any copy of the AB_NYC_2019 file with those column names; no other modification is needed. Produces: Table 7 and Figure 4. OUTPUT Tables are written to results/ as CSV; figures are written as PNG to the working directory. NOTE ON THE DATA The construct scores are regression factor scores from a varimax solution, so the columns are mutually uncorrelated by construction (largest |r| = 0.07). This is deliberate and is the basis of the design; see Section 3.2 of the manuscript before reusing the file.