Online Stata Tutor: Learn Stata Properly, From Your Own Work
Stata is the standard statistical package in economics and much of public health, epidemiology and the social sciences. It is powerful and well documented, but its command syntax, do-files and output can feel intimidating, especially when you meet it for the first time on a module with a coursework deadline, or when your dissertation data arrive and you are expected to analyse them yourself.
An online Stata tutor shortens that learning curve. Instead of searching forums for the right command, you work through your own problem with someone who explains what each command does, why a particular method fits your question, and how to read and report the results. Lessons are private and one-to-one, so they follow your dataset, your module and your level, whether you are typing your first summarize or estimating a staggered difference-in-differences model.
This page explains what Stata tutoring covers, how lessons work and how to choose a Stata tutor. It also includes a beginner Stata tutorial that walks through the first steps using Stata's built-in example data.
Learning, not outsourcing. Lessons teach you to run and understand your own analysis. Assessed work, dissertations and theses remain your own, and results are never fabricated.
Why Students Look for a Stata Tutor
Most people who contact a Stata tutor are not short of effort. They are stuck on a specific point that the course materials do not explain clearly. Common situations include:
- "My module uses Stata and I have never written code." Many economics and health students meet command-based software for the first time at university.
- "My data will not merge, reshape or import properly." Data management usually takes longer than the analysis, and small errors silently change results.
- "I ran the regression but do not know what the output means." Coefficients, standard errors, F tests and marginal effects need interpreting in context.
- "My supervisor wants fixed effects, clustered errors or an event study." Advanced econometric methods have assumptions and choices that the help files assume you already understand.
- "I need my do-file to be reproducible." Supervisors and journals increasingly expect clean, rerunnable code.
- "I know SPSS or R, but my new course uses Stata." The statistics are familiar; the workflow is not.
What Stata Tutoring Covers
Lessons are built around what you need, but most Stata tuition draws on the following areas.
Getting started with Stata
The interface and command syntax
The Command, Results, History and Variables windows, the Data Editor, menus and dialogs, and the general pattern of a Stata command: a command name, a list of variables, optional if and in conditions, and options after a comma.
Do-files, logs and the help system
Writing commands in a do-file rather than typing them one by one, adding comments, keeping a log of your results, and using help and the PDF manuals effectively.
Data management and cleaning
Importing and saving data
Reading Excel and CSV files with import excel and import delimited, opening and saving Stata datasets, and checking that variables arrived with the right types.
Creating, recoding and labelling variables
generate, replace, egen, recode, variable and value labels, converting text to numbers with destring and encode, and working with dates.
Missing values
How Stata stores missing values, why if x > 100 also selects missing values, and how to count, recode and handle missing data deliberately.
Merging, appending and reshaping
One-to-one and many-to-one merges with merge, checking the _merge results, stacking datasets with append, and converting between wide and long formats with reshape, which panel data usually requires.
Descriptive statistics, tables and graphs
Summaries and tables
summarize, tabulate, tabstat and table for descriptive statistics, frequencies and cross-tabulations, and producing a clean "Table 1" of sample characteristics.
Graphs
Histograms, box plots, scatter plots with fitted lines, bar charts and coefficient plots, and editing and exporting graphs at publication quality.
Exporting results
Getting tables out of Stata and into Word or Excel with putexcel, etable and the collect system, or the widely used community-contributed esttab.
Statistical tests in Stata
- One-sample, independent and paired t-tests with
ttest. - One-way and factorial ANOVA with
onewayandanova. - Chi-square tests with
tabulate, chi2. - Correlation with
correlateandpwcorr. - Non-parametric tests such as
ranksum,signrankandkwallis.
Regression in Stata
Linear regression
regress, interpreting coefficients and model fit, factor-variable notation (i. and c.) for categorical predictors and interactions, and post-estimation commands such as predict, test and lincom.
Robust and clustered standard errors
When and why to use vce(robust) or vce(cluster id), and how clustering changes inference without changing the coefficients.
Binary, categorical and count outcomes
logit, logistic and probit for binary outcomes, mlogit and ologit for categorical and ordered outcomes, and poisson and nbreg for counts.
Marginal effects and predictions
Using margins and marginsplot to turn coefficients into predicted probabilities, average marginal effects and interaction plots that are much easier to explain.
Stata for Econometrics
Stata is the most widely used package in applied economics, and much Stata tuition is econometrics. Lessons connect each command to the econometric reasoning behind it.
OLS, assumptions and specification
The classical assumptions, heteroskedasticity and how to test for it, omitted-variable bias, functional form, multicollinearity and model specification tests.
Instrumental variables and endogeneity
Two-stage least squares with ivregress 2sls, first-stage strength and weak instruments, over-identification tests and how to explain an IV estimate.
Panel data
Setting up a panel
Reshaping to long format, declaring the panel with xtset, and checking balance and gaps.
Fixed and random effects
xtreg, fe and xtreg, re, the Hausman test, two-way fixed effects with time dummies, and high-dimensional fixed effects with the community-contributed reghdfe.
Dynamic panels
Why lagged dependent variables cause bias in fixed-effects models, and an introduction to GMM estimators such as xtabond and xtdpdsys.
Difference-in-differences
The two-group, two-period design, the parallel-trends assumption, estimating DiD by regression with an interaction term, and Stata's built-in didregress and xtdidregress commands, with standard errors clustered at the level of treatment.
Event study econometrics
"Event study" means two related things in economics, and lessons cover both.
Event-study difference-in-differences
Estimating treatment effects period by period before and after a policy or shock, using leads and lags of treatment relative to a reference period. Lessons cover building the relative-time variables, choosing and omitting the reference period, plotting the coefficients, and reading pre-treatment estimates as a check on parallel trends. When units are treated at different times, standard two-way fixed effects can give misleading results. Lessons explain why, and introduce heterogeneity-robust estimators: Stata's hdidregress and community-contributed commands such as csdid (Callaway and Sant'Anna), eventstudyinteract (Sun and Abraham) and did_imputation (Borusyak, Jaravel and Spiess).
Financial event studies
Measuring how share prices respond to announcements: defining estimation and event windows, estimating normal returns with a market model, and calculating and testing abnormal and cumulative abnormal returns.
Regression discontinuity
Sharp and fuzzy designs, bandwidth choice and plotting, using community-contributed tools such as rdrobust.
Time series
Declaring time-series data with tsset, lags and differences, unit-root tests such as dfuller, ARIMA models, vector autoregressions and basic forecasting.
Stata for Health, Social Science and Survey Research
Survey data
Declaring the sampling design with svyset, and using the svy: prefix so that weights, strata and clusters are reflected in estimates and standard errors. This is essential for national surveys and Demographic and Health Surveys.
Epidemiology and survival analysis
Risk and odds ratios with cs and cc, setting up time-to-event data with stset, Kaplan-Meier curves and Cox regression with stcox. For the epidemiological reasoning behind these methods, see epidemiology statistics.
Multilevel and longitudinal models
Mixed-effects models with mixed and melogit for pupils within schools, patients within hospitals or repeated measures within people.
Structural equation modelling and scales
Reliability with alpha, factor analysis with factor, and path models and confirmatory factor analysis with sem and gsem.
Reproducible Stata Workflows
A well-organised do-file is the difference between an analysis you can defend and one you cannot reproduce a month later. Lessons cover:
- Structuring a project into folders and a master do-file that runs every step in order.
- Comments, consistent naming and setting the Stata
versionat the top of each do-file. - Local and global macros,
foreachandforvaluesloops to avoid copy-and-paste code. - Stored results (
r()ande()) and storing estimates withestimates store. - Logging output and exporting tables directly from code.
- Never changing the raw data, and documenting every cleaning decision.
Stata Tutorial for Beginners
This short tutorial takes you through the first things every Stata user needs: loading data, exploring it, creating variables, running basic tests and a regression, and saving your work in a do-file. It uses auto.dta, a dataset of 74 cars from 1978 that comes with every copy of Stata, so you can follow along without downloading anything. The figures shown are the results Stata gives for this dataset.
Step 1: Understand the command syntax
Almost every Stata command follows the same pattern:
[by varlist:] command [varlist] [if] [in] [, options]
For example, summarize mpg if foreign == 1, detail runs the summarize command on the variable mpg, only for foreign cars, with the detail option. Three rules save a lot of frustration:
- Stata is case-sensitive:
mpgandMPGare different variables. - Use
=to assign a value and==to test equality. - Most commands can be abbreviated, such as
suforsummarize,tabfortabulateandregforregress. Typehelpfollowed by any command to see its syntax and examples.
Step 2: Load and save data
* load Stata's built-in example data
sysuse auto, clear
* open your own Stata dataset
use "mydata.dta", clear
* import a CSV file
import delimited "mydata.csv", clear
* import Excel; first row = names
import excel "mydata.xlsx", firstrow clear
* save, overwriting the old version
save "mydata_clean.dta", replace
The clear option removes any data already in memory; without it, Stata refuses to load new data. Put file paths in quotation marks, especially if they contain spaces.
Step 3: Explore the dataset
* variables, types and labels
describe
* look at the data in the Data Browser
browse
* print the first five rows
list make price mpg in 1/5
* detailed information about one variable
codebook foreign
* means, SDs, minimum and maximum
summarize price mpg weight
* frequency table
tabulate foreign
describe shows that the dataset has 74 observations and 12 variables. summarize price mpg weight gives:
| Variable | Obs | Mean | Std. dev. | Min | Max |
|---|---|---|---|---|---|
| price | 74 | 6165.257 | 2949.496 | 3291 | 15906 |
| mpg | 74 | 21.2973 | 5.785503 | 12 | 41 |
| weight | 74 | 3019.459 | 777.1936 | 1760 | 4840 |
tabulate foreign shows 52 domestic and 22 foreign cars. Try summarize rep78: it reports only 69 observations, because five cars have a missing repair record. Always check the number of observations; Stata quietly drops missing values from each analysis.
Step 4: Create and label variables
* a new variable: kilometres per litre
generate kpl = mpg * 0.425144
* a 0/1 indicator, leaving missing values missing
generate heavy = (weight >= 3000) if !missing(weight)
* labels for the variable and its values
label variable heavy "Weighs 3,000 lb or more"
label define yesno 0 "No" 1 "Yes"
label values heavy yesno
* check the result
tabulate heavy
The new variable heavy is 1 for 39 cars and 0 for 35. The if !missing(weight) part matters: Stata treats a missing value as larger than any number, so without it a car with missing weight would be wrongly classed as heavy. Other everyday commands include replace to change values, rename, drop and keep, and egen for group means, totals and counts.
Step 5: Analyse subgroups with if and by
* foreign cars only
summarize mpg if foreign == 1
* separately for each group
bysort foreign: summarize mpg
* a compact table of statistics by group
tabstat price mpg, by(foreign) statistics(mean sd n)
* cross-tab with row % and chi-square
tabulate foreign heavy, row chi2
The cross-tabulation shows that 71.15% of domestic cars are heavy compared with 9.09% of foreign cars, and the chi-square test (χ² = 23.89 with 1 degree of freedom, p < 0.001) indicates that weight category and origin are associated.
Step 6: Compare two groups with a t-test
* assumes equal variances
ttest mpg, by(foreign)
* Welch's version
ttest mpg, by(foreign) unequal
| Group | Obs | Mean mpg | Std. dev. |
|---|---|---|---|
| Domestic | 52 | 19.82692 | 4.743297 |
| Foreign | 22 | 24.77273 | 6.611187 |
| Difference | −4.945804 | 95% CI −7.661225 to −2.230384 |
Stata reports t = −3.6308 with 72 degrees of freedom, and a two-sided p-value of 0.0005 (the "Ha: diff != 0" column). Foreign cars in this sample average about 4.9 more miles per gallon. Because the two groups have quite different spreads, the Welch version with the unequal option is a sensible check; here it also gives a clear result (t = −3.18).
Step 7: Look at relationships
* correlations with p-values
pwcorr price mpg weight, sig
* scatter plot with fitted line
scatter price weight || lfit price weight
* distribution with a normal curve
histogram mpg, normal
* box plots by group
graph box mpg, over(foreign)
* save the last graph
graph export "mpg_box.png", replace
Price is positively correlated with weight (r = 0.54) and negatively with mpg (r = −0.47), and mpg and weight are strongly negatively correlated (r = −0.81). That last correlation matters for the next step.
Step 8: Run a linear regression
regress price mpg weight
| price | Coefficient | Std. err. | t | P>|t| | 95% conf. interval |
|---|---|---|---|---|---|
| mpg | −49.51222 | 86.15604 | −0.57 | 0.567 | −221.3025 to 122.278 |
| weight | 1.746559 | 0.6413538 | 2.72 | 0.008 | 0.4677361 to 3.025382 |
| _cons | 1946.069 | 3597.05 | 0.54 | 0.590 | −5226.245 to 9118.382 |
The header reports 74 observations, F(2, 71) = 14.74 with p < 0.001, R-squared = 0.2934 and adjusted R-squared = 0.2735. How to read it:
- weight: holding mpg constant, each extra pound of weight is associated with a price about $1.75 higher, and the confidence interval excludes zero.
- mpg: once weight is in the model, mpg adds little (p = 0.567). On its own,
regress price mpggives a coefficient of −238.89, but most of that relationship reflects the fact that heavier cars use more fuel and cost more. - R-squared: the two predictors explain about 29% of the variation in price.
Useful follow-up commands:
* add a categorical predictor, robust SEs
regress price mpg weight i.foreign, vce(robust)
* fitted values
predict yhat
* residuals
predict res, residuals
* residuals against fitted values
rvfplot
* test for heteroskedasticity
estat hettest
* predicted mean price by origin
margins foreign
Step 9: A first look at logistic regression
* coefficients on the log-odds scale
logit foreign weight mpg
* the same model as odds ratios
logistic foreign weight mpg
* average marginal effect of weight
margins, dydx(weight)
Here the outcome is whether a car is foreign. Heavier cars are significantly less likely to be foreign, holding mpg constant. Reporting odds ratios or marginal effects is usually much easier for readers to understand than raw logit coefficients.
Step 10: Save everything in a do-file
Open the Do-file Editor (type doedit) and keep every command there, so the whole analysis can be rerun in one go:
* ---------------------------------------------
* Project: car prices Author: your name
* ---------------------------------------------
* set to your Stata version
version 18
clear all
capture log close
log using "analysis.log", replace text
sysuse auto, clear
generate heavy = (weight >= 3000) if !missing(weight)
label variable heavy "Weighs 3,000 lb or more"
summarize price mpg weight
ttest mpg, by(foreign)
regress price mpg weight, vce(robust)
log close
Lines starting with * and text after // are comments. Use /// at the end of a line to continue a long command onto the next one.
Common beginner mistakes in Stata
- Forgetting that missing values count as very large numbers in conditions such as
if income > 50000. - Using
=instead of==in anifcondition. - Numbers imported as text (shown in red in the Data Browser); fix them with
destring. - Loading new data without
clear, or saving withoutreplace. - Typing commands only in the Command window, so the analysis cannot be reproduced.
- Not checking
_mergeafter a merge, and losing or duplicating observations. - Reading the wrong row or column of output, such as a one-sided instead of two-sided p-value.
Stata quick reference
| Task | Command |
|---|---|
| Open data | use, sysuse, import delimited, import excel |
| Save data | save "file.dta", replace |
| Inspect data | describe, browse, codebook, list, count |
| Descriptive statistics | summarize, tabulate, tabstat, table |
| Create or change variables | generate, replace, egen, recode, rename |
| Labels | label variable, label define, label values |
| Combine data | merge, append, reshape |
| Tests | ttest, tabulate ..., chi2, oneway, pwcorr, ranksum |
| Regression | regress, logit, logistic, probit, poisson |
| Panel data | xtset, xtreg, fe, xtreg, re |
| After estimation | predict, margins, test, estat, estimates store |
| Graphs | histogram, scatter, graph box, graph export |
| Help | help command, search keyword |
Once these steps feel comfortable, the next stage is usually data management on your own messy data, regression with categorical predictors and interactions, and panel or survey methods. That is where one-to-one Stata lessons help most.
Stata Tutoring for Every Level
Undergraduate students
Econometrics and quantitative methods modules often introduce Stata alongside the theory. Lessons cover the commands for problem sets, interpreting regression output for exams and organising coursework do-files.
Master's students
MSc Economics, Finance, Public Health and Social Policy programmes move quickly to panel data, instrumental variables and survey analysis. Dissertation support focuses on preparing your data, choosing an appropriate model and interpreting your own results. See also postgraduate statistics.
PhD researchers
Doctoral work often needs advanced methods, such as staggered difference-in-differences, high-dimensional fixed effects, dynamic panels or multilevel models, and code that supervisors and examiners can follow. See also PhD statistics.
Researchers and professionals
Analysts moving to Stata from Excel, SPSS or SAS, and researchers who need to learn a specific method quickly for a project or paper.
Stata Tutors for Economics and Other Subjects
- Economics and finance: econometrics, panel data, policy evaluation, event studies and time series.
- Public health and epidemiology: survey analysis, risk measures, survival analysis and multilevel models. See public health statistics.
- Political science and sociology: survey data, logistic and multilevel models, and panel studies. See sociology statistics.
- Business and management: firm-level panel data, regression and financial data. See business statistics.
- Education and development studies: pupil and school data, household surveys and programme evaluation.
Private Stata Tutor or a Stata Course?
Workshops, video courses and Stata's own NetCourses are good for structured, general learning. A private Stata tutor is better when the problem is specific to you.
| Private Stata tutor | Course or videos | |
|---|---|---|
| Uses your own data and do-file | Yes | Usually not |
| Follows your module or research question | Yes | General syllabus |
| Answers your follow-up questions immediately | Yes | Limited |
| Pace | Set by you | Fixed |
| Best for | Deadlines, dissertations, specific methods | Broad introduction |
Many students combine the two: a course or the tutorial above for the basics, then a few private Stata lessons on the parts that matter for their own work.
How Online Stata Tuition Works
- Send an enquiry. Describe your course or project, your Stata version and what you need help with. Use the enquiry form.
- Share what you are working on. If possible, send your do-file, a description of your data or a screenshot of the output you are stuck on, with personal data removed.
- Learn live, one-to-one. You share your screen and work in your own copy of Stata, so you practise the commands yourself rather than watching.
- Keep a clean do-file. Each lesson ends with commented code you can rerun and build on.
- Build up step by step. Further lessons follow the stages of your coursework or research.
Stata Tuition in London and Across the UK
Stata is used extensively in economics, social policy, public health and epidemiology teaching at universities in London and across the UK. Because lessons are online, students in London can have Stata tuition between lectures or in the evening without travelling across the city, and students elsewhere in England, Scotland, Wales and Northern Ireland have the same access.
Lessons follow your own university's modules, Stata version and assessment style. International students studying at UK universities are welcome; include your time zone when you enquire.
Stata Compared with SPSS, R and Python
| Software | Strengths | Typical users |
|---|---|---|
| Stata | Concise syntax, excellent econometrics, panel and survey tools, strong documentation | Economics, public health, epidemiology, social policy |
| SPSS | Menu-driven and approachable | Psychology, nursing, business |
| R | Free, flexible, huge package ecosystem, strong graphics | Statistics, biology, data science, research |
| Python | General-purpose programming and machine learning | Data science, computing, finance |
If your course uses another package, see SPSS, R or Python lessons.
Find a Stata Tutor
Whether you need to get started with Stata, untangle a merge, interpret a panel regression or set up an event study, one-to-one lessons can be planned around your course and deadlines. Request Stata lessons and tell us what you are working on.
Frequently asked questions
What does a Stata tutor do?
A Stata tutor teaches you to use Stata for your own course or research: writing commands and do-files, preparing data, choosing and running the right analysis, and interpreting the output. Lessons are one-to-one, so they follow your dataset, your module and the methods you actually need.
Can I find a private Stata tutor online?
Yes. All lessons are private and one-to-one, delivered live online with screen sharing. You can share your do-file and output, so the tutor sees exactly what you see in Stata, which is usually more productive than a group class or a generic video course.
How much does Stata tuition cost?
The fee depends on the level and complexity of the work, the length of each lesson and whether the tutor needs to look at your do-file or output in advance. Your fee is confirmed when you enquire, before any lesson is arranged.
Do you have Stata tutors for students in London?
Lessons are online, so students at London universities and anywhere else in the UK can have Stata tuition without travelling. Lessons can be arranged in the evening or around lectures, and they follow the Stata version and modules used at your university.
I have never used Stata. Can I start from the beginning?
Yes. Beginner lessons cover the interface, command syntax, loading and exploring data, creating variables, do-files and the most common analyses. The beginner tutorial on this page shows the first steps, and lessons build on it using your own data.
Can you help with econometrics in Stata?
Yes. Lessons cover OLS and its assumptions, robust and clustered standard errors, instrumental variables, panel data with fixed and random effects, difference-in-differences, event studies, time series and the interpretation of econometric output, at undergraduate, Master's or PhD level.
Can you teach event study and difference-in-differences methods in Stata?
Yes. Lessons cover the classic two-way fixed effects approach, building an event-study specification with leads and lags, checking pre-trends, and why staggered treatment timing needs newer estimators such as those in hdidregress or community-contributed commands like csdid and eventstudyinteract.
Which Stata version do I need?
Most teaching works across recent versions of Stata, but some commands are newer, such as didregress and the redesigned table command. Tell us your version and edition (BE, SE or MP) when you enquire, so examples match what you have installed.
Can you help me understand my Stata output?
Yes. Lessons explain coefficients, standard errors, t and z statistics, p-values, confidence intervals, R-squared, F tests, marginal effects and diagnostic tests, always in relation to your research question.
I already use SPSS or R. Is it hard to switch to Stata?
Not usually. The statistics are the same; what changes is the syntax and the workflow. Lessons map the tasks you already know onto Stata commands and do-files, so you become productive quickly.
Can a Stata tutor help with my dissertation or thesis?
Yes, as learning support. Lessons can help you prepare data, plan and run appropriate analyses, organise your do-files and interpret your own results. Your dissertation and analysis remain your own work, and results are never fabricated.
What should I send before my first Stata lesson?
A short description of your course or project, your Stata version, the method you are working on and, if possible, your do-file or a screenshot of the output you are stuck on. Remove any personal or confidential data first.