Task: Participants watch animated ball collisions and predict where Ball B will land after impact, then rate their confidence in their prediction. Various physics manipulations test different aspects of physics intuition:
- Egress angle: Ball B exits at modified angles (±4.5° to ±15° from natural physics)
- Temporal delay: Ball B's response is delayed (1-5 frames after collision)
- Spatial overlap: Ball collision positions are spatially misaligned (±10-20%)
- Mass/size ratio: Ball mass and size ratios vary (0.6x to 1.4x)
- Combined conditions: Egress + overlap, egress + temporal
Key Measures:
- Prediction accuracy (directional error toward physics-aligned vs physics-violating endpoint)
- Confidence ratings (0-100 scale)
- Reaction time and mouse trajectories
Hallucinatory Quotient (HQ): Individual differences measure derived from 12 subscales across three psychometric questionnaires (PDI, CAPS, SPQ). K-means clustering divides participants into High HQ vs Low HQ groups.
Sample: 121 participants (Prolific)
This repository is the analysis component of a three-part research project:
| Component | Purpose | Repository |
|---|---|---|
| physicsTask | Physics simulation engine — generates stimulus data | GitHub |
| physics_dev (this repo) | Analysis pipeline — processes behavioral data | GitHub |
| physics_v4 | PsychoPy experiment — data collection via Pavlovia | Pavlovia GitLab |
Install the simulation engine: pip install git+https://github.com/adammanoogian/physicsTask.git
# Option 1: Conda (recommended)
conda env create -f environment.yml
conda activate physics_dev
# Option 2: Pip
pip install -r requirements.txt# All analyses (frequentist only, ~15-30 min)
python scripts/pipeline/00_run_pipeline.py
# Paper figures only (~10-20 min)
python scripts/pipeline/00_run_pipeline.py --paper-only
# Include Bayesian analyses (~5-7 hours additional)
python scripts/pipeline/00_run_pipeline.py --paper-only --bayesianThe full pipeline runs 11 stages sequentially. Scripts use stage-based naming: S{stage}_{seq}_{name}.py
| Stage | Name | Description |
|---|---|---|
| S00 | Stimulus Generation | Generate physics simulation data using physicsTask |
| S01 | Data Extraction & Cleaning | Extract behavioral data from raw Prolific CSVs |
| S02 | Quality Control & HQ Scoring | HQ PCA clustering, attention checks |
| S03 | Mouse Tracking | Trajectory metrics (AUC, velocity, direction changes) |
| S04 | Trial Selection | Subcondition filtering, correlation analyses |
| S05 | Frequentist GLMM | Standard + weighted GLMM, diagnostics |
| S06 | Bayesian Models | HQ-outcome, metacognition, bivariate, latent class |
| S07 | Subcondition Analysis | Per-subcondition breakdowns and regressions |
| S08 | Slow Trials & Mouse Trajectories | Slow-motion analyses, path plots |
| S09 | Learning & Baseline | Learning curves, pre/post comparisons |
| S10 | Reporting | Publication figures, summary tables |
Primary Data File: data/human_v5/human_data_cleaned.csv
- Trial-level data with quality filters applied
- Includes psychometric scale scores (PDI, CAPS, SPQ)
- HQ composite and cluster assignments
HQ Scores: data/hallucinatory_quotient_scores.csv
- Authoritative source for all HQ-related columns
- Contains 12 subscales, cluster assignments, composite scores