Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: xt commands with three way panel data

From   Abhradeep Maiti <>
To   "" <>
Subject   st: RE: xt commands with three way panel data
Date   Wed, 16 Oct 2013 23:35:46 +0000

This might work:

Create region-industry combination. Each region-industry combination becomes a cross-section.

egen pan_id = group(region industry)
xtset pan_id year

Then loop over all the industries.

forval i = 1/n {
xtreg Y X if industry==`i', fe


Thanks & Regards,
Abhradeep Maiti

From: [] on behalf of John Francis []
Sent: Wednesday, October 16, 2013 4:35 PM
Subject: st: xt commands with three way panel data

Im using a panel dataset with two cross-sectional dimensions (industry(i)
and region(r)) and one time dimension (year (t)).  I am estimating a model
with fixed effects for all three dimensions:

                Y_irt = constant + b*X_irt + f_i + f_r + f_t + error

where X are explanatory variables and the f’s are the fixed effects.  This
is straightforward to do using either reg or areg.  However, I would like to
utilize stata’s suite of xt commands in my estimation (e.g. xtserial,
xtregar, xtabond, etc…).  My first thought was to demean over the industry
dimension.  However, after doing this there are multiple observations per
region per year which means I can’t xtset the data.  Is there any way to
overcome this to utilize the xt commands?  Any help will be greatly

John Francis
Louisiana Tech University

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index