Page 1 of 2

Heteroscedastic Probit

Posted: Mon Apr 27, 2015 1:49 am
by trubador
The following code estimates a probit model with a correction for heteroscedasticity of the form Var(e) = exp(k1*z1 + k2*z2 + ...+ km*zm):

Code: Select all

'Example 17.10 (p. 715) of Greene, William H. (2012) Econometric Analysis, 7th edition, Prentice-Hall.
wfopen http://www.stern.nyu.edu/~wgreene/Text/Edition7/TableF5-1.txt
logl hetprobit
hetprobit.append @logl maxlik
hetprobit.append index = c(1) + c(2)*wa + c(3)*wa^2 + c(4)*faminc + c(5)*we + c(6)*((kl6+k618)>0)
hetprobit.append sig = @exp(c(7)*((kl6+k618)>0)+c(8)*faminc)
hetprobit.append adjindex = index/sig
hetprobit.append maxlik = lfp*log(1-@cnorm(-adjindex)) + (1-lfp)*log(@cnorm(-adjindex))
hetprobit.ml(optmethod=legacy)
'Heteroscedasticity test (Wald)
freeze(mode=overwrite,waldtest) hetprobit.wald c(7)=0, c(8)=0

Re: Heteroscedastic Probit

Posted: Mon Apr 27, 2015 8:54 am
by Kath
Many thanks!
Two additional questions:
Also, do you know a way to estimate a logit model with a correction for heteroscedasticity?
And there is a test to check if there is heteroscedasticity in the logit/probit models?

Re: Heteroscedastic Probit

Posted: Tue Apr 28, 2015 1:41 am
by trubador
Kath wrote:Also, do you know a way to estimate a logit model with a correction for heteroscedasticity?

Just replace @cnorm with @clogistic in the likelihood function.
Kath wrote:And there is a test to check if there is heteroscedasticity in the logit/probit models?

The final line does a Wald test to check for heteroscedasticity. Please see the cited reference for more details.

Re: Heteroscedastic Probit

Posted: Fri May 01, 2015 1:51 am
by trubador
Testing for heteroscedasticity in binary dependent variable models (David and MacKinnon, 1993):

Code: Select all

'EViews 9 Users Guide II, Chapter 28, pp.315-316
wfopen http://www.stern.nyu.edu/~wgreene/Text/Edition7/TableF5-1.txt
equation probiteq.binary(d=n, h,optmethod=legacy) lfp c wa wa^2 faminc we (kl6+k618>0)
probiteq.fit p_hat
probiteq.fit(i) xb
probiteq.makeresids(s) brmr_y
series fac=@dnorm(-xb)/@sqrt(p_hat*(1-p_hat))
group brmr_x.add fac (fac*wa) (fac*wa^2) (fac*faminc) (fac*we) (fac*(kl6+k618>0))
equation artificialeq.ls brmr_y brmr_x (fac*(-xb)*faminc) (fac*(-xb)*(kl6+k618>0))
artificialeq.fit brmr_yf
scalar lm_test=@sumsq(brmr_yf)
scalar p_val=1-@cchisq(lm_test,2)

Re: Heteroscedastic Probit

Posted: Sat May 02, 2015 8:54 am
by Kath
Many thanks
I used the code you suggest in order to estimate a probit model with a correction for heteroscedasticity but when I try to run the code it appears in the screen the following message:"Missing values in @Logl series at current coefficients at observation 1 in "Do_hetprobit.ml (optmethod=legacy)".
Do you know what is the problem? Can you please help me?
Kath

Re: Heteroscedastic Probit

Posted: Mon May 04, 2015 6:19 am
by trubador
Hard to say without seeing the actual workfile. You can either adjust the estimation period (i.e. sample) or try different starting values for the coefficients (i.e. c(.)).

Re: Heteroscedastic Probit

Posted: Mon May 04, 2015 8:32 am
by Kath
Ok, thanks.
Sorry, disturb you again...but I have another doubt.
Also, I run the code to estimate a probit model with a correction for heteroscedasticity using the data available at: http://www.stern.nyu.edu/~wgreene/Text/ ... TableF14-1, and this time I had no problems. However, although the estimates of the parameters are correct, the standard errors are not (I confirm in the book: Greene, William H. (2000), Econometric Analysis, 4th edition, page 830).
Do you know why? What is the problem?

My code is:
logl hetprobit
hetprobit.append @logl maxlik
hetprobit.append index = c(1) + c(2)*gpa + c(3)*tuce + c(4)*psi
hetprobit.append sig=@exp(c(5)*psi)
hetprobit.append adjindex=index/sig
hetprobit.append maxlik=grade*log(1-@cnorm(-adjindex))+(1-grade)*log(@cnorm(-adjindex))
hetprobit.ml (optmethod=legacy)

' Hetroscedasticity test(Wald)
freeze(mode=overwrite,waldtest) hetprobit.wald c(5)=0

Kath

Re: Heteroscedastic Probit

Posted: Mon May 04, 2015 12:00 pm
by trubador
Unfortunately I do not have access to 4th edition and I cannot seem to find the example you refer to in other editions. The difference may be due to use of different optimization algorithm (e.g. BHHH) or some kind of transformation in the process. In any case, I do not think there is a problem.

Re: Heteroscedastic Probit

Posted: Mon May 04, 2015 2:04 pm
by Kath
But the problem is that, as the standard erros are very different, the p-value are also very different and so the significance of the parameters. Thus, for me some variables are statisticallly significant and in the book they are not and vice-versa. Consequently the conclusions are different...

The model is: Prob(grade=1)= β1+β2*gpa+β3*tuce+β4*psi


My estimated coefficients:

Coefficient (Std. Error)
C(1) -14.28929 (17.01562)
C(2) 3.121627 (3.214196)
C(3) 0.123750 (0.353867)
C(4) 2.343260 (2.342131)
C(5) 1.093392 (1.354041)


Estimated coefficients in the book:

Coefficient (Std. Error)
C(1) -14.28929 (8.861)
C(2) 3.121627 (1.761)
C(3) 0.123750 (0.2134)
C(4) 2.343260 (1.671)
C(5) 1.093392 (0.8806)

Re: Heteroscedastic Probit

Posted: Tue May 05, 2015 3:46 am
by trubador
Usually, maximum likelihood estimation uses the observed information/hessian matrix. However, BHHH algorithm is often used for discrete choice models, which itself has a preference towards OPG (an approximation to the observed hessian matrix). And it seems, this is the default choice in EViews regardless of the chosen optimization algorithm.

You'll get similar results by simply changing following line:

Code: Select all

...
hetprobit.ml(covinfo=hessian)
...

Re: Heteroscedastic Probit

Posted: Wed May 06, 2015 10:10 am
by Kath
So, my results are different comparatively to the results in the book due to the optimization algorithm? It is a question of the optimization algorithm used?

Re: Heteroscedastic Probit

Posted: Wed May 06, 2015 12:09 pm
by EViews Glenn
It's not the algorithm employed for estimation, it's the estimator used for the coefficient covariances. As trubador points out, the coefficient covariance results from the book are computed using the inverse of the negative of the Hessian. Your example uses the outer product of the gradients.

The reason that you are seeing it tied to method is that the older engine, EViews legacy, only offers a covariance estimator based on the outer product of the scores. If you select "optmethod=bhhh" you're using roughly the same method as EViews legacy, but you'll also get to use the "covinfo=hessian" method for computing the covariances.

Re: Heteroscedastic Probit

Posted: Fri May 08, 2015 1:39 am
by Kath
Many thanks.
If the the results are different due to the estimator used for the coefficient covariances, it is not possible to use in Eviews the estimator used in the book, this is the inverse of the negative of the Hessian?
In Eviews is possible to use not only the outer product of the gradients (as I used in the example) but also the inverse of the negative of the Hessian as used in the book?

Re: Heteroscedastic Probit

Posted: Fri May 08, 2015 10:11 am
by EViews Glenn
The example given above uses the hessian. As trubador wrote a couple of posts above, change the line with the ML estimation command to

Code: Select all

hetprobit.ml(covinfo=hessian)

You can use the "covinfo=hessian" option with all of the estimation methods with the exception of legacy.

Re: Heteroscedastic Probit

Posted: Tue May 12, 2015 10:33 am
by Kath
As suggested I used the command hetprobit.ml(covinfo=hessian) and I obtain exactly the same results as using the command hetprobit.ml (optmethod=legacy) or hetprobit.ml (optmethod=bhhh). So using different estimators for the coefficient covariances I obtain the same results.It is possible?
And why using the command hetprobit.ml(covinfo=hessian) the results are different comparatively to the results in the book? As I understood they should be equal. I'm a little confused...