Skip to content

Statistical Analysis

This section is a working reference for the statistics a bioinformatician uses at the bench and in the clinic: choosing an analysis from the study design, reading the output as an effect with an interval, and correcting for the thousands of tests that genomics produces. It runs from descriptive summaries through survival analysis, trial design, and observational cohorts. Statistical learning, such as cross-validation and regularization, has its own machine learning section.

  • Most lessons show R and Python in synced tabs. Select a language once, and the other pages retain that choice.
  • Data you can download. Each lesson that analyzes a table links that invented table as a CSV file. Most were simulated with known true values, and the lesson states them, so you can judge every estimate against the truth.
  • Code that runs in order. The blocks of one tab, pasted in page order, form a complete script. The output under a block is the output of that block.
  • Some lessons use one language. Fine-Gray, MMRM, and propensity score matching use R; Bayesian regression uses PyMC in Python.
Question Start here
Which test fits the design and the outcome? Choosing a test
What is an independent observation in this experiment? Checking assumptions
How many samples does the experiment need? Sample size and power, or survival and binary endpoints for a trial
How large is the difference between two independent groups? Two groups and estimation plots
The same subjects were measured before and after. Paired samples
There are three or more groups, or a control and several doses. ANOVA, then post hoc comparisons
Two factors are crossed, such as genotype and treatment. Two-way ANOVA
The same subjects contribute several measurements. Repeated measures, mixed models, and generalized mixed models
The outcome is a count, or a yes or no. Count regression, logistic regression, and categorical data
What concentration gives half the maximal response? Dose-response curves
The outcome is the time to an event. Kaplan-Meier, Cox regression, and competing risks
Treatment started during follow-up. Time-dependent covariates
Patients in a trial drop out before the last visit. MMRM
Treatment was not randomized. Risk measures, propensity scores, and ANCOVA
Which measured differences survive many tests? Multiple testing
The statistic has no textbook interval. Bootstrap and permutation tests
How do prior assumptions affect a regression estimate? Bayesian regression
Can the model predict a new patient’s outcome? Machine learning evaluation, which measures prediction and not an effect

The mathematics lessons explain the probability, matrices, and likelihood calculations behind these methods. The Metabolomics comparison applies paired estimates and multiple testing to ion features from six field plots.

The Epidemiology section continues from these two lessons with study designs, standardization, causal diagrams, case-control studies, bias analysis, g-computation, marginal structural models, target trial emulation, Mendelian randomization, meta-analysis, and epidemic models.