Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Newey-West (also follows xtivreg2)


From   "Andrea Molinari" <[email protected]>
To   "Stata List" <[email protected]>
Subject   Re: st: Newey-West (also follows xtivreg2)
Date   Tue, 20 Sep 2005 18:15:45 +0100

Thanks, Mark

Using -center- does not give me the exact same coefficients as -xtreg, fe-,
but I've managed by merging the years to the dataset after -xtdata, fe-.

I think most of the problem is because my panel is unbalanced. I copy below
the commands I used in case someone needs them in the future:

xtreg lremmetal lrepmetalg lrecmetalg lrgdp95pcm lrgdp95pcx lbrer btmetal,
fe

preserve

keep if e(sample)

keep mx year

sort mx

save y, replace

restore

xtdata lremmetal lrepmetalg lrecmetalg lrgdp95pcm lrgdp95pcx lbrer btmetal,
fe clear

merge mx using y.dta

assert _merge==3

drop _merge

tsset mx year

ivreg2 lremmetal lrepmetalg lrecmetalg lrgdp95pcm lrgdp95pcx lbrer btmetal,
bw(2) robust small




If anyone has further ideas, they're more than welcomed!

Andrea

----- Original Message ----- 
From: "Mark Schaffer" <[email protected]>
To: <[email protected]>
Sent: Tuesday, September 20, 2005 4:09 PM
Subject: Re: st: Newey-West (also follows xtivreg2)


> Andrea,
>
> From:           "Andrea Molinari" <[email protected]>
> To:             <[email protected]>
> Subject:        Re: st: Newey-West (also follows xtivreg2)
> Date sent:      Tue, 20 Sep 2005 15:39:41 +0100
> Send reply to:  [email protected]
>
> > Mark,
> >
> > The problem is that when I do
> >
> > xtdata lremmetal lrepmetalg lrecmetalg lrgdp95pcm lrgdp95pcx lbrer
btmetal,
> > fe
> >
> > the variable "year" disappears
>
> Try downloading and using Ben Jann's -center- program.  This will
> create mean-deviation variables without dropping or overwriting.
>
> I do plan to make xtivreg2 available, but I have to find the time to
> finish it off....
>
> --Mark
>
> > I thought I could get away including "year" in xtdata, and then taking
the
> > integer of year (as tsset didn't take non-integers):
> >
> > xtdata lremmetal lrepmetalg lrecmetalg lrgdp95pcm lrgdp95pcx lbrer
btmetal
> > year, fe
> >
> > replace year=int(year)
> > tsset mx year
> >
> > and get similar results to my -newey2- with the individual (fe) dummies,
so
> > it does seem to be doing the job (at least in a few regressions I tried
so
> > far). The problem is that this changes the years in a non-systematic way
and
> > I cannot recover them in the original way.
> >
> > Maybe your xtivreg2 would help... Do you plan to post it when it's
"ready"?
> >
> > Many thanks again,
> >
> > Andrea
> >
> > ----- Original Message ----- 
> > From: "Mark Schaffer" <[email protected]>
> > To: <[email protected]>
> > Sent: Tuesday, September 20, 2005 2:16 PM
> > Subject: Re: st: Newey-West (also follows xtivreg2)
> >
> >
> > > Andrea,
> > >
> > > From:           "Andrea Molinari" <[email protected]>
> > > To:             <[email protected]>
> > > Subject:        Re: st: Newey-West (also follows xtivreg2)
> > > Date sent:      Tue, 20 Sep 2005 11:25:45 +0100
> > > Send reply to:  [email protected]
> > >
> > > > Mark,
> > > >
> > > > Thanks for your reply. Sorry I was unclear. I did apply -xtdata, fe-
> > only to
> > > > the variables of my regression:
> > > >
> > > > xtdata lremmetal lrepmetalg lrecmetalg lrgdp95pcm lrgdp95pcx lbrer
> > btmetal,
> > > > fe
> > > >
> > > > but got the tsset error.
> > >
> > > You must be doing something that messes up your panel/year variables.
> > >
> > > Try cutting down the number of commands to the minimum that produces
> > > the error.  For example, what happens when start with your
> > > untransformed dataset and issue just the following 3 commands, in
> > > this order:
> > >
> > > tsset mx year
> > >
> > > xtdata lremmetal lrepmetalg lrecmetalg lrgdp95pcm lrgdp95pcx lbrer
> > > btmetal, fe
> > >
> > > tsset mx year
> > >
> > >
> > > --Mark
> > >
> > >
> > > >
> > > > I don't have the same problem with -xtreg, fe-, but this command
does
> > not
> > > > allow me to estimate robust or AC standard errors (at least with my
8.2
> > > > version).
> > > >
> > > > Any further ideas?
> > > >
> > > > Many thanks,
> > > >
> > > > Andrea
> > > > ----- Original Message ----- 
> > > > From: "Mark Schaffer" <[email protected]>
> > > > To: <[email protected]>
> > > > Cc: <[email protected]>
> > > > Sent: Tuesday, September 20, 2005 11:13 AM
> > > > Subject: Re: st: Newey-West (also follows xtivreg2)
> > > >
> > > >
> > > > > Andrea,
> > > > >
> > > > > The problem is that
> > > > >
> > > > > xtdata, fe
> > > > >
> > > > > is being applied to every variable in your dataset, including your
> > panel
> > > > > and time variables.  This is why -tsset- complains - the
transformed
> > > > > variable year is now in mean-deviatin form.
> > > > >
> > > > > You should list the variables explicitly and then things should
work.
> > > > >
> > > > > Also, do you have the same problem with your dummies if you use
> > xtreg,fe?
> > > > > If so, then my almost-but-not-quite-ready -xtivreg2- won't be of
any
> > help.
> > > > >
> > > > > --Mark
> > > > >
> > > > > > Appologies if this message comes across twice, I'm having
problems
> > with
> > > > my
> > > > > > server this morning...
> > > > > > ----------------------
> > > > > > Clive,
> > > > > >
> > > > > > Thanks for your suggestion. I didn't show an output because I
was
> > just
> > > > > > trying to find a more efficient and less time-consuming solution
to
> > > > > > estimating a fixed effects model which has HAC-corrected
standard
> > > > errors.
> > > > > > I tried -ivreg2- and it works fine for pooled OLS, but, as
> > with -newey2-
> > > > > > (and
> > > > > > as far as I understood), it would only estimate a fixed effects
> > model
> > > > when
> > > > > > introducing the dummies myself (hence running the risk of some
of
> > them
> > > > > > being dropped. Do you know of any other way?
> > > > > >
> > > > > > I tried first converting the data with -xtdata,fe- (following
what
> > > > Joanna
> > > > > > found in the archive), but when I then try to run ivreg2 I get
an
> > error
> > > > > > message. What I did was:
> > > > > >
> > > > > > use datas.dta, clear
> > > > > > iis mx
> > > > > >
> > > > > > tis year
> > > > > >
> > > > > > tsset mx year
> > > > > >
> > > > > >
> > > > > >
> > > > > > xtdata, fe
> > > > > >
> > > > > >
> > > > > >
> > > > > > ivreg2 lremmetal lrepmetalg lrecmetalg lrgdp95pcm lrgdp95pcx
lbrer
> > > > btmetal
> > > > > > rcametalx, bw(2) robust small
> > > > > > must tsset data and specify timevar
> > > > > >
> > > > > >
> > > > > >
> > > > > > ************
> > > > > >
> > > > > > and if I do (again):
> > > > > >
> > > > > >
> > > > > >
> > > > > > tsset mx year
> > > > > >
> > > > > >
> > > > > >
> > > > > > I get the error message:
> > > > > >
> > > > > >
> > > > > >
> > > > > > "time variable must contain only integer values"
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > I hope that's clearer than in my previous email. I saw a reply
by
> > Mark
> > > > > > Schaffer saying that he had a version of -xtivreg2- for fixed
> > effects,
> > > > and
> > > > > > it would be great trying it... Any suggestions would be more
than
> > > > > > welcomed!!!
> > > > > >
> > > > > >
> > > > > >
> > > > > > Many thanks,
> > > > > >
> > > > > > Andrea
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> >
> --------------------------------------------------------------------------
> > > > --
> > > > > > -------------
> > > > > >
> > > > > > Date: Mon, 19 Sep 2005 22:01:02 +0100 (BST)
> > > > > > From: "Mark Schaffer" <[email protected]>
> > > > > > Subject: Re: st: XTIVREG2
> > > > > >
> > > > > > Joana,
> > > > > >
> > > > > > I have a working version of "xtivreg2", but it does only fixed
> > effects
> > > > > > estimation.
> > > > > >
> > > > > > However, I'm not sure that you actually have a problem.  When
doing
> > a
> > > > > > Hausman test for endogeneity in IV estimation, the differenced
> > variance
> > > > > > matrix typically isn't of full rank.  -hausman- will print out a
> > warning
> > > > > > that "(V_b-V_B is not positive definite)", but it doesn't
indicate
> > that
> > > > > > anything is actually wrong.
> > > > > >
> > > > > > If you try doing the endogeneity test for simple IV estimation
that
> > is
> > > > in
> > > > > > the manuals somewhere, you'll probably find that the same
warning
> > > > message
> > > > > > appears.
> > > > > >
> > > > > > Hope this helps.
> > > > > >
> > > > > > Cheers,
> > > > > > Mark
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Clive Nicholas" <[email protected]>
> > > > > > To: <[email protected]>
> > > > > > Sent: Tuesday, September 20, 2005 8:20 AM
> > > > > > Subject: Re: st: Newey-West
> > > > > >
> > > > > >
> > > > > >> Andrea Molinari wrote:
> > > > > >>
> > > > > >> > I am trying to estimate a fixed effects model with
> > heteroscedasticity
> > > > > > and
> > > > > >> > serially correlated corrected standard errors. I am currently
> > using
> > > > > >> > -newey2- and including the fixed effects as dummies, but I
> > thought
> > > > > >> that
> > > > > >> > maybe STATA has a safer (as some of the dummies get dropped
on
> > the
> > > > > >> way, > changing the interpretation of other dummies in the
model)
> > and
> > > > > >> more
> > > > > >> > efficient way (it takes me quite a while to estimate each
> > > > > > specification).
> > > > > >>
> > > > > >> [...]
> > > > > >>
> > > > > >> You show no output, which hinders us from giving you any proper
> > help. I
> > > > > >> would suggest trying Baum/Schaffer/Stillman's -ivreg2- with
> > > > the -bw(2)-,
> > > > > >> -robust- and -small- options switched on and see what happens.
> > > > > >>
> > > > > >> CLIVE NICHOLAS        |t: 0(044)7903 397793
> > > > > >> Politics              |e: [email protected]
> > > > > >> Newcastle University  |http://www.ncl.ac.uk/geps
> > > > > >>
> > > > > >> Whereever you go and whatever you do, just remember this. No
matter
> > how
> > > > > >> many like you, admire you, love you or adore you, the number of
> > people
> > > > > >> turning up to your funeral will be largely determined by local
> > weather
> > > > > >> conditions.
> > > > > >>
> > > > > >> *
> > > > > >> *   For searches and help try:
> > > > > >> *   http://www.stata.com/support/faqs/res/findit.html
> > > > > >> *   http://www.stata.com/support/statalist/faq
> > > > > >> *   http://www.ats.ucla.edu/stat/stata/
> > > > > >>
> > > > > >
> > > > > > *
> > > > > > *   For searches and help try:
> > > > > > *   http://www.stata.com/support/faqs/res/findit.html
> > > > > > *   http://www.stata.com/support/statalist/faq
> > > > > > *   http://www.ats.ucla.edu/stat/stata/
> > > > > >
> > > > >
> > > > >
> > > > > Prof. Mark Schaffer
> > > > > Director, CERT
> > > > > Department of Economics
> > > > > School of Management & Languages
> > > > > Heriot-Watt University, Edinburgh EH14 4AS
> > > > > tel +44-131-451-3494 / fax +44-131-451-3294
> > > > > email: [email protected]
> > > > > web: http://www.sml.hw.ac.uk/ecomes
> > > > >
> > > > >
> > > > >
> > > > > __________________________________________________________________
> > > > >
> > > > > DISCLAIMER:
> > > > >
> > > > > This e-mail message is subject to http://www.hw.ac.uk/disclaim.htm
> > > > > __________________________________________________________________
> > > > >
> > > > > *
> > > > > *   For searches and help try:
> > > > > *   http://www.stata.com/support/faqs/res/findit.html
> > > > > *   http://www.stata.com/support/statalist/faq
> > > > > *   http://www.ats.ucla.edu/stat/stata/
> > > > >
> > > >
> > > > *
> > > > *   For searches and help try:
> > > > *   http://www.stata.com/support/faqs/res/findit.html
> > > > *   http://www.stata.com/support/statalist/faq
> > > > *   http://www.ats.ucla.edu/stat/stata/
> > >
> > > Prof. Mark E. Schaffer
> > > Director
> > > Centre for Economic Reform and Transformation
> > > Department of Economics
> > > School of Management & Languages
> > > Heriot-Watt University, Edinburgh EH14 4AS  UK
> > > 44-131-451-3494 direct
> > > 44-131-451-3296 fax
> > > 44-131-451-3485 CERT administrator
> > > http://www.sml.hw.ac.uk/cert
> > >
> > > *
> > > *   For searches and help try:
> > > *   http://www.stata.com/support/faqs/res/findit.html
> > > *   http://www.stata.com/support/statalist/faq
> > > *   http://www.ats.ucla.edu/stat/stata/
> > >
> >
> > *
> > *   For searches and help try:
> > *   http://www.stata.com/support/faqs/res/findit.html
> > *   http://www.stata.com/support/statalist/faq
> > *   http://www.ats.ucla.edu/stat/stata/
>
> Prof. Mark E. Schaffer
> Director
> Centre for Economic Reform and Transformation
> Department of Economics
> School of Management & Languages
> Heriot-Watt University, Edinburgh EH14 4AS  UK
> 44-131-451-3494 direct
> 44-131-451-3296 fax
> 44-131-451-3485 CERT administrator
> http://www.sml.hw.ac.uk/cert
>
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index