Section 01
Introduction: A Practical Guide to LLM Applications in Public Opinion Research
This article introduces the companion GitHub code repository for the monograph Large Language Models for Public Opinion Research: A Practical Guide published by Cambridge University Press, maintained by authors such as Ryan Kennedy. It systematically explains how to use large language models (LLMs) for public opinion research, covering the complete workflow including API interaction, prompt engineering, and silicon-based sampling (synthetic data generation and validation). The code is written in R language, and it also discusses methodological controversies and diverse application scenarios.