How is the LM test calculated for Gretl for just a standard model.

I just ran a model

Model 5: OLS, using observations 1-2017

Dependent variable: nettfa

 

             coefficient   std. error   t-ratio    p-value

  ---------------------------------------------------------

  const      -20.9850      2.47202      -8.489    3.98e-017 ***

  inc          0.770583    0.0614520    12.54     8.73e-035 ***

  age25        0.0251267   0.00259339    9.689    9.96e-022 ***

  male         2.47793     2.04778       1.210    0.2264  

  e401k        6.88622     2.12327       3.243    0.0012    ***

 

Mean dependent var   13.59498   S.D. dependent var   47.59058

Sum squared resid     3982124   S.E. of regression   44.48805

R-squared            0.127868   Adjusted R-squared   0.126134

F(4, 2012)           73.74763   P-value(F)           2.18e-58

Log-likelihood      -10514.46   Akaike criterion     21038.91

Schwarz criterion    21066.96   Hannan-Quinn         21049.21

 

When I save the residuals squared to run the Pagan test I get this

 

 

Model 6: OLS, using observations 1-2017

Dependent variable: usq5

 

Coefficient

Std. Error

t-ratio

p-value

 

const

-4573.55

1848.7

-2.4739

0.01345

**

inc

112.358

45.9568

2.4449

0.01458

**

age25

4.84866

1.93946

2.5000

0.01250

**

male

2331.25

1531.43

1.5223

0.12810

 

e401k

1164.83

1587.89

0.7336

0.46330

 

 

Mean dependent var

1974.280

 

S.D. dependent var

33367.52

Sum squared resid

2.23e+12

 

S.E. of regression

33270.33

R-squared

0.007789

 

Adjusted R-squared

0.005817

F(4, 2012)

3.948695

 

P-value(F)

0.003387

Log-likelihood

-23861.35

 

Akaike criterion

47732.70

Schwarz criterion

47760.75

 

Hannan-Quinn

47742.99

The LM test from my understanding is n*r^2, which here would be 15.71

 

Using gretl’s built in test I get the following:

 

Breusch-Pagan test for heteroskedasticity

OLS, using observations 1-2017

Dependent variable: scaled uhat^2

 

             coefficient   std. error    t-ratio   p-value

  --------------------------------------------------------

  const      -2.31657      0.936391      -2.474    0.0134  **

  inc         0.0569109    0.0232777      2.445    0.0146  **

  age25       0.00245591   0.000982363    2.500    0.0125  **

  male        1.18081      0.775689       1.522    0.1281

  e401k       0.590001     0.804287       0.7336   0.4633

 

  Explained sum of squares = 4485.49

 

Test statistic: LM = 2242.746588,

with p-value = P(Chi-square(4) > 2242.746588) = 0.000000

 

How did the LM test become so big for this model?