Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: xtset vs manual controlling for FE


From   Tomáš Houška <xbender@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: xtset vs manual controlling for FE
Date   Fri, 10 May 2013 17:06:23 +0200

Dear statalist,

I have panel data (sale from stores over time) and I have tried
running two models:
In the first one I declare the data as a panel (using -xtset store
time- ) and I control for the effects of time using
xtreg depvar indepvars i.time, fe vce(robust)
This way "fe" in the options controls for FE of stores, and "i.time"
creates DVars for each time period.

In the second model I dont declare the data to be a panel data and
control for fixed effects of store and time by hand, i.e.
xtreg depvar indepvars i.time i.store, vce(robust)

I would have assumed that -xtset- centeres my data around panel
variable and if I control for it by hand I would get the same results.
But my results vary keeping everything else the same.
Where is this difference coming from?

And one more question: if I have data with more than 2 dimensions
(i.e. I observe sales of products in stores over time - i.e. I cannot
use -xtset store time- as time variable is repeated for multiple
products), what is the best way to set up the panel? Should I use
gen market_id=group(store time)
xtset product market_id and treat each time&store as a panel?

Thank you!
T.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index