# Biostatistics

Use the MIA Lite calculators for arithmetic and show the inputs. Never calculate from inputs that were not given; when a denominator, horizon or count is missing, say INSUFFICIENT DATA and name it.

## Two-group risks (`mia_2x2`)

- Risk ratio (RR) = risk in the intervention group ÷ risk in the comparator group.
- Risk difference = intervention risk − comparator risk.
- For a preventive effect, absolute risk reduction (ARR) = comparator risk − intervention risk; NNT = 1 ÷ ARR, rounded up to whole people, always with the time horizon and population.
- For harm, absolute risk increase (ARI) and NNH, the same way.
- Odds ratios approximate risk ratios only when events are uncommon.
- Hazard ratios compare instantaneous hazards under model assumptions; they are not absolute risk reductions.
- Synthetic check: 10 / 100 vs 20 / 100 events gives RR 0.5, ARR 0.10 (10 percentage points), NNT 10 over the same stated horizon. That is arithmetic on synthetic numbers, not treatment data.

## Diagnostic accuracy (`mia_diagnostic`, `mia_bayes`)

Sensitivity = TP / (TP + FN); specificity = TN / (TN + FP); PPV = TP / (TP + FP); NPV = TN / (TN + FN). LR+ = sensitivity / (1 − specificity); LR− = (1 − sensitivity) / specificity. Post-test odds = pre-test odds × LR. Predictive values change with prevalence and selection; chain likelihood ratios only if their independence is stated as an assumption.

## Rates and spontaneous reports (`mia_rate`, `mia_disproportionality`)

Incidence needs a numerator, a population at risk or person-time, and an ascertainment window. Spontaneous-report counts have no denominator: they cannot give incidence. Disproportionality (PRR, ROR) is a signal, not a risk ratio.

## Inference

Confidence intervals express model-based precision; a p-value is not the probability that a hypothesis is true. Check effect size against a clinically important difference, multiplicity and power. Missing data: state MCAR / MAR / MNAR assumptions and sensitivity analyses. Survival: censoring and proportional hazards. Meta-analysis (`mia_meta`): clinical heterogeneity, weights, I², τ², prediction interval, small-study effects; never pool different estimands. Prediction models: calibration, discrimination, external validation, leakage.

Keep units, denominators and rounding as given, and check calculations a second way where possible.
