How-to articleMethodology & analyticsMedicine & healthcare

Textual data analysis in medical research: from content analysis to language models

Interviews, free-text survey answers, clinical notes and policy documents all hold evidence that numbers miss. This guide helps doctoral researchers choose between qualitative content analysis, thematic analysis, framework analysis and computational text methods, and report each to the standard reviewers expect.

What you will learn

  • Distinguish conventional, directed and summative qualitative content analysis
  • Explain how reflexive thematic analysis differs from codebook and framework approaches
  • Choose an analytic approach that fits the research question, data and epistemology
  • Describe what natural language processing and large language models can and cannot do with clinical text
  • Report textual analyses using SRQR and, for language model studies, TRIPOD-LLM

What you will unlearn

  • Themes emerge from the data if you code carefully enough.Themes are constructed by the researcher, and the analytic choices behind them should be reported.
  • Content analysis and thematic analysis are the same thing.They overlap, but content analysis has distinct variants, including a summative one that counts words, and its own trustworthiness concepts.
  • Inter-rater agreement scores make any qualitative analysis rigorous.Agreement statistics suit codebook approaches but are not a quality marker in reflexive thematic analysis.
  • A large language model can code clinical text reliably without checking.Model outputs must be validated against human annotation on held-out data, and patient text must stay within approved, secure systems.

Skills you will practise

  • Qualitative content analysis
  • Reflexive thematic analysis
  • Framework method
  • Clinical NLP evaluation
  • LLM validation and privacy
  • Reporting to SRQR

Text as evidence in medicine

Medical research generates large amounts of text: interview and focus group transcripts, free-text answers in surveys, clinical notes and discharge letters in electronic health records (EHRs), patient forum posts, guidelines and policy documents. Each source can answer questions that structured data cannot, such as how patients make sense of a diagnosis, why clinicians depart from a guideline, or what side effects are recorded only in narrative notes.

The analytic approach depends on the source and the question. Interview data about experience call for qualitative methods in which the researcher interprets meaning. Hundreds of thousands of clinical notes call for computational methods that extract defined information at scale. Many projects need both, for example qualitative analysis of a sample of notes to define what a natural language processing (NLP) system should extract. A reliable analysis begins early and proceeds systematically, so that a modest, well-chosen sample can yield findings relevant beyond the study itself (Ziebland & McPherson, 2006).

Qualitative content analysis

Content analysis is widely used in nursing and health research. Hsieh and Shannon (2005) distinguish three approaches by how codes are developed:

  • Conventional: codes and categories are derived inductively from the data, suited to phenomena with little prior theory.
  • Directed: analysis starts from an existing theory or prior findings, which supply initial codes that the data then extend or challenge.
  • Summative: analysis starts by identifying and counting key words or content, then moves to interpreting their underlying meaning in context.

Graneheim and Lundman (2004) provide a widely used procedure. The text is divided into meaning units, which are condensed, abstracted into codes and grouped into categories, with themes expressing latent meaning across categories. They distinguish manifest content (what the text visibly says) from latent content (its underlying meaning) and frame trustworthiness in terms of credibility, dependability and transferability. A thesis should say which level it works at, because interpreting latent content demands more justification.

Thematic and framework analysis

Braun and Clarke (2006) set out thematic analysis in six phases: familiarisation, generating initial codes, searching for themes, reviewing themes, defining and naming themes, and producing the report. Their later work clarifies that "thematic analysis" is a family of methods. In reflexive thematic analysis, the researcher's subjectivity is treated as a resource, themes are patterns of shared meaning built around a central concept, and measures of coding agreement are not appropriate quality markers; coding reliability and codebook approaches follow different logics (Braun & Clarke, 2021). Writing that "themes emerged" hides these choices.

The framework method, developed in applied policy research, organises coded data into a matrix of cases by codes or themes, which makes it easy to compare across participants and to work in multidisciplinary teams (Gale et al., 2013). Smith and Firth (2011) describe its stages and illustrate its use in health research. In health services research, Bradley et al. (2007) show how different kinds of codes, such as conceptual, relationship and participant perspective codes, support the development of a taxonomy, themes or theory.

Choosing an approach to textual data in medical research
ApproachBest suited toAnalytic outputWatch out for
Conventional content analysisLittle prior theory; descriptive questionsCategories derived from dataStaying descriptive when interpretation is needed
Directed content analysisExtending or testing a theoryTheory-based categories, refinedOverlooking data that do not fit the framework
Summative content analysisUse of terms in documents or notesCounts plus interpretation of contextTreating frequency as importance
Reflexive thematic analysisMeaning, experience, interpretationThemes as patterns of shared meaningReporting kappa or "emerging" themes
Framework methodApplied, policy and team-based studiesCase-by-theme matrixMechanical charting without interpretation
Clinical NLP or LLM extractionDefined variables from large volumes of notesStructured variables with error ratesUnvalidated outputs and privacy breaches

Natural language processing on clinical text

When the aim is to turn large volumes of clinical text into structured variables, for example smoking status, symptoms, adverse events or cancer stage, the relevant methods are NLP and clinical information extraction. Wang et al. (2018) reviewed clinical information extraction applications and found a considerable gap between the many clinical studies that use EHR data and the smaller number that use information extraction from clinical text. Clinical notes are difficult: they are full of abbreviations, negation ("no chest pain"), uncertainty, copied text and local conventions, so a method that works in one hospital may fail in another.

Topic modelling and sentiment analysis are often suggested for patient feedback or social media. They can help explore large corpora, but they are not substitutes for qualitative interpretation: topics must be named and checked by reading the texts, and general-purpose sentiment tools may misread clinical language. Treat their outputs as leads to be verified.

Large language models: promise and limits

Since 2023, large language models (LLMs) have been applied to summarising notes, extracting variables and suggesting qualitative codes. Thirunavukarasu et al. (2023) review their potential in medicine alongside their limitations: they can produce fluent but false content, reproduce biases in their training data and raise unresolved questions about privacy and data protection when patient information is involved. Performance also varies considerably between tasks.

Three safeguards follow for a doctoral project. First, validate: compare model output with a human-annotated reference set that was not used to develop prompts or fine-tune the model, and report error rates by subgroup. Second, protect privacy: identifiable patient text should be processed only in environments approved by your ethics committee and data controller, never pasted into a public chatbot. Third, report transparently: the TRIPOD-LLM guideline asks authors to describe the model and version, prompts, data sources and dates, steps taken to avoid overlap between test data and training data, and the qualifications and instructions of human evaluators (Gallifant et al., 2025).

A worked example: matching methods to sources

Consider a hypothetical doctoral project on a new community service for people with type 2 diabetes. It has three textual sources, and each needs a different approach.

  1. Interviews with 25 patients about living with the service. The question concerns experience and meaning, so reflexive thematic analysis fits, with the researcher's position described and themes built around central concepts (Braun & Clarke, 2021).
  2. Free-text comments from 1,200 service questionnaires. Here a conventional content analysis gives a descriptive map of what users raise, and a summative step can show how often a category appears, interpreted in context rather than ranked as importance (Hsieh & Shannon, 2005).
  3. Clinical notes from which the project wants to identify recorded hypoglycaemia. A rule-based or model-based extraction tool is developed on one set of notes and tested against manual chart review on a separate set, with sensitivity and positive predictive value reported.

The numbers are illustrative only. The point is that one project can legitimately use three methods, provided each is named, justified and reported by its own standards, and the thesis explains how the findings relate to one another.

Rigour and what to report

Reporting is where many textual studies fall short. Raskind et al. (2019) reviewed qualitative articles in a health behaviour journal and found that analytic procedures and strategies for trustworthiness were often described unclearly. The Standards for Reporting Qualitative Research (SRQR) provide a checklist covering approach, researcher characteristics and reflexivity, sampling, data processing, analysis and trustworthiness (O'Brien et al., 2014).

What to report in a textual analysis study
ReportWhy it matters
Named analytic approach and its variant (e.g. directed content analysis, reflexive TA)Each has different procedures and quality criteria
Data source, sampling and how text was preparedReaders judge transferability and bias
Who coded, how codes were developed and how disagreements were handledShows the analytic process
Researcher position and reflexivityRequired by SRQR; central in reflexive TA
Quality strategy matched to the approachAgreement statistics only where the approach supports them
For NLP or LLM work: model, version, prompts, reference standard, error ratesRequired by TRIPOD-LLM
Ethics approval, consent and data protection arrangementsPatient text is sensitive personal data

Common mistakes

  • Writing that themes "emerged" without describing how they were constructed.
  • Mixing the language of reflexive thematic analysis with inter-rater reliability scores.
  • Calling word counts "content analysis" without interpreting their meaning in context.
  • Using a framework matrix as a filing system and never moving to interpretation.
  • Reporting topic models or sentiment scores as findings without reading the underlying texts.
  • Evaluating an NLP or LLM tool on the same notes used to build its prompts or rules.
  • Sending identifiable patient text to an external service not covered by the ethics approval.
  • Citing a methods paper for a finding it does not report; check each citation against the source.

Before submission, ask whether another researcher could follow your path from raw text to conclusions, and whether every automated step has been checked against human judgement. If either answer is no, the analysis is not yet ready to report.

Key takeaways

  • Choose conventional, directed or summative content analysis according to how codes should arise (Hsieh & Shannon, 2005).
  • Reflexive thematic analysis treats themes as researcher-constructed and does not rely on agreement statistics (Braun & Clarke, 2021).
  • The framework method suits applied, team-based studies that compare across cases (Gale et al., 2013).
  • Clinical NLP and LLM outputs must be validated on held-out, human-annotated data and reported to TRIPOD-LLM (Gallifant et al., 2025).
  • Keep patient text within approved, secure systems; LLMs raise unresolved privacy concerns (Thirunavukarasu et al., 2023).
  • Use SRQR to report the analytic approach, reflexivity and trustworthiness (O'Brien et al., 2014).
Your next step

Want to apply this to your own study?

  1. 1Tell us your topic, data and deadline
  2. 2A subject mentor reviews your work with you
  3. 3You get a plan and a quote
Textual and content analysis

References

  1. Bradley, E. H., Curry, L. A., & Devers, K. J. (2007). Qualitative data analysis for health services research: Developing taxonomy, themes, and theory. Health Services Research, 42(4), 1758–1772. https://doi.org/10.1111/j.1475-6773.2006.00684.x
  2. Braun, V., & Clarke, V. (2006). Using thematic analysis in psychology. Qualitative Research in Psychology, 3(2), 77–101. https://doi.org/10.1191/1478088706qp063oa
  3. Braun, V., & Clarke, V. (2021). One size fits all? What counts as quality practice in (reflexive) thematic analysis? Qualitative Research in Psychology, 18(3), 328–352. https://doi.org/10.1080/14780887.2020.1769238
  4. Gale, N. K., Heath, G., Cameron, E., Rashid, S., & Redwood, S. (2013). Using the framework method for the analysis of qualitative data in multi-disciplinary health research. BMC Medical Research Methodology, 13, 117. https://doi.org/10.1186/1471-2288-13-117
  5. Gallifant, J., Afshar, M., Ameen, S., Aphinyanaphongs, Y., Chen, S., Cacciamani, G., Demner-Fushman, D., Dligach, D., Daneshjou, R., Fernandes, C., Hansen, L. H., Landman, A., Lehmann, L., McCoy, L. G., Miller, T., Moreno, A., Munch, N., Restrepo, D., Savova, G., . . . Bitterman, D. S. (2025). The TRIPOD-LLM reporting guideline for studies using large language models. Nature Medicine, 31, 60–69. https://doi.org/10.1038/s41591-024-03425-5
  6. Graneheim, U. H., & Lundman, B. (2004). Qualitative content analysis in nursing research: Concepts, procedures and measures to achieve trustworthiness. Nurse Education Today, 24(2), 105–112. https://doi.org/10.1016/j.nedt.2003.10.001
  7. Hsieh, H.-F., & Shannon, S. E. (2005). Three approaches to qualitative content analysis. Qualitative Health Research, 15(9), 1277–1288. https://doi.org/10.1177/1049732305276687
  8. O'Brien, B. C., Harris, I. B., Beckman, T. J., Reed, D. A., & Cook, D. A. (2014). Standards for reporting qualitative research: A synthesis of recommendations. Academic Medicine, 89(9), 1245–1251. https://doi.org/10.1097/ACM.0000000000000388
  9. Raskind, I. G., Shelton, R. C., Comeau, D. L., Cooper, H. L. F., Griffith, D. M., & Kegler, M. C. (2019). A review of qualitative data analysis practices in health education and health behavior research. Health Education & Behavior, 46(1), 32–39. https://doi.org/10.1177/1090198118795019
  10. Smith, J., & Firth, J. (2011). Qualitative data analysis: The framework approach. Nurse Researcher, 18(2), 52–62. https://doi.org/10.7748/nr2011.01.18.2.52.c8284
  11. Thirunavukarasu, A. J., Ting, D. S. J., Elangovan, K., Gutierrez, L., Tan, T. F., & Ting, D. S. W. (2023). Large language models in medicine. Nature Medicine, 29(8), 1930–1940. https://doi.org/10.1038/s41591-023-02448-8
  12. Wang, Y., Wang, L., Rastegar-Mojarad, M., Moon, S., Shen, F., Afzal, N., Liu, S., Zeng, Y., Mehrabi, S., Sohn, S., & Liu, H. (2018). Clinical information extraction applications: A literature review. Journal of Biomedical Informatics, 77, 34–49. https://doi.org/10.1016/j.jbi.2017.11.011
  13. Ziebland, S., & McPherson, A. (2006). Making sense of qualitative data analysis: An introduction with illustrations from DIPEx (personal experiences of health and illness). Medical Education, 40(5), 405–414. https://doi.org/10.1111/j.1365-2929.2006.02467.x

How to cite this article

Choose your referencing style, then copy. Check your university's or journal's guide for local variations.

PhD Research Lab Academy. (2025, November 14). Textual data analysis in medical research: from content analysis to language models. PhD Research Lab. https://www.phdassistance.com/academy/how-to-article/textual-data-analysis-in-medical-research/

PhD Research Lab Academy. “Textual Data Analysis in Medical Research: From Content Analysis to Language Models.” PhD Research Lab, 14 Nov. 2025, www.phdassistance.com/academy/how-to-article/textual-data-analysis-in-medical-research. Accessed [access date].

PhD Research Lab Academy (2025) Textual data analysis in medical research: from content analysis to language models. PhD Research Lab. Available at: https://www.phdassistance.com/academy/how-to-article/textual-data-analysis-in-medical-research/ (Accessed: [access date]).

PhD Research Lab Academy. “Textual Data Analysis in Medical Research: From Content Analysis to Language Models.” PhD Research Lab. November 14, 2025. https://www.phdassistance.com/academy/how-to-article/textual-data-analysis-in-medical-research.

PhD Research Lab Academy, ‘Textual Data Analysis in Medical Research: From Content Analysis to Language Models’ (PhD Research Lab, 14 November 2025) <https://www.phdassistance.com/academy/how-to-article/textual-data-analysis-in-medical-research> accessed [access date].

PhD Research Lab Academy. Textual data analysis in medical research: from content analysis to language models [Internet]. PhD Research Lab; 2025 Nov 14 [cited [access date]]. Available from: https://www.phdassistance.com/academy/how-to-article/textual-data-analysis-in-medical-research/

PhD Research Lab Academy, “Textual data analysis in medical research: from content analysis to language models,” PhD Research Lab, Nov. 14, 2025. [Online]. Available: https://www.phdassistance.com/academy/how-to-article/textual-data-analysis-in-medical-research. [Accessed: [access date]].

@online{textual_data_analysis_in_medical_research_2025,
  author = {{PhD Research Lab Academy}},
  title = {{Textual data analysis in medical research: from content analysis to language models}},
  organization = {PhD Research Lab},
  date = {2025-11-14},
  url = {https://www.phdassistance.com/academy/how-to-article/textual-data-analysis-in-medical-research},
  urldate = {[access date]}
}

This article is for learning. Use it to understand the method and cite the original sources above in your own work; do not copy or submit it as your own.

Textual data analysis in medical researchNeed help applying it to your study?
Textual and content analysis