Complete Video Course  ·  Econometrics Made Easy with Stata

Panel Data Analysis
in Stata

A structured playlist from raw data preparation through second-generation estimators — organised as a four-stage learning path with 55 videos across 55 topics.

55Videos
4Stages
55Live Links
Companion Course Time Series Analysis in Stata — Complete Video Course Open →

Course Roadmap — Click any stage to jump directly to its videos

Panel data is everywhere in applied econometrics. Firms tracked over time, countries across decades, individuals in longitudinal surveys — if your data has both a cross-sectional and a time dimension, you are in panel territory. Stata has deep support for it. The challenge is that the methods scatter across a wide range: fixed effects, GMM, ARDL, quantile regression, cointegration, structural breaks.

This playlist organises 55 videos into a sensible learning path. Work through the stages in order. Each one assumes the previous. The methods build on each other in ways that are not always obvious from the title of a single video.

Stage 1

Data Preparation

Every analysis is only as reliable as the data behind it. Before a single model runs, you need your panel structured correctly — declared to Stata, free of gaps, clean of problem rows, and consistent across sources. This stage covers the full preparation workflow, including some often-overlooked tasks: handling repeated time values, constructing composite indices, and diagnosing missing data patterns. It is unglamorous work, but skipping it is where most analyses silently go wrong.

01 / Stage 1
Preparing Data for Panel Data Analysis — Cleaning, Graphs & Transformation

Start here. This video walks through the full cleaning, graphing, and transformation pipeline for a raw panel dataset — labelling variables, handling outliers, reshaping from wide to long, and producing exploratory graphs before any estimation begins.

Watch Video
02 / Stage 1
Finding Gaps in Years / Time and Interpolating Missing Years

A second worked treatment of the same time-gap problem — useful if the first video left open questions. Covers additional interpolation strategies and edge cases that arise with irregular panel structures.

Watch Video
03 / Stage 1
Panel Data Management in Stata — Merging, Interpolation & Frequency Transformation

When your data comes from multiple sources at different frequencies — annual firm data merged with quarterly macro indicators, for instance — this video covers the full merging and frequency transformation workflow in Stata.

Watch Video
04 / Stage 1
Cleaning Panel Data for Descriptives in Common Sample & Removing Missing Values

Before running descriptives, the panel must be reduced to a common sample so every statistic is computed on the same set of observations. This video covers removing missing rows and aligning the sample across variables, so summary statistics and later models are built on identical, comparable data rather than shifting subsets.

Watch Video
05 / Stage 1
Manipulating and Managing Unbalanced Panel Data

Unbalanced panels — where not every entity appears in every period — require special handling. This video covers the key management techniques for working with unbalanced structures without distorting your estimation sample.

Watch Video
06 / Stage 1
Repeated Time Values in Panel Data — Problem & Fix

Duplicate time entries for the same panel unit cause xtset to fail and xtreg to give wrong results. This video diagnoses why repeated time values appear and walks through the fix — either dropping duplicates or collapsing them correctly.

Watch Video
07 / Stage 1
Panel Data Management in Stata (Urdu Lecture)

For Urdu-speaking researchers, this is a full panel data management lecture covering the same core preparation topics in Urdu — cleaning, declaring, managing time gaps, and structuring for estimation.

Watch Video
08 / Stage 1
Missing Value Analysis and Interpolation using XTMISPANEL

An extended treatment that combines missing value diagnosis with interpolation — covering both how to detect the pattern of missingness and how to fill it using the xtmispanel framework before passing a complete dataset to your estimator.

Watch Video
09 / Stage 1
Balancing Panel Data using XTBALFRONT

When your analysis requires a balanced panel — every entity observed in every period — this video shows how to achieve it using the xtbalfront command, covering the frontier-based balancing approach and when balancing is preferable to modelling the unbalancedness directly.

Watch Video
10 / Stage 1
Entropy Method to Make Composite Indices in Stata

When multiple variables measure the same underlying concept — institutional quality, financial development, environmental performance — combining them into a single index is often preferable to entering each separately. This video covers the entropy weighting method for index construction in Stata, which avoids the subjectivity of manual weighting.

Watch Video
11 / Stage 1
Index Making using Factor Analysis in Stata

Factor analysis extracts latent dimensions from a set of correlated variables and is a principled alternative to entropy-based index construction. This video covers how to build a composite index using factor analysis in Stata and how to validate the resulting index before using it in panel regression.

Watch Video
Stage 2

Model Foundations & Diagnostics

With a clean panel in hand, this stage builds the core models — fixed and random effects, difference-in-differences — and the diagnostic tests that justify your specification before you trust a single coefficient.

12 / Stage 2
Step-by-Step Fixed and Random Effect Models in Stata

The core of panel econometrics. This step-by-step video covers fixed and random effect estimation, the Hausman test, and how to interpret results correctly — including the three R-squared values Stata reports and what each one means.

Watch Video
13 / Stage 2
Foundation and Development of Panel Data Models with Tests & Graphs

Theory meets practice. This video builds the conceptual foundation for panel models and then works through diagnostic tests and graphical outputs together — serial correlation, heteroskedasticity, and cross-sectional dependence checks included.

Watch Video
14 / Stage 2
Cross-Sectional and Panel Difference-in-Differences (DID) Estimator

Difference-in-differences has become one of the most-used identification strategies in applied work. This video covers both the cross-sectional and panel versions, including parallel trends, the interaction term specification, and common pitfalls in interpretation.

Watch Video
15 / Stage 2
Complete Lecture on Panel Data Analysis

A full integrative lecture that ties the foundational pieces together — useful as a review after completing the earlier videos in this stage, or as a standalone overview before diving deeper into the advanced methods.

Watch Video
16 / Stage 2
Pre-Modelling Statistics using XTPRETEST

Before committing to a model, xtpretest runs the full battery of pre-estimation diagnostics — cross-sectional dependence, slope homogeneity, stationarity, and cointegration — in a single command. This video covers how to read the output and use it to justify your modelling choices to reviewers.

Watch Video
17 / Stage 2
Panel Regression Diagnostic Tests using XTTESTPANEL

Introduces xttestpanel, a single command that runs the essential diagnostic battery on a simple panel regression — checking the assumptions a fixed/random effects model relies on so you can confirm model validity before interpreting results.

Watch Video
18 / Stage 2
Comparing & Converting Coefficients using COEFCONV

Raw regression coefficients are often on incompatible scales, making direct comparison across variables misleading. The coefconv command converts and standardises coefficients so that variable contributions can be meaningfully compared within a single model.

Watch Video
19 / Stage 2
Nomograph for Panel Data — Variable Contribution Diagnostics

A nomograph provides a visual summary of how much each variable contributes to the model's predicted values — more intuitive than a table of coefficients. This video covers how to produce and read a panel data nomograph in Stata.

Watch Video
Stage 3

Advanced Estimation & Projection

Where panel econometrics gets serious: dynamic ARDL families, GMM, thresholds, cointegrating estimators, spatial spillovers, and projecting fitted relationships forward. Choose estimators by what your diagnostics in Stages 1–2 revealed.

20 / Stage 3
Dynamic Panel ARDL (MG, PMG, DFE) Models

The essential trio of panel ARDL estimators. Mean Group (MG) allows fully heterogeneous slopes; Pooled Mean Group (PMG) constrains long-run coefficients to be equal; Dynamic Fixed Effects (DFE) constrains both. This video covers all three and how to choose between them using the Hausman test.

Watch Video
21 / Stage 3
Second Generation Panel ARDL (CCEMG & AMG)

Standard ARDL ignores cross-sectional dependence — a serious problem in most macro panels. This video introduces CCEMG (Common Correlated Effects Mean Group) and AMG (Augmented Mean Group), the two second-generation estimators that account for it.

Watch Video
22 / Stage 3
Choosing a Panel ARDL Specification — Fourier Breaks & Cross-Sectional Dependence

A strategic guide to selecting the correct Panel ARDL specification. Rather than a single command, this walks through how diagnostic tests for structural breaks (Fourier terms) and cross-sectional dependence steer you toward the right ARDL variant — first vs. second generation, with or without Fourier augmentation.

Watch Video
23 / Stage 3
Dynamic/Static Panel Models with Endogeneity & Thresholds

When your regressors are endogenous or your relationship shifts at some estimated cutoff, standard panel models are misspecified. This video covers both threshold specifications and endogeneity-robust estimation together.

Watch Video
24 / Stage 3
Panel Fixed Effect Threshold Regression with Multiple Variables

An extension of the threshold regression framework to settings where multiple regressors interact with the threshold variable simultaneously. This video covers implementation and interpretation of multi-variable threshold specifications.

Watch Video
25 / Stage 3
Panel GMM Models — Extended Treatment

A second, complementary video on panel GMM that addresses scenarios left open in the first — including instrument proliferation, weak instrument diagnostics, and how to handle the collapse option to control instrument count.

Watch Video
26 / Stage 3
FGLS Model for Panel Data — Large N, Small T

Feasible Generalised Least Squares is the preferred estimator when you have many cross-sections observed over few time periods. This video covers the xtgls command, when FGLS outperforms OLS, and how to handle heteroskedasticity and autocorrelation within the FGLS framework.

Watch Video
27 / Stage 3
Polynomial Regression for Nonlinear Relations across Cross-Sections

When the relationship between two variables follows a curve rather than a line — an inverted-U, for instance — linear panel models miss it. This video covers polynomial regression in a panel context to detect and visualise nonlinear relationships across cross-sections.

Watch Video
28 / Stage 3
Turning Point Test for Quadratic Panel Models

A quadratic model implies a turning point — but that turning point is only meaningful if it falls within the data range and is statistically significant. This video covers the formal turning point test for quadratic panel specifications, ensuring the identified inflection point is both real and interpretable.

Watch Video
29 / Stage 3
Panel CSARDL Model

The Cross-Sectionally Augmented ARDL (CSARDL) model accounts for cross-sectional dependence within an ARDL framework by augmenting the model with cross-section averages of the dependent variable and regressors. This video covers the CSARDL estimator, its advantages over standard panel ARDL, and implementation in Stata.

Watch Video
30 / Stage 3
CUPFM Model for Panel Data

The Common Unit-root Process Factor Model (CUPFM) is a panel estimator that accounts for cross-sectional dependence through common factors — related to the CCE family but with a distinct estimation approach. This video covers when to use it and how to implement and interpret it in Stata.

Watch Video
31 / Stage 3
Second Generation Panel Models — Endogeneity & Cross-Sectional Dependence (XTIVREG2 & XTCCE)

When both endogeneity and cross-sectional dependence are present simultaneously, neither standard IV nor first-generation panel estimators are sufficient. This video covers xtivreg2 for IV estimation with cross-sectionally robust standard errors, and xtcce for common correlated effects estimation.

Watch Video
32 / Stage 3
Robust Modelling using Propensity Score Matching (PSM)

Propensity Score Matching isolates treatment effects by constructing a comparison group that is statistically similar to the treated group on observable characteristics. In panel settings, PSM is used to assess whether key findings hold after matching — making it a powerful robustness check. This video covers PSM implementation in Stata and how to integrate matched samples with panel estimators.

Watch Video
33 / Stage 3
Panel Spatial Econometrics — Spillovers & Geographic Dependence (XSMLE)

A comprehensive long-form lecture (3+ hours) on spatial panel data. Covers modelling geographic dependence with spatial weight matrices and decomposing effects into direct, indirect, and total spillovers — typically implemented in Stata with xsmle (community) or spxtregress (official).

Watch Video
34 / Stage 3
Projecting Independent Variables using REGPROJECT

Uses regproject to generate forward projections of independent variables — useful for scenario building and out-of-sample forecasting once a model is estimated. This is the "Project" half of the estimate-and-project workflow, and is one of the instructor’s own SSC-archive packages.

Watch Video
Stage 4

Specialised Models & Tests

Distributional, nonlinear, and second-generation methods for harder problems — quantile ARDL, causality tests, unit-root and cointegration testing under cross-sectional dependence, and publication-ready effect visualisation.

35 / Stage 4
Quantile-Wise Coefficient Plots using PQR

Visualising quantile coefficients across the distribution makes results interpretable in a way that coefficient tables cannot. This video uses the PQR command to produce publication-ready coefficient plots across quantiles.

Watch Video
36 / Stage 4
Panel Quantile ARDL using XTPQARDL

The xtpqardl command provides a dedicated Stata implementation for panel quantile ARDL. This video walks through its syntax, options, and how to interpret the long-run and short-run quantile output.

Watch Video
37 / Stage 4
Second Generation Panel Quantile ARDL

This video extends panel quantile ARDL to account for cross-sectional dependence — combining the distributional flexibility of quantile estimation with the cross-sectional robustness of second-generation panel methods.

Watch Video
38 / Stage 4
Panel Non-Linear ARDL using PNARDL

Non-linear panel ARDL using the pnardl command covers asymmetric long-run effects estimated within a panel ARDL structure — allowing positive and negative shocks to have separate long-run paths.

Watch Video
39 / Stage 4
Second Generation Panel NARDL — Nonlinear ARDL with Cross-Sectional Dependence

Extends the nonlinear panel ARDL (pnardl) into a second-generation framework that corrects for cross-sectional correlation across units. Combines asymmetric long-run/short-run decomposition with common-factor robustness for valid inference in dependent panels.

Watch Video
40 / Stage 4
Quantile-on-Quantile Regression for Panel Data

Quantile-on-quantile regression examines how one variable's quantiles affect another variable's quantiles — a more flexible method for distributional relationships than standard quantile regression. This video covers the panel implementation.

Watch Video
41 / Stage 4
Entity-Specific Quantile Effects in Panel Quantile Models

In a panel quantile setup, each entity sits at a different position within the conditional distribution — so the relevant quantile is entity-specific, not a single fixed level. This video covers how to generate and interpret effects at each country- or firm-specific quantile position, producing a richer picture of heterogeneity than standard quantile regression tables.

Watch Video
42 / Stage 4
Panel VAR Models — Extended Application

A second Panel VAR video covering additional topics: lag selection criteria, Granger causality in the VAR framework, forecast error variance decomposition, and how to handle cross-sectional heterogeneity in VAR specifications.

Watch Video
43 / Stage 4
Static Panel Data with Driscoll & Kraay Standard Errors

Driscoll-Kraay standard errors are robust to heteroskedasticity, autocorrelation, and cross-sectional dependence simultaneously — via the xtscc command. This video covers when they are appropriate and how to implement them correctly.

Watch Video
44 / Stage 4
Dumitrescu & Hurlin Panel Non-Causality Test

The Dumitrescu-Hurlin test is the standard approach for panel Granger non-causality in heterogeneous panels. This video covers the test, the W-bar and Z-bar statistics, and how to interpret results — including the bootstrap variant for cross-sectionally dependent panels.

Watch Video
45 / Stage 4
Causality Testing: Fourier Toda-Yamamoto & Quantile Causality

When causal relationships are nonlinear or the standard Granger framework is too restrictive, the Fourier Toda-Yamamoto approach captures smooth structural shifts, while quantile causality tests whether the causal relationship holds across the full distribution. This video covers both methods and their complementary roles in a thorough causality analysis.

Watch Video
46 / Stage 4
Panel Negative Binomial & Poisson Regression — Extended Treatment

A deeper follow-up on count data panel models, covering marginal effects interpretation, zero-inflation issues, fixed vs random effects specifications for count models, and publication-ready output formatting.

Watch Video
47 / Stage 4
Panel Quantile Unit Root Tests with Breaks

Unit root tests that account for quantile-specific behaviour and structural breaks — going beyond first- and second-generation panel unit root tests to detect non-stationarity at specific quantiles of the distribution.

Watch Video
48 / Stage 4
Structural Break Detection in Panel Data

Structural breaks in panel data can invalidate long-run estimates if ignored. This video covers detection methods for identifying breakpoints in panel series — essential before cointegration testing when regime shifts are plausible.

Watch Video
49 / Stage 4
Slope Homogeneity Tests across Quantiles

Testing whether slopes are homogeneous across quantiles is a diagnostic step before pooling in quantile panel models. This video covers the relevant tests and what to do when homogeneity is rejected.

Watch Video
50 / Stage 4
Cross-Sectional Dependence across Quantiles

Cross-sectional dependence varies across the distribution. This video covers how to test for it at different quantile levels — informing whether second-generation estimators are needed at specific parts of the conditional distribution.

Watch Video
51 / Stage 4
Second Generation Panel Unit Root Tests

Tests for unit roots when cross-sectional dependence is present, where first-generation tests (LLC, IPS) are biased. Covers second-generation procedures such as Pesaran’s CIPS/CADF — implemented via commands like xtcips, pescadf or multipurt — as the correct pre-cointegration step in dependent panels.

Watch Video
52 / Stage 4
Second Generation Panel Cointegration Tests with Breaks

Second-generation panel cointegration tests account for cross-sectional dependence, which first-generation tests (Pedroni, Kao) ignore. This video covers the key procedures combining cross-sectional robustness with structural break allowance.

Watch Video
53 / Stage 4
Bootstrap Panel Cointegration Test (Westerlund & Edgerton 2007)

The Westerlund-Edgerton bootstrap cointegration test is robust to both cross-sectional dependence and structural breaks simultaneously. This video rounds out the cointegration toolkit and is the recommended test when both problems are present in your panel.

Watch Video
54 / Stage 4
Second Generation Panel Quantile Regression

Standard quantile regression for panel data does not account for cross-sectional dependence. This video covers second-generation panel quantile regression — combining distributional estimation with common factor correction for valid inference across quantiles.

Watch Video
55 / Stage 4
Visualising Quadratic & Moderator Effects in Panel Data

Polynomial and interaction terms produce results that coefficient tables alone cannot communicate. This video covers how to visualise quadratic relationships and moderator effects in panel data — producing marginal effect plots and interaction graphs that make nonlinear dynamics immediately readable for papers and presentations.

Watch Video

A note on sequencing

Stages 1 and 2 are prerequisites, not suggestions. If your panel is not declared correctly, commands like xtreg and xtdpd will either fail or silently produce wrong results. If you do not understand what fixed effects are doing, the logic of GMM instruments will not make sense when you reach Stage 3.

Stages 3 and 4 have more flexibility depending on your research focus. If you are working on cointegration, you can pull those Stage 4 videos in after finishing Stage 3. If your interest is distributional analysis, the quantile videos can run alongside the Stage 3 estimators. The more foundation you have before specialising, the better your instincts will be when something goes wrong — and in panel econometrics, something usually does.

The course is long. That seems right. These methods are genuinely hard to use well, and the places where they tend to break are not always obvious until a reviewer asks a question you should have been asking yourself.

NA

Your Instructor

Dr. Noman Arshed

Senior Lecturer, Department of Business Analytics
Sunway Business School · Sunway University, Malaysia
AACSB Accredited · Program Leader, MsBA ODL

Dr. Noman Arshed is an applied econometrician whose work spans environmental economics, Islamic finance, institutional quality, energy economics, and panel data methodology. He holds a PhD in Islamic Banking & Finance from UMT Pakistan, an MSc in Economics & Finance from the University of Edinburgh, and a BSc (Honours) in Economics from Forman Christian College University. With over ten years of teaching experience across undergraduate, MPhil, MBA, and PhD levels in Pakistan and Malaysia, his courses have consistently drawn student satisfaction scores above 90%.

He is currently Senior Lecturer and Program Leader for the Masters of Business Analytics (ODL) at Sunway Business School, an AACSB-accredited institution. In 2025 he received both the Outstanding Quantity and Quality of Research Award and the Immersion and Mobility Program Award at Sunway. He is ranked in the top 0.13% of scholars globally by ScholarGPS (2024) and 11th among the top 25% of authors by 10-year publication record on IDEAS/REPEC.

Beyond research and teaching, Dr. Arshed runs Econistics.com — an applied econometrics education platform — and the YouTube channel Econometrics Made Easy with Stata, from which this course is drawn. He has authored Applied Cross-Sectional Econometrics (KSP Books, 2020) and developed five open-source Stata packages on the Boston College SSC archive: xtqrplot, coefconv, regproject, qmodplot, and xtbalfront.

203Journal Articles & Chapters
3,978Google Scholar Citations
h = 33h-index (Google Scholar)
110Scopus-Listed Papers
356Total Impact Factor
10+Years Teaching
6PhD Students Supervised
Top 0.13%ScholarGPS Global Rank 2024