PMEAN: Stata module to compute panel-data means and exact within-between decomposition for two- and three-dimensional panel data
Ahmad Nawaz () and
Jianghuai Zheng ()
Additional contact information
Jianghuai Zheng: Department of Industrial Economics, Nanjing University
Statistical Software Components from Boston College Department of Economics
Abstract:
pmean computes panel-data means and the exact within-between decomposition for two-dimensional (id x time) and three-dimensional (id x time x dim3) panel data. For each input variable, the command generates marginal means (overall, by id, by time, and optionally by a third dimension), the implied within and between components, and two- and three-way fixed-effect residuals. With dim3() and full, the command additionally generates the full ANOVA-style pairwise interaction components and the three-way residual. The additive identities (2D, 3D main effects, and full 3-way ANOVA) hold exactly at every observation in any panel, balanced or unbalanced. The third dimension can represent a sector, region, product group, industry, cohort, or any other grouping observed alongside the panel id and time. The estimation sample is defined by if, in, and observations with nonmissing values of id(), time(), and, when supplied, dim3(). Missing values of the analysis variables are handled variable by variable unless the listwise option is specified.
Language: Stata
Requires: Stata version 15.1
Keywords: panel data; means; within; between (search for similar items in EconPapers)
Date: 2026-05-19
Note: This module should be installed from within Stata by typing "ssc install pmean". The module is made available under terms of the MIT license (https://opensource.org/licenses/MIT).
References: Add references at CitEc
Citations:
Downloads: (external link)
http://fmwww.bc.edu/repec/bocode/p/pmean.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/p/pmean.sthlp help file (text/plain)
Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.
Export reference: BibTeX
RIS (EndNote, ProCite, RefMan)
HTML/Text
Persistent link: https://EconPapers.repec.org/RePEc:boc:bocode:s459715
Ordering information: This software item can be ordered from
http://repec.org/docs/ssc.php
Access Statistics for this software item
More software in Statistical Software Components from Boston College Department of Economics Boston College, 140 Commonwealth Avenue, Chestnut Hill MA 02467 USA. Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().