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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: xtset vs manual controlling for FE


From   Nick Cox <njcoxstata@gmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: xtset vs manual controlling for FE
Date   Fri, 10 May 2013 16:19:38 +0100

Your initial distinction doesn't make sense, at least not to me.

You can't run -xtreg- without a previous -xtset-.

Any -xtreg- results will depend on some previous -xtset-. Regardless
of whether you think you have specified -xtset-, Stata will remember
the last such setting, or complain if you have not -xtset-.

In order to pursue a comparison of results you need to check what is
the same and what is different.

Nick
njcoxstata@gmail.com


On 10 May 2013 16:06, Tomáš Houška <xbender@gmail.com> wrote:
> 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/

*
*   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