2  Quick Start

This chapter walks through installation, environment setup, and running your first analysis end-to-end.

2.1 Prerequisites

Requirement Version Notes
R >= 4.2 With renv for package management
Python >= 3.12 Managed via uv
Quarto Latest CLI for manuscript rendering
gfortran Any Required by frailtypack (brew install gcc on macOS)
uv Latest Python package manager

2.2 Installation

# Clone the repository
git clone https://github.com/htlin222/survival-pipe.git
cd survival-pipe

# Bootstrap R and Python environments
bash setup.sh

# Verify everything is ready
bash verify_environment.sh
TipFirst-Time Setup

setup.sh installs R packages via renv::restore() and Python dependencies into a .venv managed by uv. Run it once after cloning.

2.3 First Analysis Walkthrough

2.3.1 1. Initialise a project

make init PROJECT=my-study

This creates the standard directory tree under projects/my-study/.

2.3.2 2. Simulate data (for demo purposes)

make simulate SCENARIO=1 PROJECT=my-study

Scenarios 1–7 generate datasets with different survival complexities (standard, competing risks, recurrent events, etc.).

2.3.3 3. Run diagnostics

make diagnose PROJECT=my-study

Validates data structure, runs all six diagnostic checks, and produces a routing report.

2.3.4 4. Auto-select and run analysis

make analyze-auto PROJECT=my-study

The diagnostic router reads the report and executes the appropriate analysis module.

2.3.5 5. Generate figures and manuscript

make figures PROJECT=my-study
make manuscript PROJECT=my-study
make render PROJECT=my-study

2.4 Makefile Targets at a Glance

Target Description
make help List all available targets
make setup One-time environment bootstrap
make verify Check environment health
make init Create a new project
make simulate Generate simulated data
make diagnose Run all diagnostic checks
make route Diagnose + recommend analysis
make analyze-auto Auto-select and run analysis
make figures Generate 300 DPI figures
make manuscript Build Table 1 and results
make render Render Quarto to PDF + DOCX
make qa Run QA validation
make all Full pipeline end-to-end
make clean Remove generated outputs
WarningClean Target

make clean removes all generated outputs (diagnostics, analysis, figures, manuscript) but preserves raw data. It uses rip (not rm) for safe deletion.