DMgtAsia · Session-II
tidyverse: Industry-standard for reproducible workflowsData Science is a Tool for Social Good, Not an End in Itself
Data for Better Lives
3D Commission Recommendations
FAIR Data Principles
| Tool | Strength | Limitation |
|---|---|---|
| Excel | Accessible, intuitive | Prone to errors, not reproducible |
| SPSS/Stata | User-friendly GUI | Expensive, less transparent, limited Customization Options |
| Tableau/Jamovi | Less Expensive than others | Limited Analysis Options |
| Python | General-purpose, flexible | Steeper learning curve for epidemiologists |
| R | Purpose-built for stats, reproducible, free | Slightly steeper initial learning curve |
tidyverse: Collection of R packages designed for modern data workflowsCode + Narrative + Output = Single Document
Start with a DATA DICTIONARY
Write it once. The document weaves narrative, code, and output together:
attack_rates.qmd
# Age-Stratified Attack Rates
Attack rates by age group for the Sholayur Acute Gastroenteritis outbreak.
## Data Preparation
```{r}
age_data <- read_csv(here("data", "family_members.csv")) |>
mutate(age_group = factor(age_group,
levels = c("0-4", "5-17", "18-64", "65+")))
```
## Results
```{r}
age_data |>
group_by(age_group) |>
summarise(
n_symptomatic = sum(symptomatic, na.rm = TRUE),
n_total = n(),
attack_rate = n_symptomatic / n_total * 100
)
```
A well-organized project is a well-organized mind.
my_analysis/
├── README.md # Project overview
├── data/
│ ├── raw/ # Never modify
│ │ └── gastroenteritis_sholayur.csv
│ ├── processed/ # Cleaned, validated data
│ │ └── gastroenteritis_clean.csv
│ └── data_dictionary.md
├── scripts/
│ ├── 01_data_cleaning.R
│ ├── 02_descriptive_analysis.R
│ └── 03_inferential_stats.R
├── results/
│ ├── tables/
│ ├── figures/
│ └── outputs/
├── reports/
│ ├── outbreak_report.qmd
│ └── outbreak_report.html
├── docs/
│ ├── protocol_v3.pdf
│ └── iec_approval.pdf
└── .gitignore
stroke_data_exploration.R, dengue_data_visualization.R, instead of scrpit1, script201_, 02_ … for indicating sequential executionage_group not ageGrp or AgGr (consistency matters)state_fct, age_group_chr)dem_q1, dem_q2, dem_q3, health_financing_q1, health_financing_q2labelled packageoutbreak_analysis_2025_11_07.R (date in YYYY_MM_DD format)_date suffix for indicating datesoutbreak_analysis_2025_11_07_v2.R instead of outbreak_analysis_2025_11_07_final_final.RCode is read 10x more often than it’s written.
# GOOD: Clear, readable, consistent
calculate_attack_rate <- function(symptomatic_count, total_count) {
# Calculate attack rate as percentage
# Args:
# symptomatic_count: Number of symptomatic individuals
# total_count: Total population at risk
# Returns:
# Attack rate as percentage (0-100)
if (total_count == 0) {
return(NA)
}
(symptomatic_count / total_count) * 100
}
# BAD: Unclear naming, no comments
ar <- function(s, t) {
(s/t)*100
}# This script creates age_group variable from age column
# Load Packages
pacman::p_load(tidyverse, here)
# Load Data
age_data <- read_csv(here("data", "age_sholayur.csv"))
# Create age groups with meaningful labels
age_data <- age_data |>
mutate(
age_group = case_when(age < 5 ~ "0-4",
age < 18 ~ "5-17",
age < 65 ~ "18-64",
age >= 65 ~ "65+")
) |>
mutate(
age_group = factor(age_group,
levels = c("0-4", "5-17", "18-64", "65+"))) |>
)A standardized way to structure datasets for analysis.

Data Science and Public Health are Evolving Fields
The use of AI is inevitable. Using it well is a choice.
The prompt, not the model, decides whether the output is any good.
| Strategy | What it is | Best for |
|---|---|---|
| Zero-shot | Just ask, no examples | Descriptive stats |
| Explicit | Numbered steps incl. checks | Workflows that mustn’t skip steps |
| Chain-of-thought | “Think step by step” | Auditing the reasoning |
| Hybrid | Steps + reasoning + format | Inferential — the default |
Rule of thumb: descriptive → zero-shot; inferential → hybrid.
Skips the assumptions, guesses the design, picks a test for you.
You are a biostatistician.
<context> two-arm trial, 20 patients per arm,
outcome is systolic blood pressure </context>
<data> ... </data>
1. Test for normality and equal variance.
2. Choose the correct test and justify it.
3. Report a table: statistic, df, p-value, 95% CI.
4. Interpret in plain language.The same discipline as Reproducibility (#2) and Literate Programming (#4).
prompts/)Problem formulation beats perfect wording. Think first, prompt second.

DMgtAsia · Introduction to R & RStudio