Bookmark and Share

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


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

Re: st: RE: Two level fixed effect with Newey-West standard errors


From   Fernando Rios Avila <[email protected]>
To   [email protected]
Subject   Re: st: RE: Two level fixed effect with Newey-West standard errors
Date   Wed, 4 Dec 2013 10:15:26 -0500

Hi Mohamad,
I would also add that if you decide  transform your data by 2-level
demeaning, this is an iterative process (you have to demean your
variables more than once), unless your data is balanced respect to the
fixed effects.
HTH
Fernando

On Wed, Dec 4, 2013 at 9:47 AM, Schaffer, Mark E <[email protected]> wrote:
> Mohamad,
>
>> -----Original Message-----
>> From: [email protected] [mailto:owner-
>> [email protected]] On Behalf Of Mohamad Mahmoud
>> Sent: 03 December 2013 15:44
>> To: statalist
>> Subject: st: Two level fixed effect with Newey-West standard errors
>>
>> Hi,
>> I need to estimate a two level fixed effects model with Newey-West
>> standard errors. I use -xtivreg2- and I know that it does the job, however it is
>> extremely slow. I am using a very large database (6 million observations, 30
>> covariates, 4000 company fixed effects, 5000 date fixed effects) and it takes
>> multiple hours for each regression.
>> is there a fast command to execute this?
>
> -xtivreg2- supports only 1-way fixed effects, so I am not sure how you are doing this.  Are you including dummies for the date FEs and letting -xtivreg2- handle the company FEs?
>
> In any case, you might be able to speed things up by partialling out the date and company FEs by hand (i.e., transform your data by 2-level demeaning), and then just use -ivreg2-.  Depending on your choice of covariance estimator, you might have to adjust the variance/SEs by hand afterwards for the loss of degrees of freedom from the FEs, but that's not too hard.
>
> HTH,
> Mark
>
>> Thanks,
>> Mohamad Mahmoud
>> *
>> *   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/
>
>
> -----
> Sunday Times Scottish University of the Year 2011-2013
> Top in the UK for student experience
> Fourth university in the UK and top in Scotland (National Student Survey 2012)
>
>
> We invite research leaders and ambitious early career researchers to
> join us in leading and driving research in key inter-disciplinary themes.
> Please see www.hw.ac.uk/researchleaders for further information and how
> to apply.
>
> Heriot-Watt University is a Scottish charity
> registered under charity number SC000278.
>
>
> *
> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index