Skip to content

Repository files navigation

TCD Reproducibility Analysis

DOI

Analysis code for the between-visit reproducibility of cerebrovascular and cardiovascular responses to the cold pressor test (CPT).

Vondrasek JD, Hoch JW, Huang M, Belval LN, Jarrard CP, Crandall CG, Watso JC. Between-visit Reproducibility of Cerebrovascular and Cardiovascular Reactivity During the Cold Pressor Test. American Journal of Physiology-Heart and Circulatory Physiology. Accepted for publication.

Everything in Analysis_R/outputs/ is generated by the code in this repository from the raw workbooks. Nothing is edited by hand.

What the analysis does

Time course Visit 1 and visit 2 responses at minute 1 and minute 2 of CPT, with a two-way repeated-measures ANOVA (visit × time) and Bonferroni-corrected post-hoc comparisons.
Agreement Bland-Altman bias and limits of agreement, ICC(3,k), Lin's CCC, and paired comparisons with effect sizes, for baseline values and CPT responses across 15 variables.
Sensitivity Reliability by sex and menstrual-cycle matching, recomputed with unmatched females excluded, plus a leave-one-participant-out influence analysis.
Ancillary Mixed-model regression of the cerebrovascular response on pain and ET-CO₂, and reliability of pain, pressure-pain tolerance and water temperature.

Layout

Analysis_R/
  R/                    analysis modules, sourced by the run steps
  run_step_01..07.R     the pipeline, run in order
  outputs/              generated tables (committed) and figures (not committed)
  requirements.R        package installer
  rules_figures.md      figure and branding conventions the code follows
  rules_fsu_branding.md
tests/                  test suite (see below)
docs/                   response to the reviewer revision requests
data/raw/               private workbooks go here (not committed)

Requirements

R 4.6.0 or newer. Install the packages once:

Rscript Analysis_R/requirements.R

This installs readxl, dplyr, tibble, ggplot2, patchwork, ggtext, lme4, car and MuMIn. The test suite needs nothing beyond these.

Data

Participant-level data are not public. To rerun the analysis, place both workbooks in data/raw/:

File Sheet Purpose
CPT Data_visit split.xlsx Data paired visit dataset
CPT_ETCO2_Resp_Comparison.xlsx ETCO2_Resp_Comparison ET-CO₂ corrections

Or point the environment variables TCD_MASTER_XLSX and TCD_ETCO2_XLSX at them. TCD_R_OUTPUT_DIR redirects where results are written.

Without the workbooks every step exits cleanly with a SKIP message, so the repository still runs in a clone that has no data. Contact the corresponding author to request access.

Running the pipeline

git clone https://github.com/FSUcaplab/tcd-reproducibility.git
cd tcd-reproducibility

Run the steps in order; step 06 reads the CSVs that steps 02 and 04 write.

for step in Analysis_R/run_step_*.R; do Rscript "$step"; done
Step Produces
01 Table 1, participant characteristics
02 Tables 2 and 3, and the Bland-Altman / ICC / CCC statistics
03 Figure 1 summary, ANOVA and post-hoc tables
04 Figure 5 and 6 statistics (sex and cycle-matching subgroups)
05 Leave-one-out influence tables
06 All figures, as PNG and PDF
07 Table 4 regression, VIF, and ancillary-measure reliability

Step 07 also runs a CPT-hand sensitivity check, which needs a third workbook (CPT Data.xlsx) that is not distributed; it is skipped when absent.

Tests

Rscript tests/run_tests.R

Two layers, and the runner exits non-zero if either fails:

  • Unit tests for the statistical kernels — agreement coefficients, the regression and correlation routines, Bland-Altman limit selection, the exclusion and grouping rules, and CSV serialisation. These need no data.
  • A regression test that re-runs the pipeline into a scratch directory and requires every table to come back byte-for-byte identical to the committed CSVs. This is what protects the published numbers: the code may be restructured freely, but the results may not move. Skipped without the workbooks.

Figures are not byte-compared, because rendering depends on the system's fonts.

Outputs

The generated tables in Analysis_R/outputs/ are committed — they are the manuscript's numbers and are worth reading and diffing directly. Figures are not committed; run step 06 to regenerate them.

Notes on the analysis

  • Baseline is the zero reference, so minute 1 and minute 2 are deltas from each visit's own baseline.
  • Summary statistics follow the data: mean ± SD where Shapiro-Wilk does not reject normality, otherwise median [IQR], with both visits reported alike.
  • Bland-Altman limits adapt to proportional bias and to heteroscedasticity, each accepted at P < 0.05; the chosen form is recorded per row in LoA_type.
  • Participant 45 is excluded throughout, and further per-variable exclusions for signal artefacts are listed in Analysis_R/R/03_reliability_tables.R. Review those before reusing this code on another dataset.
  • The statistical kernels are written out rather than taken from a package so they reproduce the original Python (scipy/pingouin) results exactly. Replacing them with lm() or cor.test() would move the published numbers.

Reliability estimates are sample-specific, and the sex and cycle-matching subgroups are small; interpret those strata with care.

How to cite

This repository includes a CITATION.cff file, so GitHub shows a "Cite this repository" button in the sidebar (APA and BibTeX).

For reference managers, use the ready-made export files:

File Use with
CITATION.ris EndNote, Zotero, Mendeley, RefWorks
CITATION.bib BibTeX / LaTeX
CITATION.cff the source of truth the other two are generated from

Please cite the associated manuscript. Both files contain the manuscript record and a separate software record, so importing either one gives you the paper and the code as two correctly typed entries.

CITATION.cff is the source of truth; the .ris and .bib are generated from it with the CAP Lab cff2ris.py converter. Regenerate them after any edit:

python cff2ris.py CITATION.cff

(The general-purpose cffconvert tool will also read this file, but it ignores preferred-citation and so emits only the software record, without the journal, volume, pages, or DOI.)

License

MIT — see LICENSE.

About

Reproducible analysis for between-visit cerebrovascular and cardiovascular responses during the cold pressor test

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages