
Start your learning journey with confidence! In this introductory section, we’ll guide you through what to expect from the course, how to navigate the content effectively, and tips to get the most out of your learning experience. Whether you’re a beginner or looking to refresh your skills, this welcome module will set you up for success and make your learning experience smooth and enjoyable.
Learn how to launch Stata and prepare your workspace for data analysis. In this section, we’ll guide you step by step on opening the software, understanding the interface, and setting up your first project. This ensures you’re ready to dive into Stata confidently and start exploring your data efficiently.
In this video, students will learn how to open datasets in Stata using multiple methods. We will cover opening built-in sample datasets, importing data from external files, and understanding dataset structure. This lecture ensures you can quickly load clean data and prepare for analysis with confidence.
The Example datasets are available here: https://github.com/ahshanulhaque/Stata-Example-Data
Learn how to launch and navigate Stata on a Windows computer with ease. This section covers opening the software, exploring the interface, and setting up your workspace for efficient data analysis. Perfect for beginners, it ensures you are ready to start your Stata journey on Windows confidently.
This lecture introduces the DO file, one of the most powerful tools in Stata. Students will learn how to write, edit, and run scripts using DO files, making their workflow more efficient and reproducible. We'll explain why using syntax is better than point-and-click for long-term projects and how to save your commands for future use.
Welcome to this essential lesson on Data Types in Stata! Whether you're a beginner or someone looking to strengthen your foundational understanding of Stata, this video will help you clearly understand how Stata handles different types of data — a crucial step before running any analysis.
? In this video, you will learn:
The difference between string and numeric variables
How to check the data type of a variable
Common issues caused by incorrect data types
How to convert between data types
Practical examples using real-world datasets
This lesson is part of our Stata for Public Health & Biostatistics course, designed to help you confidently perform data analysis and research.
? Perfect for students, researchers, healthcare professionals, and data analysts working with Stata in the fields of public health, demography, social science, and beyond.
In this video, you will learn how to use arithmetic operators in Stata to perform basic calculations and create new variables. We will explore how to add, subtract, multiply, and divide variables within your dataset. You’ll also see practical examples of using operators to compute Body Mass Index (BMI), age difference, and other common public health variables. This lesson is perfect for beginners in public health, epidemiology, or any data-driven field using Stata.
✅ What you'll learn:
How to use +, -, *, /, and ^ in Stata
Creating new calculated variables using generate
Real-world examples for public health datasets
No prior coding experience is required—just follow along step by step.
Welcome to this beginner-friendly tutorial on using logical operators in Stata. Logical operators are essential tools in data analysis, especially when filtering, subsetting, or applying conditions in your commands. In this video, you’ll learn:
✅ What logical operators are in Stata
✅ How to use ==, !=, <, >, <=, and >=
✅ The use of & (and), | (or), and ! (not)
✅ How to combine multiple conditions effectively
✅ Practical examples using real datasets
Whether you're a new Stata user or reviewing key concepts, this video will help you confidently apply logical conditions in your analyses.
In this video, you will learn how to use log files in Stata to save your entire session, including all commands and output. Log files are essential when you want to track your work, document your analysis, or share your code with others.
By the end of this tutorial, you will be able to:
Create and open a new log file
Save all your commands and output for future reference
Close and manage log files properly
Understand different file formats like .log and .smcl
Avoid common mistakes when using log files
? This lesson is highly recommended for researchers, students, and professionals who want to make their data analysis transparent, reproducible, and well-documented.
Welcome to this hands-on tutorial where you'll learn how to import Excel data into Stata quickly and efficiently. Whether you're a beginner or refreshing your Stata skills, this lesson will help you understand how to bring your .xls or .xlsx datasets into the Stata environment for analysis.
✅ In this video, you’ll learn:
• How to prepare your Excel sheet before importing
• Different ways to import Excel files into Stata
• Tips for avoiding common import errors
• How to verify and clean imported data
? Sample data used in the video is provided for practice.
? This lesson is ideal for students, researchers, and professionals in public health, economics, social science, and more who are new to data analysis with Stata.
? By the end of this session, you’ll be confident in handling Excel data in Stata and ready to move on to deeper analysis.
Welcome to this hands-on tutorial where you'll learn how to import CSV data into Stata with ease. If you're working with public health, economics, social science, or any research data saved in CSV format, this step-by-step video will guide you through the process of getting your data ready for analysis in Stata.
? What You’ll Learn:
How to open CSV files in Stata using the GUI and command line
Tips to avoid common import errors (e.g., string and numeric issues)
How to use import delimited for full control
Saving the imported data as a .dta Stata file
Brief look at inspecting your data after import
? Tools Used:
Stata (any version: 13, 14, 15, 16, or 17)
Sample CSV dataset (link in course resources)
This lesson is part of the "Beginner's Guide to Stata for Public Health and Social Science Research" series on Udemy.
Let’s dive in and start analyzing your data!
In this video, you will learn how to define and label variables properly in Stata — a crucial step for keeping your dataset clean, organized, and ready for analysis. Whether you're a beginner or brushing up on your skills, this lesson will help you understand how to use the label variable and label define commands efficiently.
✅ What you’ll learn:
How to assign descriptive labels to variables
How to define value labels for categorical variables
How to attach value labels using the label values command
Best practices for making your dataset easy to read and interpret
This tutorial is part of the Stata for Public Health & Data Science Beginners course and is compatible with Stata 15 and above.
? No prior coding experience is required.
?️ Perfect for students, researchers, and professionals in social science, public health, and economics.
Welcome to this easy and practical tutorial on Value Labels in Stata!
In this lesson, you'll learn how to assign human-readable labels to your numeric variable values, making your dataset more understandable and your outputs more readable.
Whether you're working with survey data, categorical variables, or preparing your dataset for reporting—value labels are a vital part of clean and professional data analysis in Stata.
? In this video, you will learn:
What value labels are and why they matter
How to create a value label using label define
How to assign value labels to a variable using label values
How to view and remove labels
Practical examples for better understanding
? Software Requirement: Stata 15 or above (recommended)
?? Who is this for?
Public health researchers
Social science students
Data analysts
Beginners in Stata
Let’s make your data more meaningful.
Hit play and start learning now!
In this video, you will learn how to sort your dataset in Stata using simple commands. Sorting helps you organize your data for better analysis. We’ll explain how to use the sort and gsort commands and when to use them. By the end of the video, you’ll be able to arrange your data in ascending or descending order based on any variable.
In this lesson, we will show you how to change the order of variables in your dataset. You will learn how to use the order command to move variables to the front or any specific position. This helps keep your dataset clean and organized, especially before exporting or sharing.
This video will teach you how to drop unwanted variables or keep only the ones you need using drop and keep commands. You’ll see practical examples and understand how to reduce the size of your dataset or focus on specific variables for analysis.
In this video, you’ll learn how to remove specific observations (rows) or keep only the ones you want. We’ll explain how to use conditions with drop if and keep if. This is useful when cleaning data or preparing a subset for analysis.
Learn how to rename variables in your dataset to make them easier to understand. This short lesson covers the rename command and gives tips on naming conventions for better readability and consistency in your analysis.
In this video, we focus on identifying duplicate observations using duplicates report and duplicates list. You will also learn how to drop duplicates if necessary. This is an essential part of cleaning data and ensuring accuracy.
Missing data is common in real-world datasets. This lesson will teach you how to identify, count, and manage missing values in Stata. You’ll understand how to use the missing() function and filter missing data effectively.
Variables in Stata can have numeric values and associated labels. This video explains how to display value labels, assign new ones using label define and label values, and how labels help make your data more readable during analysis.
This lesson covers how to update or modify data using the replace command. You’ll learn how to apply changes conditionally, avoid common errors, and make sure your changes apply only to the intended observations.
Creating new variables is an essential skill in Stata. In this video, you will learn how to use the generate command to create variables from scratch or based on existing variables. You’ll see how this can be used for grouping, recoding, and calculations.
Welcome to this Stata tutorial on the recode command, designed especially for public health, social science, and data science learners. In this video, you will learn how to transform your variables by collapsing or regrouping values using recode—a powerful tool when preparing data for analysis.
We’ll cover:
✅ What is the recode command and why it’s useful
✅ How to recode numeric variables
✅ How to create new variables while recoding
✅ Handling missing values during recoding
✅ Best practices and common mistakes to avoid
Whether you're preparing categorical variables or simplifying ranges for analysis, this video is a practical guide for data cleaning in Stata.
?? No matter your experience level, you’ll benefit from the step-by-step examples shown on screen.
In this video, you will learn an alternative method for recoding data in Stata, which is especially useful when working with large datasets or when you need more flexibility in defining value categories. We’ll walk through practical examples that show how to recode variables using commands beyond the basic recode function, such as generate, replace, and cond().
By the end of this lesson, you’ll be able to:
Understand when and why to use alternative recoding methods
Apply conditional logic to recode values
Increase your confidence in data transformation tasks within Stata
Whether you're a beginner or looking to expand your Stata skills, this lesson will help you handle data recoding with more control and precision.
gen mage_new2 = 1 if mage>=15 & mage<26
replace mage_new2 = 2 if mage>=26 & mage<36
replace mage_new2 = 3 if mage>=36 & mage<51
la de mage_new2 1 "15-25" 2 "26-35" 3 "36-50", replace
la val mage_new2 mage_new2
la var mage_new2 "Maternal age group"
In this lesson, you will learn how to use the encode command in Stata. This command is useful when you have string variables (like names of districts, categories, etc.) and want to convert them into numeric variables with value labels for further analysis.
✅ Topics Covered:
When to use encode instead of destring
Syntax of the encode command
Checking the results with list or browse
How value labels are automatically generated
How to interpret encoded variables
? Perfect for beginners and public health researchers working with categorical string data!
Are you struggling to convert string variables to numeric format in Stata? This concise and practical tutorial will guide you through the essential commands and techniques to transform your string data into numeric variables correctly and efficiently.
In this course, you will learn:
What string and numeric variables are in Stata
Why and when you need to convert string variables to numeric
How to use the destring command for straightforward conversions
How to handle strings with non-numeric characters using options like ignore() and force
How to use encode for converting categorical string variables into numeric factors with value labels
Troubleshooting common issues during conversion
Best practices for data cleaning before conversion
This tutorial is perfect for beginners and intermediate Stata users who want to improve their data management skills and prepare their datasets for analysis.
Start converting your string variables to numeric in Stata confidently and unlock more powerful data analysis options today!
In this tutorial, you will learn how to efficiently automate repetitive tasks in Stata using the forvalues and foreach loop structures. These powerful looping commands are essential for managing large datasets, creating variables, or applying the same operations across multiple variables.
You will learn:
The difference between forvalues and foreach
How to use forvalues to iterate over numeric ranges
How to use foreach to loop over lists of variable names
Best practices for combining loops with conditional statements
Real-life examples to simplify your data analysis workflow
Whether you're working with survey data or running multiple regressions, mastering loops will save you time and reduce errors in your code. Perfect for beginners and intermediate Stata users!
Learn how to create and manage dummy (binary) variables in Stata to enhance your data analysis! Dummy variables are essential in regression models, categorical data analysis, and more. This practical course will teach you how to generate dummy variables easily and correctly.
In this course, you will discover:
What dummy variables are and why they matter
How to create dummy variables manually using gen and replace commands
Using the tabulate command with generate() to create dummies automatically
Creating dummy variables from categorical string or numeric variables
How to handle multiple categories and avoid the dummy variable trap
Applying dummies in regression and interpretation tips
Best practices for labeling and managing dummy variables
Perfect for students, researchers, and data analysts working with Stata who want to expand their data preparation skills.
In this video, you will learn how to create a binary (dummy) variable in Stata — a variable that takes only two values, typically 0 and 1. Binary variables are essential in data analysis, especially when preparing data for regression models or categorical comparisons.
We’ll guide you step by step using simple examples to show how to generate a binary variable based on conditions using the generate and replace commands. You’ll also understand how to label the values for easier interpretation in your analysis.
By the end of this lesson, you’ll be able to:
Understand what a binary variable is and when to use it
Create binary variables using conditional logic
Use generate, replace, and label define effectively in Stata
This video is ideal for beginners and those looking to strengthen their data management skills in Stata.
Do you need to combine multiple datasets efficiently in Stata? This step-by-step course will teach you everything you need to know about merging datasets — whether you want to merge by key variables, append files, or join data from different sources.
In this course, you will learn:
The difference between merge and append commands
How to merge datasets using one-to-one, one-to-many, and many-to-many relationships
Preparing datasets for merging: cleaning and sorting data
Handling merge results and interpreting _merge variable
Troubleshooting common merge errors and conflicts
Practical examples of merging household, survey, and panel data
Best practices for data management during merges
This course is perfect for researchers, students, and data analysts working with multiple datasets who want to combine them accurately for analysis.
Start merging your data confidently and streamline your workflow in Stata!
Want to combine datasets by stacking them one after another? This tutorial covers the essential steps to append datasets in Stata, helping you expand your data efficiently.
In this course, you will learn:
What appending means and when to use it
How to use the append command to add observations from one dataset to another
Preparing datasets for appending — matching variable names and formats
Handling variables that exist in only one dataset
Practical examples of appending survey waves, panel data, and repeated cross-sections
Tips to avoid common mistakes during appending
Ideal for beginners and intermediate users who want to manage their data effectively in Stata.
Start appending your datasets like a pro and prepare your data for seamless analysis!
In this lecture, students will discover how to create basic graphs in Stata to explore their data visually. We'll cover bar charts, pie charts, histograms, box plots, and scatter plots. You’ll also learn when and why to use each type of graph for different types of data.
This lecture focuses on analyzing individual variables. Students will learn how to generate summary statistics such as mean, median, standard deviation, frequency tables, and proportions. The lecture helps in understanding distributions and basic characteristics of data.
Here, we move on to analyzing relationships between two variables. Students will learn how to use cross-tabulations, compare group means, and run two-way tables. The focus is on understanding associations using simple tools and interpreting them correctly.
Welcome to this practical tutorial on how to make summary tables using Stata 18. In this video, we will demonstrate the step-by-step process of creating clear and well-formatted tables for your research or report using the table command, which is newly enhanced in Stata 18.
This lecture covers how to estimate a 95% confidence interval for a mean or proportion. Students will learn what a confidence interval means, how to interpret it correctly, and how to generate it in Stata using simple commands.
Students will explore how to perform t-tests to compare means between two groups. We will cover both independent sample and paired t-tests, explaining when to use each type. Output interpretation, assumptions checking, and real-world examples will be discussed.
In this lecture, students will learn how to perform one-way Analysis of Variance (ANOVA) to compare means across more than two groups. They will understand the F-statistic, post-hoc testing, and interpretation of results. This is essential for analyzing survey or experimental data with multiple categories.
For data that do not meet parametric assumptions, this lecture introduces non-parametric tests such as the Wilcoxon rank-sum and Kruskal-Wallis tests. Students will learn how to conduct these tests in Stata and interpret results when the assumptions of normality or equal variance are violated.
This lecture introduces linear regression in Stata, one of the most widely used statistical models. Students will learn how to model relationships between continuous outcomes and predictor variables, interpret coefficients, check model fit, and understand assumptions like linearity and homoscedasticity.
Understand how to include and interpret categorical predictors in linear regression models using Stata. This lesson explains dummy variable creation, reference categories, interpretation of coefficients, and practical examples from real-world datasets. Ideal for learners who want to handle categorical data correctly in regression analysis.
Learn how to perform multiple linear regression analysis in Stata to explore the effect of several independent variables on a continuous outcome. This lesson explains model building, interpretation of coefficients, checking multicollinearity, and evaluating model fit using real data examples.
Understand how to test and validate key regression assumptions in Stata. This lesson explains how to assess normality of residuals, check linearity between variables, and visualize diagnostic plots. Gain practical skills to ensure your regression models meet statistical assumptions for reliable interpretation.
Learn how to identify and manage outliers in your dataset using Stata. This lesson covers graphical and statistical methods for detecting unusual observations, understanding their impact on regression results, and applying appropriate techniques to handle them effectively for accurate analysis.
Understand how to detect and interpret multicollinearity in regression models using the Variance Inflation Factor (VIF) in Stata. This lesson explains the concept of VIF, threshold values, and strategies to address high multicollinearity for more stable and reliable regression estimates.
Students will learn how to perform logistic regression when the outcome is binary (e.g., yes/no, success/failure). This lecture will explain odds ratios, model fit statistics, and how to interpret logistic regression output in the context of practical data analysis.
This advanced lecture explains how to conduct log-binomial regression in Stata, especially useful in public health and epidemiology. Students will learn how to estimate risk ratios directly and understand when to prefer this method over logistic regression.
use "P:\abc\DataExam00.dta", clear
logistic childMal i.group
logistic childMal ib0.group
logistic childMal ib2.csex
logistic childMal cage
logistic childMal ib1.residence
logistic childMal ib5.wealth
logistic childMal ib0.mNutri
logistic childMal ib1.edu
logistic childMal income
logistic childMal ib0.group ib2.csex cage ib1.residence ib5.wealth ib0.mNutri ib1.edu income
coefplot , drop (_cons) xline(1)
reg expenditure income mage i.wealth i.division
coefplot , drop (_cons) xline(0)
In this lecture, you will learn how to perform statistical analysis in Stata using complex survey data that includes clustering and sampling weights. We will cover how to declare survey design using svyset, and how to run models that account for design effects and sampling probabilities. This is crucial for obtaining correct standard errors and valid inferences in your analysis.
*----Sampling Weight and Cluster adjustment
use "P:\abc\MyData.dta"
tab v190
tabulate v190 [aweight = swt]
tab v190 [aweight = swt]
sum mH [aweight = swt]
*
regress mW mH v012 i.v190 i.toilet2 [pweight = swt]
regress mW mH v012 i.v190 i.toilet2 [pweight = swt], cluster( wardcode)
logistic bmiCAT ib1.toilet2 i.v190 v012 [pweight = swt], cluster( wardcode )
*-------------------------------
*----Random effect logistic model
use "P:\abc\MyData.dta"
*
melogit bmiCAT ib0.toilet2, || wardcode:, covariance(exchangeable) or
melogit bmiCAT ib0.toilet2 ib1.v025 ib0.DV ib1.anc2 v012 ib1.edu , || wardcode:R.toilet2 , covariance(exchangeable) or
*--------------------
In this video, you will learn:
How to structure your data for multilevel modeling
Detailed step-by-step commands for running mixed-effects logistic regression
Tips for interpreting odds ratios and fixed/random effects
Best practices for handling clustering and survey weights in Stata
Key strategies for reporting your results in research papers
Perfect for epidemiologists, social scientists, and public health researchers, this guide is tailored for both beginners and advanced users. Boost your statistical analysis skills and ensure accurate, reliable insights from your data!
*----Generalized estimating equation (GEE) for cluster data
use "P:\abc\MyData.dta"
xtset wardcode
xtgee bmiCAT ib0.toilet2 , family(binomial 1) link(logit) corr(exchangeable) eform
xtgee bmiCAT ib1.v025 , family(binomial 1) link(logit) corr(exchangeable) eform
xtgee bmiCAT ib0.DV , family(binomial 1) link(logit) corr(exchangeable) eform
xtgee bmiCAT ib1.anc2 , family(binomial 1) link(logit) corr(exchangeable) eform
xtgee bmiCAT v012 , family(binomial 1) link(logit) corr(exchangeable) eform
xtgee bmiCAT ib1.edu, family(binomial 1) link(logit) corr(exchangeable) eform
xtgee bmiCAT ib0.toilet2 ib1.v025 ib0.DV ib1.anc2 v012 ib1.edu, family(binomial 1) link(logit) corr(exchangeable) eform
svyset wardcode, strata(v024) weight(swt)
svy : mean mH mW ChildAge
svy : proportion bmiCAT toilet2 edu anc2
svy linearized : tabulate bmiCAT toilet2, count ci percent
svy : logistic bmiCAT ib0.toilet2
svy : logistic bmiCAT ib1.v025
svy : logistic bmiCAT ib0.DV
svy : logistic bmiCAT ib1.anc2
svy : logistic bmiCAT v012
svy : logistic bmiCAT ib1.edu
This section uses real Demographic and Health Survey (DHS) datasets from Asia and Africa to demonstrate survey-weighted analysis in Stata. Example datasets include Bangladesh Demographic and Health Survey (BDHS), National Family Health Survey of India (NFHS), Nepal Demographic and Health Survey, Pakistan Demographic and Health Survey, Sri Lanka Demographic and Health Survey, Indonesia Demographic and Health Survey, Philippines National Demographic and Health Survey, Cambodia Demographic and Health Survey, Ethiopia Demographic and Health Survey, Kenya Demographic and Health Survey, Uganda Demographic and Health Survey, Tanzania Demographic and Health Survey, Nigeria Demographic and Health Survey, Ghana Demographic and Health Survey, Rwanda Demographic and Health Survey, Malawi Demographic and Health Survey, and Zambia Demographic and Health Survey.
All analytical steps shown are fully transferable to any DHS country, regardless of region, survey year, or dataset type.
Learn how to identify and select key DHS variables required for child nutrition analysis.
Identify and remove unusual or invalid values (e.g., 99, 999, outliers) before nutrition analysis.
Learn how to correctly set and control decimal places in Stata for DHS sampling weights and key nutrition indicators such as HAZ, WAZ, WHZ, and BMI to ensure accurate analysis and professional reporting.
Create standard child nutrition indicators—stunting, underweight, and wasting—from DHS z-score variables for accurate nutrition analysis and reporting.
Generate key maternal health indicators by creating maternal underweight (BMI < 18.5) and adequate antenatal care (ANC ≥ 4 visits) variables using DHS data for nutrition and maternal health analysis.
Assign clear and meaningful variable labels to newly generated DHS variables to improve data readability, interpretation, and reporting for nutrition and maternal health analysis.
Rename selected DHS variables using clear and meaningful names to improve readability, understanding, and presentation of nutrition and maternal health analyses.
Estimate survey-weighted proportions for key DHS nutrition and maternal health variables using Stata for accurate descriptive analysis and reporting.
Conduct univariate analysis in Stata using svyset to obtain survey-weighted proportions that correctly account for DHS sampling design.
Perform survey-weighted cross-tabulation in Stata using svyset to examine associations between DHS variables with correct proportions and standard errors.
Run a simple survey-weighted logistic regression in Stata using svyset to assess the association between a binary outcome and a single predictor with correct standard errors.
Perform multiple survey-weighted logistic regression in Stata using svyset to examine the adjusted effects of multiple predictors on a binary outcome with correct standard errors.
This course provides a practical and comprehensive guide to Stata, with a strong focus on regression analysis and statistical modelling for real-world research. It is designed for students, researchers, and professionals in biostatistics, epidemiology, public health, and social sciences who want to build solid data analysis skills using Stata.
You will begin with the fundamentals of Stata, including data import, data cleaning, and data management. From the early stages, the course emphasizes hands-on learning using real datasets, helping you develop practical skills that can be applied immediately in research and professional work.
The course then takes you step by step through core statistical techniques, including linear regression, logistic regression, and multivariate analysis. As you progress, you will learn advanced modelling approaches such as probit models, multilevel and hierarchical models, fixed-effects and random-effects regression, panel data analysis, survival analysis, and time-series regression.
A key strength of this course is its focus on application. You will learn how to interpret Stata outputs, check model assumptions, and choose the appropriate statistical methods for different types of health and population data. Each topic is explained clearly and supported with reproducible Stata code and real-world research examples.
Through project-based lessons, you will gain experience applying advanced regression techniques commonly used in epidemiology, public health surveys, medical research, and social science studies. The course also introduces important concepts from research methods and applied econometrics to strengthen your analytical foundation.
By the end of this course, you will be confident in cleaning and managing datasets, running advanced regression models, interpreting results correctly, and creating publication-ready tables and outputs.
Whether your goal is academic research, public health analysis, or professional data projects, this course will equip you with the skills to use Stata effectively and with confidence.
Enroll now to strengthen your expertise in Stata, regression modelling, and applied data analysis for research and beyond.