Automated Thematic Analysis for Clinical Qualitative Data: Iterative Codebook Refinement with Full Provenance
Organizations: Department of Biomedical Engineering, University of Texas at Austin, Austin, TX, USA · Department of Computer Science, University of Texas at Austin, Austin, TX, USA · School of Information, University of Texas at Austin, Austin, TX, USA · College of Natural Sciences, University of Texas at Austin, Austin, TX, USA · Graphen, Inc., New York, NY, USA · Department of Pediatrics, University of Texas at Austin, Austin, TX, USA · Department of Cardiac Surgery, Division of Pediatric Cardiac Surgery, Vanderbilt University School of Medicine, Nashville, TN, USA · Pediatric Heart Institute, Monroe Carell Jr. Children’s Hospital at Vanderbilt, Nashville, TN, USA · Department of Population Health, Dell Medical School, University of Texas at Austin, Austin, TX, USA
Abstract
Thematic analysis (TA) is widely used in health research to extract patterns from patient interviews, yet manual TA faces challenges in scalability and reproducibility. LLM-based automation can help, but existing approaches produce codebooks with limited generalizability and lack analytic auditability. We present an automated TA framework combining iterative codebook refinement with full provenance tracking. Evaluated on five corpora spanning clinical interviews, social media, and public transcripts, the framework achieves the highest composite quality score on four of five datasets compared to six baselines. Iterative refinement yields statistically significant improvements on four datasets with large effect sizes, driven by gains in code reusability and distributional consistency while preserving descriptive quality. On two clinical corpora (pediatric cardiology), generated themes align with expert-annotated themes.
Figures & tables
| AAOCA 11 | SV-CHD 11 | Ali | Dreaddit 17 | Sheffield | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Method | Score | Score | Score | Score | Score | |||||
| OpenCoding 16 | 0.493 | 0.450 | 0.473 | 0.428 | 0.516 | |||||
| LLOOM 9 | 0.476 | 0.495 | 0.491 | 0.458 | 0.484 | |||||
| GraphRAG 7 | 0.433 | 0.391 | 0.431 | 0.382 | 0.467 | |||||
| LightRAG 8 | 0.415 | 0.501 | 0.504 | 0.368 | 0.505 | |||||
| Thematic-LM 14 | 0.485 | 0.473 | 0.395 | 0.375 | 0.629 | |||||
| Generated Theme | Closest Human Theme | Sim. |
| AAOCA (8 generated; mean = .487) | ||
| Parental fears & protective instincts | Feeling that my child is safe | .587 |
| Balancing caregiving & prof. responsibilities | Partnership with the care team | .558 |
| Child’s engagement & understanding | Feeling that my child is safe | .515 |
| Emotional & psychological impacts | Coping with stress, anxiety, depression | .504 |
| Communication complexities in health mgmt. | Communicating risks appropriately | .496 |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Dataset | Metric | Iter-1 | Best | Sig. | / Effect | |||
|---|---|---|---|---|---|---|---|---|
| AAOCA | Reusability | .119 | .140 | +.021 | 4.98 | .008 | 2.23 / L | |
| Fitness | .702 | .791 | +.089 | 4.00 | .016 | ** | 1.79 / L | |
| Coverage | .600 | .760 | +.160 | 6.47 | .003 | 2.89 / L | ||
| Parsimony | .569 | .608 | +.039 | 15.92 | .001 | 7.12 / L | ||
| Consistency | .362 | .362 | .000 | — | — | — | — | |
| Overall | .471 | .509 | +.039 | 6.23 | .003 | 2.78 / L |