[R] plm: Hausman Test error

Millo Giovanni Giovanni_Millo at Generali.com
Tue Apr 2 15:21:05 CEST 2013

Here are my comments: your email would make for such a nice bug report,
if only you would add:
- a reproducible example of the fail in phtest()
- a reproducible example of your code, if it's yours, and also the
source of the code, if on the contrary you found it somewhere; because
as it is, you make it almost impossible to help you.
For more on this, please see the posting guide.

Anyway, in principle the Hausman test is correct. I've had code for this
lying around for ages, I'll try to add it to 'plm' one of these days;
but as in the end it is simply a joint restriction test, waldtest()
should work fine. 

Best wishes,

--------------- original message ---------------

Message: 26
Date: Mon, 1 Apr 2013 10:35:59 -0700 (PDT)
From: londonphd <r.otojanov at qmul.ac.uk>
To: r-help at r-project.org
Subject: [R] plm: Hausman Test error
Message-ID: <1364837759243-4662980.post at n4.nabble.com>
Content-Type: text/plain; charset=us-ascii

Hi, I am trying to run a panel regression using 88 observations and 9
variables. In-built Hausman Test did not work, then I found a code for
auxiliary regression method for the Hausman test. 

The panel models are:

fe=plm(gd ~ l+g+o+c+g1+h+n+r, model = "within", data = new.frame,index =
re=plm(gd ~ l+g+o+c+g1+h+n+r, model = "random", data = new.frame,index =

then I wrote the following function for the Hausman Test using an
regression method:

    colnames(auxdata)<-c("y", paste("x", 1:17, sep="")) 
   return(waldtest(auxmod, 10:17)[2,4])

using the function above to choose between "fe" and "re"

Error in solve(vc[ovar, ovar]) : subscript out of bounds

Not sure what's gone wrong this time. I would appreciate your comments!

View this message in context:
Sent from the R help mailing list archive at Nabble.com.

-------------- end original message ----------------

Ai sensi del D.Lgs. 196/2003 si precisa che le informazi...{{dropped:12}}

More information about the R-help mailing list