Statistical analysis code for a Master's thesis examining road markings for cyclists and pedestrians at junctions in Austria. The analysis covers a demographic description of the survey sample, per-scenario assessments of right-of-way and perceived safety, aggregated comparisons across all situations, consistency and correctness of traffic-rule knowledge, a behavioural matrix analysis, and statistical hypothesis testing. All code is written in R using tidyverse conventions and produces publication-ready figures with a custom ggplot2 theme.
The underlying survey was conducted as part of the master thesis in 2023 in Austria. Raw response data — including IP addresses, email addresses, and open-text fields — were processed and anonymised prior to publication. Only the anonymised dataset is included in this repository. The original questionnaire in German is added in the folder 'data', the English translation can be found in the 'bilingual_codebook.csv'.
project-root/
|
|-- main.R # Entry point — sources all analysis scripts in order
|
|-- R/
| |-- 00_setup.R # Package loading, directory creation, data import, unstacking
| |-- 01_descriptives_and_demographics.R # Age/gender pyramid, spatial maps, mode use,
| | # licence acquisition, specific pedestrian needs
| |-- 02_scenario_visualizations.R # Per-scenario right-of-way & safety plots,
| | # stratified by demographic subgroups
| |-- 03_comparative_scatterplots.R # Car-perspective parameter grids,
| | # comparative scatterplots across perspectives,
| | # frequency groups, gender, regulatory background
| |-- 04_consistency.R # Internal consistency heatmaps
| | # (cyclist vs. driver, pedestrian vs. driver)
| | # and aggregated correctness heatmaps
| |-- 05_results_compilation.R # Aggregated right-of-way & safety bar charts,
| | # long-format analysis_df construction,
| | # master results tables, systemic risk heatmaps
| |-- 06_hypothesis_testing.R # H1 (marking type), H2 (demographics),
| | # H3 (perspective effects, systemic risk, consistency)
| |-- functions.R # Custom helper functions
| `-- theme.R # Custom ggplot2 theme and colour palettes
|
|-- data/
| |-- anonymized_data.rds # Primary data file (R-native, preserves labels)
| |-- anonymized_data.sav # SPSS format (alternative, preserves labels)
| |-- anonymized_data.csv # CSV format (open standard, strips labels)
| `-- other/ # Reference files and additional tables with cleaned open field comments
| |-- bilingual_codebook.csv # Survey questionnaire data dictionary, codes and factor levels
| |-- Appendix-surveyQuestionnaire.pdf # Survey questionnaire (in black and white, for coloured images see the master thesis)
| |-- correct_answers.csv # Ground-truth right-of-way answers per each assessed traffic scenario
| |-- cleaning_summary_stats.csv # Intermediate data cleaning statistics
| `-- comments_*.csv # Processed open-text responses (e.g., specific needs, suggestions)
|
|-- input/ # Contains required secondary datasets (e.g., population data). Note:
| | # These datasets are provided by third parties (Statistik Austria, RTR-GmbH).
| | # See `LICENCE` file.
| |-- Population_AnnualAverage_ByAgeSex_2024.csv # Statistik Austria reference population
| |-- plz.csv # Postal code to municipality/federal state mapping
| |-- Bev_Ortschaften_2024.ods # Inhabitants on municipality level
| |-- inhab_per_federalstate.csv # Inhabitants per Austrian federal state
| `-- LICENCE # Licensing details for third-party input data
|
`-- output/
|-- figures/ # All saved plots (.jpeg)
`-- tables/ # All saved data tables (.csv)
R (>= 4.3) and the following packages are required:
install.packages(c(
"haven", "sjlabelled", "labelled", "readODS", "tidyverse", "shadowtext",
"scales", "ggrepel", "rstatix", "lme4", "sf", "giscoR"
))
sf and giscoR are required for the choropleth map of participation by federal state (section 1.4 of 01_descriptives_and_demographics.R). giscoR downloads NUTS boundary data at runtime; an internet connection is therefore needed for that section.
A sessionInfo.txt file in the repository root documents the exact R version and package versions used to produce the results.
From the project root in a clean R session:
source("main.R")
Or from a terminal:
Rscript main.R
All figures are written to output/figures/ and tables to output/tables/. These directories are created automatically if absent.
Alternatively, scripts may be run individually in RStudio in the order given in main.R, with the project root set as the working directory. Note that some scripts depend on objects created by earlier scripts. Therefore, scripts should be run in the order defined in main.R.
Three data formats are provided for replicators. The active default is the .rds file, which preserves all SPSS variable labels. Commented-out alternatives for .sav and .csv are provided at the top of 00_setup.R; refer to input/bilingual_codebook.csv for factor levels if the CSV option is used.
Katharina Binder, BSc Technische Universität Wien, Fakultät für Bau- und Umweltingenieurwesen
TU Wien, Faculty of Civil and Environmental Engineering
katharina.binder [at] alumni.tuwien.ac.at
For questions regarding the data, methodology, or code, please feel free to contact me via email.
If this code is used in research, please cite it using the metadata in CITATION.cff or via the DOI: 10.48436/efmdt-6zc67
Dataset Citation:
Binder, Katharina. (2026). Data and Code for: Assessment of road markings at crossing facilities for cyclists and pedestrians regarding right-of-way comprehension and safety perception at non-signalised junctions in Austria (Version 1.0.0) [Dataset]. TU Wien Research Data. https://doi.org/10.48436/efmdt-6zc67
LICENSE file for full copyright information.LICENSE file for full copyright information.input/ folder): All rights remain with the original publishers. Please see input/LICENCE for full source citations and original publisher details.