Sunday, November 6, 2016

The BMST Package for Gretl

As a follow-up to this recent post, I heard again from Artur Tarassow.

You'll see from his email message below that he's extended his earlier work and has prepared a new package for Gretl called "Binary Models Specification Tests".

It's really good to see tests of this type being made available for users of different software - especially free software such as Gretl.

Artur writes:

Dear Dave,

I’ve decided to write up a more comprehensive package on this topic. The new Gretl package is called “BMST” which stands for “Binary Models Specification Tests”. This single package comprises your three tests for Logit models as well as two tests for Probit models. To be more concrete, the following tests are now available within a SINGLE package:

LOGIT models:
a) LM Test of Logistic Against Burr Type II
b) LM tests for homoskedasticity
c) LM tests for functional form

PROBIT models:
b) LM tests for homoskedasticity
c) LM tests for functional form

As a note to your blog readers: The two Logit model related packages “logit_burr.gfn” and “LOGIT_HETERO.gfn” are not available any more, as BMST includes both of them.

Here is an example on how to use it replicating your Eviews codes:

# The Gretl scripting language
#-------------------------------------------------------------------
# Replicate Dave Giles' PROBIT_HETERO program
#-------------------------------------------------------------------
set echo off
set messages off
open http://web.uvic.ca/~dgiles/downloads/binary_choice/Logistic_Burr.wf1 --quiet
# install BMST.gfn  # Activate only if you haven't downloaded the package yet
include BMST.gfn
type = 2                 # 1=Logit, 2=Probit
probit Y 0 X1 X2
# setupBMST() must always be called 1st!
bundle b = setupBMST(Y, $xlist, $yhat, $coeff, type, 1)
Probit_reset(&b)     # Next, call the test of interest
print b                     # Print information stored in the bundle ‘b’
scalar PR_reset_pval = b.Prob_reset_pval # Store p-value of Logistic Against Burr Type II test
print PR_reset_pval
Probit_hom(&b)         # Call another test

#----------------------------------------
# Replicate Dave Giles' LOGIT_HETERO and
# LOGIT_BURR programs
#-----------------------------------------
type = 1
logit Y const X1 X2
bundle b = setupBMST(Y,$xlist, $yhat, $coeff,type, 1)
Logit_burr(&b)
Logit_reset(&b)
Logit_hom(&b)

Best,

Artur


© 2016, David E. Giles

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.