This repository contains examples demonstrating the use of Stan for regression modeling, with a focus on efficiency and reproducibility in data analysis workflows.
- R (>= 4.0.0)
- Quarto: An open-source scientific and technical publishing system built on Pandoc
- cmdstan: The shell interface to Stanj
renv
: A dependency management toolkit for R. This will install the key packages, including:targets
,stantargets
,tachetypes
,cmdstanr
,tinytex
, and ensure the installation ofcmdstan
andTinyTex
.
To interact with this repository:
-
Fork the Repository:
- Go to the original repository on GitHub.
- Click the "Fork" button to create your copy.
-
Clone Your Fork:
- Clone it to your machine: git clone [URL of your fork].
-
Create a New Branch:
- Inside the cloned directory: git checkout -b [new_branch_name].
-
Stay Updated:
- Set the original repository as "upstream" and regularly pull updates.
Benefits of Forking:
-
Personal Exploration: Freely experiment with the code without affecting the main repository.
-
Version Control: Practice using Git, a crucial skill in complex data analysis.
-
Ongoing Updates: Easily merge updates from the main repository into your fork.
Reinstall packages from renv.lock
:
r$ |> renv::restore()
Execute using the provided script (run.sh
):
> run.sh
1) tar_make() on local
2) tar_make_clustermq() on local
Enter number:
- Run tar_make() locally for standard processing.
- Use tar_make_clustermq() locally for parallel processing.
Try exercises in docs/regression.qmd
or docs/regression.html
.
These exercises focus on vectorization, reparameterization, and using targets
and stantargets
for efficient, reproducible workflows.