Tutorials Overview
svy tutorials, survey analysis tutorial, complex survey Python tutorial, survey sampling guide
Tutorials Overview
These tutorials provide hands-on guidance for using svy to design, conduct, and analyze complex surveys. By the end, you’ll understand how to handle real-world survey data from initial planning through final statistical inference.
Prerequisites: Basic familiarity with Python syntax and introductory survey sampling concepts.
What You’ll Learn
This tutorial series covers the complete survey workflow:
- Data preparation - Import, clean, and transform survey data
- Survey design - Plan samples, calculate required sizes, and optimize allocation
- Sample selection - Draw probability samples using standard methods
- Weighting - Create and calibrate survey weights for nonresponse and coverage
- Estimation - Produce population estimates with design-based variance
- Modeling - Fit regression models that account for complex designs
Tutorial Structure
Getting Started
Installation - Set up svy with pip or uv, configure your environment
Quick Tour - Five-minute introduction to the Sample object and core workflow
Data Preparation
Wrangling - Clean column names, recode variables, bin continuous data, create new variables
Survey Design
Planning - Calculate sample sizes, perform power analysis, allocate samples across strata
Implementation
Sample Selection - Draw samples using SRS, systematic, PPS, stratified, and multi-stage designs
Weighting - Compute design weights, adjust for nonresponse, calibrate to population totals
Analysis
Estimation - Calculate means, totals, proportions, and ratios with proper standard errors
Generalized Linear Models - Fit linear, logistic, and Poisson regression models with survey weights
Learning Approach
Each tutorial follows a consistent structure:
- Concept introduction - Brief explanation of the statistical method
- Real-world examples - Practical applications with survey data
- Step-by-step workflow - Clear instructions from start to finish
- Common pitfalls - Mistakes to avoid and how to fix them
- Next steps - Links to related topics and advanced techniques
Recommended Path
For new users: Follow tutorials in order from Installation through Estimation. This builds knowledge progressively.
For experienced survey analysts: Jump directly to topics of interest. Each tutorial is self-contained with cross-references.
For quick reference: Use tutorials as a cookbook—find the section matching your task and adapt the examples.
Statistical Background
These tutorials emphasize practical application over statistical theory. For comprehensive coverage of survey sampling methodology, we recommend:
Core Textbooks: - Sampling: Design and Analysis (3rd ed.) by Sharon Lohr - Applied Survey Data Analysis (3rd ed.) by West & Heeringa - Statistics in Survey Sampling by Kwang & Kim
Official Guidelines: - UN Household Survey Handbook (2005 edition, revision in development) - Designing Household Survey Samples: Practical Guidelines (UN Statistics Division)
Additional resources are cited throughout the tutorials where relevant.
Getting Help
While working through tutorials:
- Check examples - Most questions are answered by the provided code
- Read error messages - svy provides clear, actionable error descriptions
- Review concepts - Each tutorial links to prerequisite topics
- Ask the community - Post questions on GitHub Discussions
What’s Not Covered
These tutorials focus on design-based inference for probability samples. Topics outside this scope:
- Non-probability samples - Opt-in surveys, convenience samples
- Bayesian survey analysis - Model-based posterior inference
- Time series surveys - Panel data, rotating designs
- Spatial surveys - Geostatistical methods, area sampling
- Small area estimation - See svy-sae documentation
Ready to Start?
Begin with the Installation Guide to set up your environment, then move to the Quick Tour for your first analysis.
Let’s get started!
Continue to Installation →