Skip to content

Add base structure for statistical analysis repository (R, Python, Quarto) - #1

Draft
PALP31 with Copilot wants to merge 2 commits into
mainfrom
copilot/create-base-structure-for-statistical-analysis
Draft

Add base structure for statistical analysis repository (R, Python, Quarto)#1
PALP31 with Copilot wants to merge 2 commits into
mainfrom
copilot/create-base-structure-for-statistical-analysis

Conversation

Copilot AI commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Bootstraps an empty repo into a functional statistical analysis template for biological/agronomic experimental data, covering frequentist and Bayesian workflows in both R and Python.

Structure added

├── .gitignore                        # R, Python, Quarto, OS/editor artifacts
├── README.md                         # Full docs: model table, requirements, quick-start
├── R/
│   ├── 01_modelos_frecuentistas.R    # ANOVA, LM, LMM, GLM (Poisson/Gamma), GAM, GLMM
│   └── 02_modelos_bayesianos.R       # brms: Bayesian LMM + GLMM-Poisson, LOO comparison
├── Python/
│   ├── 01_modelos_estadisticos.py    # statsmodels + pygam: ANOVA, LM, LMM, GLM, GAM
│   └── 02_modelos_bayesianos.py      # PyMC + ArviZ: Bayesian LM, LMM, GLMM-Poisson
└── quarto_templates/
    ├── reporte_analisis.qmd          # Frequentist report (HTML + PDF)
    └── reporte_bayesiano.qmd         # Bayesian report (HTML + PDF)

Key design decisions

  • Parity between R and Python: both languages cover the same model families so teams can work in either ecosystem.
  • Bayesian scripts use modern tooling: brms/Stan in R; PyMC + ArviZ in Python — including MCMC diagnostics and LOO-CV model comparison.
  • Quarto templates are render-ready: parameterised YAML front-matter, code-fold, embedded resources, and cache/ auto-creation for brms model caching.
  • All scripts use simulated data with clear substitution points (read.csv / pd.read_csv) so they run out of the box and are easy to adapt.

Notable fix

rpois lambda recycling bug in R/02_modelos_bayesianos.R: lambda = c(3, 6, 10) was recycling element-wise across all 60 rows instead of assigning one rate per treatment group — corrected to lambda = rep(c(3, 6, 10), each = 20).

Original prompt

Crea la estructura base para un repositorio de análisis estadístico. Incluye una carpeta para plantillas de Quarto (.qmd) orientadas a reportes de análisis de datos. Crea directorios separados para scripts de R y Python. Además, incluye un par de scripts de ejemplo con la estructura básica para correr modelos estadísticos (como ANOVA, LM, LMM, GLM, GAMs, GLMM Y BAYESIANA) aplicados a datos experimentales biológicos o agronómicos. Por último, genera un archivo README.md bien estructurado y un archivo .gitignore estándar para proyectos de R y Python

Copilot AI changed the title [WIP] Create base structure for statistical analysis repository Add base structure for statistical analysis repository (R, Python, Quarto) Apr 8, 2026
Copilot AI requested a review from PALP31 April 8, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants