Graham,
I verified using your data set that Gretl calculates correctly the Breusch-Pagan LM test for heteroskedasticity, as described in the original paper,


A Simple Test for Heteroscedasticity and Random Coefficient Variation
Author(s): T. S. Breusch and A. R. Pagan
Source: Econometrica, Vol. 47, No. 5 (Sep., 1979), pp. 1287-1294
Published by: The Econometric Society
Stable URL: http://www.jstor.org/stable/1911963

The auxiliary regression is performed using the scaled squared residuals as Dependent variable (as indicated in the Gretl's output), and the statistic is 0.5*R^2*(Total Sum of Squares of the Dependent Variable), the R^2 from this auxiliary regression, where I used the exact same regression matrix of the main regression (constant + the three regressors)

The scaling of the squared residual series is by the maximum likelihood estimator for the variance from the original model, ie. sum of squared residuals divided by nobs (not nobs-1).

Maddala's  Econometrics textbook (2001, 3d ed. pp 205-207) explains the relation of the above statistic with the approach you implemented (correctly) by hand, which is the "usual" way to obtain an LM statistic.
But these are only asymptotically equivalent, and in practice the estimated sigma^4 is involved, whose estimation is seriously biased in any case for samples much larger than yours.

So I do not think there is any bug or computational mistake involved, just an (educative) case of asymptotic equivalence not materializing at finite-sample level.
Personally I would go with the original Breusch-Pagan test statistic.



Alecos Papadopoulos
Athens University of Economics and Business, Greece
Department of Economics
cell:+30-6945-378680
fax: +30-210-8259763
skype:alecos.papadopoulos
On 4/5/2015 16:31, gretl-users-request@lists.wfu.edu wrote:
Message: 1
Date: Mon, 04 May 2015 11:07:53 +0100
From: Graham Stark <graham.stark@virtual-worlds.biz>
To: gretl-users@lists.wfu.edu
Subject: [Gretl-users] Pagan  Heteroskedasticity Test
Message-ID: <1430734073.12002.6.camel@virtual-worlds.biz>
Content-Type: text/plain; charset="utf-8"

Hi,
   
I'm puzzled by the output of the Breusch-Pagan Heterokskedasticity test 

The example here: 

http://virtual-worlds-research.com/ou/econometrics/hetero_test.zip

shows me attempting to replicate Gretl's Breusch-Pagan and White tests
on a simple teaching dataset. The White Test is identical but the Pagan
test is very different from how I always thought you did it. Apologies
if I've misunderstood what you're doing.

This is the packaged Gretl 1.9.91 from Debian Linux, but I'm pretty
certain you get the same result on the latest Windows version (it was a
student running Windows that asked me about this). As yet I haven't
tried the latest Sourceforge versions, I'm afraid.

While I'm here, I'd just like to thank everyone involved with this
project for all their good work. I teach with Gretl at the UK Open
University, several hundred students per year, and it's been a boon to
us.

regards,

Graham


-- Graham Stark, Virtual Worlds Research http://www.virtual-worlds-research.com 136 Hainault Avenue, Milton Keynes, MK14 5PG, UK t: (+044) 01908 618239 skype: graham_k_stark m:(+044)07763309602 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: This is a digitally signed message part URL: <http://lists.wfu.edu/pipermail/gretl-users/attachments/20150504/41b53f33/attachment-0001.sig>