diff --git a/docs/chapters/README.md b/docs/chapters/README.md new file mode 100644 index 0000000..1cf7238 --- /dev/null +++ b/docs/chapters/README.md @@ -0,0 +1,75 @@ +# Chapter Notes (R ↔ Python) + +This folder holds one DOCX (and optionally a PDF export) per chapter, built from the template: +**PyStatsV1-Chapter-Template.docx**. + +## How to create a new chapter notes file + +1) **Copy the template** + - Copy `PyStatsV1-Chapter-Template.docx` to `docs/chapters/ChXX__Notes.docx` + - Examples: + - `Ch07_SimpleLinearRegression_Notes.docx` + - `Ch08_Inference_SLR_Notes.docx` + - `Ch09_MultipleLinearRegression_Notes.docx` + +2) **Fill the sections** + - **Goal & Outputs**: what the chapter computes/plots in R & Python + - **Dataset & Reproducibility**: + - list input files (e.g., `data/autompg.csv`) + - record seeds and exact commands to run both R and Python + - **R Approach (from textbook)**: formulas + key functions (`lm`, `confint`, `predict`, etc.) + - **Python Approach (mirror)**: pandas/statsmodels/scipy/matplotlib equivalents + - **Side-by-Side Commands**: keep short, runnable snippets + - **Diagnostics & Checks**: reference images saved by scripts (see below) + - **Pitfalls & Equivalences**: factors vs categoricals, NA handling, formula differences, defaults + - **Attribution & License Notes**: see licensing section below + +3) **Screenshots & figures** + - Save images generated by scripts under `outputs/`, and reference them in the DOCX. + - If you add static images for the notes themselves, place them here: + - `docs/chapters/img/ChXX/` (create as needed) + - Example: `docs/chapters/img/Ch07/residuals.png` + +4) **Recommended naming** + - DOCX: `ChXX__Notes.docx` + - (Optional) PDF: `ChXX__Notes.pdf` + - Keep topic names short and clear. + +## Reproducibility block (copy/paste) + +**Windows (Git Bash / PowerShell)** +``` +python -m venv .venv +source .venv/Scripts/activate 2>/dev/null || .venv\Scripts\Activate.ps1 +pip install -r requirements.txt +python scripts/chXX_.py --save-outputs +``` + +**macOS / Linux** +``` +python -m venv .venv && source .venv/bin/activate +pip install -r requirements.txt +python scripts/chXX_.py --save-outputs +``` + +If the chapter has an R counterpart, also include: +``` +Rscript chXX_.R +``` + +## Licensing & attribution + +- **Book content**: The source textbook *Applied Statistics with R (STAT 420)* is **CC BY-NC-SA 4.0**. + Do **not** copy large verbatim passages. When quoting or closely paraphrasing, provide attribution and keep it non-commercial and share-alike compatible. +- **This repo’s Python code**: MIT (see `LICENSE`). +- **These notes**: Paraphrase and attribute. If you include longer excerpts, ensure they comply with **CC BY-NC-SA 4.0**. + +## Chapter checklist + +- [ ] R command(s) listed and runnable +- [ ] Python command(s) listed and runnable +- [ ] Inputs named (file paths, seeds) +- [ ] Outputs referenced (plots/tables) +- [ ] Key equivalences documented (R ↔ Python) +- [ ] Diagnostics summarized (residuals, QQ, leverage if relevant) +- [ ] Attribution present; licensing constraints respected