<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=Windows-1252 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18702"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT size=2 face=Arial>See <FONT size=3
face="Times New Roman">"</FONT><SPAN><TD class=fldtextPad align="left"
valign="top" width="49%"><FONT face="Times New Roman"><FONT size=3><SPAN
class=txtBoldOnly>The Hausman test statistic can be negative even
asymptotically" </SPAN><BR></FONT></FONT><A class=outwardLink
onclick="javascript:submitRecord('2-s2.0-57549116350','0','0');"
href="http://www.scopus.com/record/display.url?view=basic&eid=2-s2.0-57549116350&origin=resultslist&sort=plf-f&src=s&sid=uyYfGr3CumwdDWrGjW4X_5o%3a80&sot=aut&sdt=a&sl=36&s=AU-ID%28%22Schreiber%2c+Sven%22+11139396400%29&relpos=0&relpos=0"><FONT
face="Times New Roman"></FONT></A><FONT face="Times New Roman"><FONT
size=3><SPAN style="WHITE-SPACE: nowrap"><IMG alt=""
src="http://www.scopus.com/static/images/s.gif" width=2
height=1> </SPAN></TD><TD class=fldtextPad valign="top"
width="23%"></FONT></FONT><A title="Search for all articles by this author"
href="http://www.scopus.com/search/submit/author.url?author=Schreiber%2c+S.&origin=resultslist&authorId=11139396400&src=s"
alt="Search for all articles by this author"><FONT
title="http://www.scopus.com/search/submit/author.url?author=Schreiber%2c+S.&origin=resultslist&authorId=11139396400&src=s CTRL + Clique para seguir o link"
size=3 face="Times New Roman">Schreiber, S.</FONT></A><FONT
face="Times New Roman"><FONT size=3> </TD><TD class=fldtextPad align="center"
valign="top" width="4%">2008</TD> <TD class=fldtextPad valign="top"
width="23%"><I>Jahrbucher fur Nationalokonomie und Statistik</I> 228 (4), pp.
394-405 </FONT></FONT></SPAN></FONT></DIV>
<DIV><FONT size=3 face="Times New Roman"><SPAN></SPAN></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN><A
title="http://econ.schreiberlin.de/papers/schreiber_hausmantest_aug2008.pdf CTRL + Clique para seguir o link"
href="http://econ.schreiberlin.de/papers/schreiber_hausmantest_aug2008.pdf">http://econ.schreiberlin.de/papers/schreiber_hausmantest_aug2008.pdf</A></SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN><FONT face="Times New Roman"><FONT
size=3></FONT></FONT></SPAN></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN><FONT face="Times New Roman"><FONT
size=3><FONT size=2 face=Arial></FONT></TD></FONT></FONT></SPAN></FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A
title="mailto:archstevej@gmail.com CTRL + Clique para seguir o link"
href="mailto:archstevej@gmail.com">Steven Archambault</A> </DIV>
<DIV><B>Sent:</B> Wednesday, May 20, 2009 5:18 PM</DIV>
<DIV><B>To:</B> <A
title="mailto:rbali@ufmg.br CTRL + Clique para seguir o link"
href="mailto:rbali@ufmg.br">Robert Iquiapaza</A> ; <A
title="mailto:r-sig-finance@stat.math.ethz.ch CTRL + Clique para seguir o link"
href="mailto:r-sig-finance@stat.math.ethz.ch">r-sig-finance@stat.math.ethz.ch</A>
</DIV>
<DIV><B>Subject:</B> Re: [R-SIG-Finance] R: [Fwd: R-SIG-Finance Digest, Vol 60,
Issue 18]</DIV></DIV></DIV>
<DIV><BR></DIV>Thanks Robert. I have been playing around with sigmamore
sigmaless. I cannot seem to duplicate the canned results when I do it by hand.
Any ideas?<BR><BR>###STATA 9.2####<BR><BR>quietly xtreg lfdi_2000 lagdlfdi
laglnstock2000 lagtradegdp lagdlgdp, fe;<BR><BR>. estimates store FIX, title(The
FE);<BR><BR>. matrix bfe=e(b);<BR><BR>. matrix vfe=e(rmse);<BR><BR>. quietly
xtreg lfdi_2000 lagdlfdi laglnstock2000 lagtradegdp lagdlgdp, re
sa;<BR><BR>. estimates store RAND, title(The RE);<BR><BR>. matrix
bre=e(b);<BR><BR>. matrix vre=e(rmse);<BR><BR>. matrix bdif=bfe-bre;<BR><BR>.
matrix bdifp=bdif';<BR><BR>. matrix dv=vre-vfe;<BR><BR>. matrix
dvi=inv(dv);<BR><BR>. matrix chi1=bdif*dvi;<BR><BR>. matrix
chisq=chi1*bdifp;<BR><BR>. matrix list chisq;<BR><BR>symmetric
chisq[1,1]<BR>
y1<BR>y1 11.105892<BR><BR>. hausman FIX RAND,
sigmamore;<BR><BR>
---- Coefficients
----<BR>
|
(b)
(B)
(b-B)
sqrt(diag(V_b-V_B))<BR>
|
FIX
RAND
Difference
S.E.<BR>-------------+----------------------------------------------------------------<BR>
lagdlfdi | .1564758
.1632387
-.0067629 .0014297<BR>laglnst~2000
| .762135
.8314432
-.0693082
.0151471<BR> lagtradegdp |
.0178568
.0119453
.0059115
.0015669<BR> lagdlgdp |
.2601478
.255801
.0043468
.0067502<BR>------------------------------------------------------------------------------<BR>
b = consistent under Ho and Ha; obtained from
xtreg<BR> B =
inconsistent under Ha, efficient under Ho; obtained from
xtreg<BR><BR> Test: Ho: difference in coefficients
not
systematic<BR><BR>
chi2(4) =
(b-B)'[(V_b-V_B)^(-1)](b-B)<BR>
=
31.32<BR>
Prob>chi2 =
0.0000<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<DIV class=gmail_quote>On Wed, May 20, 2009 at 11:22 AM, Robert Iquiapaza <SPAN
dir=ltr><<A href="mailto:rbali@ufmg.br">rbali@ufmg.br</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
name="Compose message area">
<DIV><FONT size=2 face=Arial>Stev,</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>You will get the same Chi-sq for Hausman test if
you use Swamy-Arora's transformation for RE in stata. To avoid the variance
not positive definite maybe you should use options sigmamore or
sigmaless in Stata (see </FONT><A
title="http://www.stata.com/help.cgi?hausman CTRL + Clique para seguir o link"
href="http://www.stata.com/help.cgi?hausman" target=_blank><B><FONT
title="http://www.stata.com/help.cgi?hausman CTRL + Clique para seguir o link"
size=2 face=Arial>http://www.stata.com/help.cgi?hausman</FONT></B></A><FONT
size=2 face=Arial>), the results don't change. </FONT></DIV>
<DIV><FONT size=2 face=Arial>I wonder why plm doesn't alert the variance not
being positive definite.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Robert</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial> # Stata 10.1</FONT></DIV>
<DIV><FONT size=2>
<P>xtreg lfdi_2000 lagdlfdi laglnstock2000 lagtradegdp lagdlgdp, re sa</P>
<P>estimates store RANDsa, title(The REsa)</P>
<P>hausman FIX RANDsa</P></FONT></DIV>
<DIV
style="FONT: 10pt Tahoma; font-size-adjust: none; font-stretch: normal"><FONT
face=Arial>
<DIV class=im> ---- Coefficients
----<BR> (b)
(B)
(b-B)
sqrt(diag(V_b-V_B))<BR></DIV> FIX
RANDsa
Difference
S.E.<BR> <BR>lagdlfdi .1564759
.1632388
-.0067629
.<BR>laglnst~2000 .762135
.8314432
-.0693082
.0149396<BR>lagtradegdp .0178568
.0119453
.0059115
.0015449<BR>lagdlgdp .2601477
.2558009
.0043468 .0051777
<DIV class=im><BR> <BR> b = consistent under Ho and Ha; obtained
from xtreg<BR>B = inconsistent under Ha, efficient under Ho; obtained
from xtreg</DIV></FONT></DIV>
<DIV class=im>
<DIV> </DIV>
<DIV
style="FONT: 10pt Tahoma; font-size-adjust: none; font-stretch: normal"><FONT
face=Arial>Test: Ho: difference in coefficients not
systematic</FONT></DIV>
<DIV> </DIV></DIV>
<DIV
style="FONT: 10pt Tahoma; font-size-adjust: none; font-stretch: normal"><FONT
face=Arial>
<DIV class=im> chi2(4) =
(b-B)'[(V_b-V_B)^(-1)](b-B)<BR></DIV> =
23.70
<DIV class=im><BR> Prob>chi2 =
0.0001<BR> (V_b-V_B is not positive definite)<BR></DIV></FONT></DIV>
<DIV style="FONT: 10pt Tahoma; font-size-adjust: none; font-stretch: normal">
<DIV><BR></DIV>
<DIV
style="BACKGROUND: rgb(245,245,245); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">
<DIV><B>From:</B> <A
title="mailto:archstevej@gmail.com CTRL + Clique para seguir o link"
href="mailto:archstevej@gmail.com" target=_blank>Steven Archambault</A> </DIV>
<DIV><B>Sent:</B> Tuesday, May 19, 2009 4:16 PM</DIV>
<DIV><B>To:</B> <A
title="mailto:rbali@ufmg.br CTRL + Clique para seguir o link"
href="mailto:rbali@ufmg.br" target=_blank>Robert Iquiapaza</A> </DIV>
<DIV class=im>
<DIV><B>Cc:</B> <A
title="mailto:r-sig-finance@stat.math.ethz.ch CTRL + Clique para seguir o link"
href="mailto:r-sig-finance@stat.math.ethz.ch"
target=_blank>r-sig-finance@stat.math.ethz.ch</A> </DIV></DIV>
<DIV>
<DIV></DIV>
<DIV class=h5>
<DIV><B>Subject:</B> Re: [R-SIG-Finance] R: [Fwd: R-SIG-Finance Digest, Vol
60, Issue 18]</DIV></DIV></DIV></DIV></DIV>
<DIV>
<DIV></DIV>
<DIV class=h5>
<DIV><BR></DIV>Oh, you are right. Here is the correct file. I sure have
botched this query, thanks for catching it Robert! Sorry for so many posts to
the list.<BR><BR>Regards,<BR>Steve<BR><BR><BR><BR>
<DIV class=gmail_quote>On Tue, May 19, 2009 at 12:19 PM, Robert Iquiapaza
<SPAN dir=ltr><<A
title="mailto:rbali@ufmg.br CTRL + Clique para seguir o link"
href="mailto:rbali@ufmg.br" target=_blank>rbali@ufmg.br</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
name="Compose message area">
<DIV><FONT size=2 face=Arial>Stev,</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>The data you provided is not complete, <FONT
size=3 face="Times New Roman">lagdlfdi and laglnstock2000 are not in
the csv file</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Robert</FONT></DIV>
<DIV
style="FONT: 10pt Tahoma; font-size-adjust: none; font-stretch: normal">
<DIV><BR></DIV>
<DIV
style="BACKGROUND: rgb(245,245,245); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial">
<DIV><B>From:</B> <A
title="mailto:archstevej@gmail.com CTRL + Clique para seguir o link"
href="mailto:archstevej@gmail.com" target=_blank>Steven Archambault</A>
</DIV>
<DIV><B>Sent:</B> Monday, May 18, 2009 5:06 PM</DIV>
<DIV><B>To:</B> <A title=Giovanni_Millo@generali.com
href="mailto:Giovanni_Millo@generali.com" target=_blank>Millo Giovanni</A>
</DIV>
<DIV><B>Cc:</B> <A
title="mailto:r-sig-finance@stat.math.ethz.ch CTRL + Clique para seguir o link"
href="mailto:r-sig-finance@stat.math.ethz.ch"
target=_blank>r-sig-finance@stat.math.ethz.ch</A> ; <A
title="mailto:yves.croissant@let.ish-lyon.cnrs.fr CTRL + Clique para seguir o link"
href="mailto:yves.croissant@let.ish-lyon.cnrs.fr" target=_blank>Yves
Croissant</A> ; <A
title="mailto:christian.kleiber@unibas.ch CTRL + Clique para seguir o link"
href="mailto:christian.kleiber@unibas.ch" target=_blank>Christian
Kleiber</A> </DIV>
<DIV><B>Subject:</B> Re: [R-SIG-Finance] R: [Fwd: R-SIG-Finance Digest, Vol
60, Issue 18]</DIV></DIV></DIV>
<DIV>
<DIV></DIV>
<DIV>
<DIV><BR></DIV>I just realized I used Robust in my Stata 9.2 analysis. When
I remove this, the Chi-sq values are much closer to the values I get in R
(but negative, as the consistent model must be listed first in a chi-sq
calculation). However, with my own data I do get this positive definite
error in Stata. Is this a result of unbalanced data? R doesn't give an
error, so I am inclined to ignore it in Stata. I am posting my own results
from R and Stata, and attaching the data as a csv.<BR><BR>Thanks, hope I am
not wasting too much of your time
here.<BR><BR>-Steve<BR><BR>###R-Output###<BR>> library("plm")<BR>>
<BR>> fdi <- read.csv("C:/data/mydata.csv", na.strings=".")<BR>>
fdiplm<-plm.data(fdi, index = c("id_code_id",
"year"))<BR>series are constants and have been
removed<BR>> <BR>> fdi_test<-(lfdi_2000~ lagdlfdi+ laglnstock2000+
lagtradegdp +lagdlgdp)<BR>> <BR>> fdi_test_fe <- plm(fdi_test,
data=fdiplm, model="within")<BR>> fdi_test_re <- plm(fdi_test,
data=fdiplm, model="random")<BR>> <BR>> summary
(fdi_test_fe)<BR>Oneway (individual) effect Within
Model<BR><BR>Call:<BR>plm(formula = fdi_test, data = fdiplm, model =
"within")<BR><BR>Unbalanced Panel: n=149, T=3-27, N=2697<BR><BR>Residuals
:<BR> Min. 1st Qu. Median 3rd Qu. Max.
<BR>-8.2100 -0.4760 0.0452 0.5670 4.8700
<BR><BR>Coefficients
:<BR>
Estimate Std. Error t-value Pr(>|t|)
<BR>lagdlfdi 0.1564759
0.0180645 8.6621 < 2.2e-16 ***<BR>laglnstock2000 0.7621350
0.0246798 30.8809 < 2.2e-16 ***<BR>lagtradegdp
0.0178568 0.0025859 6.9055 5.003e-12
***<BR>lagdlgdp 0.2601477
0.0427744 6.0818 1.188e-09 ***<BR>---<BR>Signif. codes: 0 ‘***’
0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 <BR><BR>Total Sum of
Squares: 4606.7<BR>Residual Sum of Squares:
2938<BR>F-statistic: 361.237 on 4 and 2544 DF, p-value: <
2.22e-16<BR>> summary (fdi_test_re)<BR>Oneway (individual) effect Random
Effect Model <BR> (Swamy-Arora's
transformation)<BR><BR>Call:<BR>plm(formula = fdi_test, data = fdiplm, model
= "random")<BR><BR>Unbalanced Panel: n=149, T=3-27,
N=2697<BR><BR>Effects:<BR>
var std.dev share<BR>idiosyncratic 1.15487 1.07465
0.6617<BR>individual 0.59044 0.76840 0.3383<BR>theta
: <BR> Min. 1st Qu. Median Mean 3rd
Qu. Max. <BR> 0.3718 0.6700 0.7081
0.6955 0.7355 0.7401 <BR><BR>Residuals :<BR>
Min. 1st Qu. Median Mean 3rd
Qu. Max. <BR>-9.15000 -0.47900 0.07270
-0.00713 0.59800 3.95000 <BR><BR>Coefficients
:<BR>
Estimate Std. Error t-value Pr(>|t|)
<BR>(Intercept) 16.7744214 0.1552868 108.0222 <
2.2e-16 ***<BR>lagdlfdi
0.1632388 0.0181005 9.0185 < 2.2e-16
***<BR>laglnstock2000 0.8314432 0.0196444 42.3247 <
2.2e-16 ***<BR>lagtradegdp 0.0119453
0.0020737 5.7605 8.386e-09
***<BR>lagdlgdp 0.2558009
0.0424599 6.0245 1.696e-09 ***<BR>---<BR>Signif. codes: 0
‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 <BR><BR>Total Sum of
Squares: 9522.3<BR>Residual Sum of Squares:
3140.8<BR>F-statistic: 1367.42 on 4 and 2692 DF, p-value: <
2.22e-16<BR>> <BR>> phtest(fdi_test_re,
fdi_test_fe)<BR><BR> Hausman
Test<BR><BR>data: fdi_test <BR>chisq = 23.7021, df = 4, p-value =
9.164e-05<BR>alternative hypothesis: one model is inconsistent
<BR><BR><BR>###end R output###<BR><BR>###Stata 9.2
Output--canned###<BR>xtreg lfdi_2000 lagdlfdi laglnstock2000 lagtradegdp
lagdlgdp, fe;<BR><BR>Fixed-effects (within)
regression
Number of obs =
2697<BR>Group variable (i):
id_code_id
Number of groups =
149<BR><BR>R-sq: within =
0.3622
Obs per group: min =
3<BR> between =
0.8234
avg =
18.1<BR> overall =
0.6998
max =
27<BR><BR>
F(4,2544)
= 361.24<BR>corr(u_i, Xb) =
0.3536
Prob > F
=
0.0000<BR><BR>------------------------------------------------------------------------------<BR>
lfdi_2000 | Coef. Std.
Err. t
P>|t| [95% Conf.
Interval]<BR>-------------+----------------------------------------------------------------<BR>
lagdlfdi | .1564758 .0180645
8.66 0.000 .1210532
.1918985<BR>laglnst~2000 | .762135
.0246798 30.88 0.000
.7137404 .8105295<BR> lagtradegdp |
.0178568 .0025859 6.91
0.000 .0127861
.0229274<BR> lagdlgdp | .2601478
.0427744 6.08
0.000 .1762716
.3440241<BR> _cons |
17.01131 .1701713 99.97
0.000 16.67762
17.345<BR>-------------+----------------------------------------------------------------<BR>
sigma_u | .93048942<BR> sigma_e |
1.0746505<BR> rho |
.42847396 (fraction of variance due to
u_i)<BR>------------------------------------------------------------------------------<BR>F
test that all u_i=0: F(148, 2544)
=
10.73 Prob >
F = 0.0000<BR><BR>. estimates store FIX, title(The FE) ;<BR><BR>. xtreg
lfdi_2000 lagdlfdi laglnstock2000 lagtradegdp lagdlgdp,
re;<BR><BR>Random-effects GLS
regression
Number of obs =
2697<BR>Group variable (i):
id_code_id
Number of groups =
149<BR><BR>R-sq: within =
0.3606
Obs per group: min =
3<BR> between =
0.8402
avg =
18.1<BR> overall =
0.7128
max = 27<BR><BR>Random effects u_i
~
Gaussian
Wald chi2(4) =
2225.46<BR>corr(u_i, X) = 0
(assumed)
Prob > chi2 =
0.0000<BR><BR>------------------------------------------------------------------------------<BR>
lfdi_2000 | Coef. Std.
Err. z
P>|z| [95% Conf.
Interval]<BR>-------------+----------------------------------------------------------------<BR>
lagdlfdi | .1631662 .0180937
9.02 0.000 .1277032
.1986291<BR>laglnst~2000 | .830845
.0196843 42.21 0.000
.7922645 .8694255<BR> lagtradegdp |
.011992 .0020779 5.77
0.000 .0079195
.0160645<BR> lagdlgdp | .2558113
.0424486 6.03
0.000 .1726136
.3390091<BR> _cons |
16.77702 .1556693 107.77
0.000 16.47191
17.08212<BR>-------------+----------------------------------------------------------------<BR>
sigma_u | .77431228<BR> sigma_e |
1.0746505<BR> rho |
.34173973 (fraction of variance due to
u_i)<BR>------------------------------------------------------------------------------<BR><BR>.
estimates store RAND, title(The RE) ;<BR><BR>. hausman FIX
RAND;<BR><BR>
---- Coefficients
----<BR>
|
(b)
(B)
(b-B)
sqrt(diag(V_b-V_B))<BR>
|
FIX
RAND
Difference
S.E.<BR>-------------+----------------------------------------------------------------<BR>
lagdlfdi | .1564758
.1631662
-.0066903
.<BR>laglnst~2000 |
.762135
.830845
-.06871
.014887<BR> lagtradegdp |
.0178568
.011992
.0058648
.0015393<BR> lagdlgdp |
.2601478
.2558113
.0043365
.0052695<BR>------------------------------------------------------------------------------<BR>
b = consistent under Ho and Ha; obtained from
xtreg<BR>
B = inconsistent under Ha, efficient under Ho; obtained from
xtreg<BR><BR> Test: Ho: difference in
coefficients not
systematic<BR><BR>
chi2(4) =
(b-B)'[(V_b-V_B)^(-1)](b-B)<BR>
=
22.94<BR>
Prob>chi2 =
0.0001<BR>
(V_b-V_B is not positive definite)<BR>###End Stata
9.2####<BR></DIV></DIV></DIV></BLOCKQUOTE></DIV></DIV></DIV></DIV></BLOCKQUOTE></DIV><BR></BODY></HTML>