Skip to content

Repository files navigation

CWSAS Public Reproducibility Workflow

Article DOI R Code license: MIT

A paper-aligned, privacy-preserving R workflow for the Construction Workers' Safety Attitude Scale (CWSAS), demonstrated with deterministic simulated data.

This repository accompanies:

Zhou, Q., Liu, Y., & Pan, H. (2026). Development and Validation of a Safety Attitude Scale for Construction Workers. Buildings, 16(9), 1832. https://doi.org/10.3390/buildings16091832

What this repository provides

Component Public content
Study specification Published design, item codes, scoring direction, and final factor structure
Reproducible workflow Item analysis, PCA with Varimax rotation, CFA, reliability, and validity scripts
Runnable demonstration Two explicitly simulated datasets with fixed generation seeds
Reference materials Statistics and model parameters transcribed from the associated article
Quality checks Automated tests for metadata, scoring, data provenance, and required outputs

The repository demonstrates the computational implementation without distributing participant-level research records. It does not claim to independently reproduce or validate the article's empirical estimates.

Published study at a glance

Element Published design
Construct Construction workers' safety attitudes
Published initial item pool 40 items
Final instrument 26 items across four dimensions
Response format Five-point Likert scale
Reverse-scored final items Items 5, 7, 8, 9, and 23
Qualitative stage Interviews with 15 frontline construction workers
Content validation Two-round Delphi consultation with seven experts
Sample 1 n = 306; item analysis and exploratory analysis
Sample 2 n = 260; confirmatory factor analysis
Published software SPSS 26.0 and R/lavaan

Study workflow

flowchart LR
    L["Literature review"] --> G["Grounded theory analysis"]
    I["Field interviews<br/>n = 15"] --> G
    G --> D["Two-round Delphi consultation<br/>7 experts"]
    D --> Q["Published 40-item questionnaire"]
    Q --> S1["Sample 1<br/>n = 306"]
    Q --> S2["Sample 2<br/>n = 260"]
    S1 --> IA["Item analysis<br/>40 to 26 items"]
    IA --> EFA["PCA with Varimax rotation"]
    S2 --> CFA["Four-factor CFA<br/>ML + Bollen-Stine bootstrap"]
    EFA --> RV["Reliability and validity assessment"]
    CFA --> RV
    RV --> F["Final 26-item CWSAS"]
Loading

The editable Mermaid source is available in docs/study-flow.mmd.

Final scale specification

Dimension Item codes Items
Safety Behavioral Tendency A112, A113, A121, A122, A131, A141 6
Safety Emotion A212, A221, A223, A232, A242 5
Safety Cognition A311, A312, A313, A321, A322, A323, A331, A332, A333 9
Organization and Management A413, A414, A415, A421, A431, A442 6

The complete published wording, scoring direction, response anchors, and indicator allocation are provided in metadata/cwsas_codebook.csv.

Run the workflow

Requirements

From the repository root, run:

Rscript R/99_run_all.R

The runner will:

  1. generate both synthetic samples from a fixed seed;
  2. validate labels, ranges, and reverse scoring;
  3. calculate illustrative item statistics for a simulated 40-item software-test scenario;
  4. run PCA with Varimax rotation;
  5. fit the final four-factor CFA with 2,000 Bollen-Stine bootstrap resamples;
  6. calculate alpha, CR, AVE, Fornell-Larcker, and HTMT statistics;
  7. write an execution report; and
  8. run automated public-release checks.

See results/SYNTHETIC_RESULTS.md for the execution report and results/VALIDATION.md for the validation checklist.

Synthetic Sample 1 scree plot

Repository structure

.
├── R/                  # Ordered executable R workflow
├── data/
│   ├── synthetic/     # Fully simulated item-response records
│   └── derived/       # Regenerated locally and excluded from Git
├── docs/               # Study design and implementation notes
├── metadata/           # Published scale specification and reference values
├── results/            # Simulated workflow outputs and validation records
├── AUTHORS.md
├── CITATION.cff
├── DESCRIPTION
├── LICENSE
└── LICENSES.md

Data availability and reproducibility scope

The original participant-level questionnaire data are not included because they contain confidential research information and are subject to privacy and ethical restrictions.

The public workflow uses fully synthetic data to exercise data processing, exploratory factor analysis, confirmatory factor analysis, and reliability and validity code paths corresponding to procedures described in the associated article. Synthetic outputs are software-test artifacts and must not be interpreted as empirical participant results.

Published statistics included in this repository are explicitly identified as reference values from the associated article. See docs/data-availability.md for the public-data boundary.

Detailed synthetic output tables are retained for auditability. Their values describe only the simulated scenario and are not used to assess the published instrument or to claim agreement with the article's empirical item-selection decisions.

Citation

Please cite the associated article when using the CWSAS instrument. The repository also includes CITATION.cff, which GitHub can use to generate APA and BibTeX citations.

Licensing

Repository code is available under the MIT License. Published instrument wording and the synthetic research materials have separate attribution terms described in LICENSES.md.

About

A paper-aligned, privacy-preserving R workflow for the Construction Workers’ Safety Attitude Scale (CWSAS), demonstrated using deterministically generated synthetic data.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages