Skip to main content

5.1. Static Panel Data Models

Verified Environments & Platforms:EcoDataEcoLabFincoVietLOD

Methodological Part 5.1. Static Panel Data Models in 5. Static, Dynamic and Cross-Sectionally Dependent Panel Econometrics provides step-by-step How-To implementation guides for 11 econometric model lessons spanning from Section 5.1.1 to 5.1.11. Full theoretical derivations are available at VietLOD Part 5.1 alongside cloud execution on EcoLab.

Video Tutorial: How-To Guide for Part 5.1: Static Panel Data Models in Stata 18, R 4.x, and Python 3.11+

5.1.1. Methodological Overview and Structural Equations​

  • Methodological Focus: Provides consistent estimation and robust inference for Static Panel Data Models specifications within Static, Dynamic and Cross-Sectionally Dependent Panel Econometrics.
  • Mandatory Post-Estimation Diagnostics: Kiểm định nhân tử Lagrange Breusch–Pagan cho hiệu ứng ngẫu nhiên (LM), kiểm định FF cho hiệu ứng cố định và sai số chuẩn phân cụm theo đơn vị.

Core structural specification for Part 5.1:

Yit=β0+Xit⊤β+uit,Cov(uit,uis)≠0Y_{it} = \beta_0 + X_{it}^\top \beta + u_{it}, \quad \text{Cov}(u_{it}, u_{is}) \neq 0

Estimator objective and moment conditions:

β^Panel=(∑i=1NX~i⊤WiX~i)−1(∑i=1NX~i⊤WiY~i),Y~it=Yit−θYˉi\hat{\beta}_{\text{Panel}} = \left(\sum_{i=1}^N \tilde{X}_i^\top W_i \tilde{X}_i\right)^{-1}\left(\sum_{i=1}^N \tilde{X}_i^\top W_i \tilde{Y}_i\right), \quad \tilde{Y}_{it} = Y_{it} - \theta \bar{Y}_i
Methodological Scope Boundary:When empirical data violate the identification conditions of Part 5.1, researchers should transition to the extended methodological parts in Chapter 5 or apply appropriate instrumental-variable and cluster-robust corrections.

5.1.2. Econometric Model Lessons in Part 5.1​

5.1.1 · pooled_ols
5.1.1. Pooled Panel Least Squares

Estimates the Pooled Panel Least Squares specification within the Static Panel Data Models framework by optimizing the structural objective ...

Explore Guide
5.1.2 · panel_fe
5.1.2. Panel Fixed Effects Within Estimator

Estimates the Panel Fixed Effects Within Estimator specification within the Static Panel Data Models framework by optimizing the structural ...

Explore Guide
5.1.3 · panel_re
5.1.3. Panel Random Effects Estimator

Estimates the Panel Random Effects Estimator specification within the Static Panel Data Models framework by optimizing the structural object...

Explore Guide
5.1.4 · between_ols
5.1.4. Between-Entities Panel Estimator

Estimates the Between-Entities Panel Estimator specification within the Static Panel Data Models framework by optimizing the structural obje...

Explore Guide
5.1.5 · first_difference
5.1.5. First-Difference Panel Estimator

Estimates the First-Difference Panel Estimator specification within the Static Panel Data Models framework by optimizing the structural obje...

Explore Guide
5.1.6 · mundlak_cre
5.1.6. Mundlak Correlated Random Effects

Augments random effects with entity-level time averages of time-varying regressors to recover exact within slopes while identifying time-inv...

Explore Guide
5.1.7 · fama_macbeth
5.1.7. Fama-MacBeth Two-Step Cross-Sectional Regression

Estimates the Fama-MacBeth Two-Step Cross-Sectional Regression specification within the Static Panel Data Models framework by optimizing the...

Explore Guide
5.1.8 · pcse_panel
5.1.8. Beck-Katz Panel-Corrected Standard Errors

Estimates time-series cross-section panels with Prais-Winsten AR1 serial correlation and contemporaneous cross-unit sandwich covariance. Acr...

Explore Guide
5.1.9 · driscoll_kraay_fe
5.1.9. Driscoll-Kraay Spatial-Temporal Panel Fixed Effects

Applies Newey-West Bartlett kernel smoothing to cross-sectionally averaged moment conditions for inference robust to general spatial and tem...

Explore Guide

5.1.3. Comparative Execution Syntax Across Stata 18, R 4.x, and Python 3.11+​

Section & Model TitleEstimator KeyStata 18 MP SyntaxR 4.x SyntaxPython 3.11+ SyntaxSupport
5.1.1 · Pooled Panel Least Squarespooled_olsregress y x1 x2, vce(cluster id)plm::plm(y ~ x1 + x2, data = pdata, model = 'pooling')PooledOLS.from_formula('y ~ 1 + x1 + x2', data=pdata).fit(cov_type='clustered', cluster_entity=True)Available
5.1.2 · Panel Fixed Effects Within Estimatorpanel_fextreg y x1 x2, fe vce(cluster id)plm::plm(y ~ x1 + x2, data = pdata, model = 'within')PanelOLS.from_formula('y ~ 1 + x1 + x2 + EntityEffects', data=pdata).fit(cov_type='clustered', cluster_entity=True)Available
5.1.3 · Panel Random Effects Estimatorpanel_rextreg y x1 x2, re vce(cluster id)plm::plm(y ~ x1 + x2, data = pdata, model = 'random')RandomEffects.from_formula('y ~ 1 + x1 + x2', data=pdata).fit(cov_type='clustered', cluster_entity=True)Available
5.1.4 · Between-Entities Panel Estimatorbetween_olsxtreg y x1 x2, beplm::plm(y ~ x1 + x2, data = pdata, model = 'between')BetweenOLS.from_formula('y ~ 1 + x1 + x2', data=pdata).fit()Available
5.1.5 · First-Difference Panel Estimatorfirst_differenceregress D.y D.(x1 x2), vce(cluster id)plm::plm(y ~ x1 + x2, data = pdata, model = 'fd')FirstDifferenceOLS.from_formula('y ~ x1 + x2', data=pdata).fit(cov_type='clustered', cluster_entity=True)Available
5.1.6 · Mundlak Correlated Random Effectsmundlak_crextreg y x1 x2, cre vce(cluster id)plm::plm(y ~ x1 + x2 + mean_x1 + mean_x2, data = pdata, model = 'random')RandomEffects.from_formula('y ~ 1 + x1 + x2 + mean_x1 + mean_x2', data=pdata).fit()Available
5.1.7 · Fama-MacBeth Two-Step Cross-Sectional Regressionfama_macbethasreg y x1 x2, fmb newey(3)plm::pmg(y ~ x1 + x2, data = pdata, index = c('year', 'id'))FamaMacBeth.from_formula('y ~ 1 + x1 + x2', data=pdata).fit(cov_type='kernel')Available
5.1.8 · Beck-Katz Panel-Corrected Standard Errorspcse_panelxtpcse y x1 x2, correlation(ar1) hetonlypcse::pcse(lm(y ~ x1 + x2, data = df), groupN = df$id, groupT = df$t)PanelOLS.from_formula('y ~ 1 + x1 + x2', data=pdata).fit(cov_type='kernel')Available
5.1.9 · Driscoll-Kraay Spatial-Temporal Panel Fixed Effectsdriscoll_kraay_fextscc y x1 x2, fe lag(3)lmtest::coeftest(plm_fe, vcov = plm::vcovSCC(plm_fe, maxlag = 3))PanelOLS.from_formula('y ~ 1 + x1 + x2 + EntityEffects', data=pdata).fit(cov_type='kernel', kernel='bartlett', bandwidth=3)Available

| 5.1.10 · Pesaran Cross Sectional Dependence Panel Estimator | pesaran_cd_cross_section_dep | xtreg y x1 x2, fe vce(cluster id) + xtcsd, pesaran | plm::pcdtest(fit, test = 'cd') | Within FE + pairwise correlation Pesaran CD z-statistic | Available | | 5.1.11 · Wansbeek Kapteyn and Baltagi Unbalanced Two Way Error Components GLS | unbalanced_bi_way_ec_baltagi | xtreg y x1 x2 i.year, re vce(robust) | plm::plm(y ~ x1 + x2, effect = 'twoways', model = 'random', random.method = 'walhus') | Wansbeek-Kapteyn / Swamy-Arora two-way variance components FGLS | Available |

5.1.4. Standard Implementation Workflow for Part 5.1​

Step 1. Load Standardized Practice Datasets From VietLOD, EcoData, or Finco

Download the model-specific .csv practice dataset in Part 5.1 or extract custom empirical panels from EcoData and Finco.

Step 2. Select the Optimal Estimator for Your Error and Sample Structure

Compare the estimators from 5.1.1 to 5.1.11 in the syntax matrix above and execute the estimation in Stata 18 MP, R 4.x, or Python 3.11+.

Step 3. Run Mandatory Diagnostics and Export Publication Tables on EcoLab

Verify all required diagnostics including Kiểm định nhân tử Lagrange Breusch–Pagan cho hiệu ứng ngẫu nhiên (LM), kiểm định FF cho hiệu ứng cố định và sai số chuẩn phân cụm theo đơn vị and dispatch the specification to EcoLab for automated journal-grade reporting.